Fix minor compilation problem with MSVC.
[bpt/emacs.git] / src / ChangeLog
1 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2
3 * emacs.c: Move the inclusion of TERM_HEADER after including
4 windows.h on WINDOWSNT. This avoids compilation problems with
5 MSVC.
6
7 2012-10-01 Eli Zaretskii <eliz@gnu.org>
8
9 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
10 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
11 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
12 as the previous version used 'void *'.
13
14 * ralloc.c (ROUNDUP): Fix last change.
15 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
16 'size_t'.
17
18 * w32proc.c <disable_itimers>: New static flag.
19 (init_timers): Initialize it to zero, after creating the critical
20 sections used by the timer threads.
21 (term_timers): Set to 1 before deleting the critical sections.
22 (getitimer, setitimer): If disable_itimers is non-zero, return an
23 error indication without doing anything. Reported by Fabrice
24 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
25 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
26 return results.
27 [!HAVE_SETITIMER]: Behave as the previous version that didn't
28 support timers.
29
30 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
31 term_ntproc after all the other bookkeeping, to get timers working
32 as long as possible.
33
34 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
35
36 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
37 Suggested by Juri Linkov in
38 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
39
40 Prefer plain 'static' to 'static inline' (Bug#12541).
41 With static functions, modern compilers inline pretty well by
42 themselves; advice from programmers often hurts as much as it helps.
43 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
44 this change shrinks the text size of the Emacs executable by 1.1%
45 without affecting CPU significantly in my benchmark.
46 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
47 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
48 (mark_maybe_object, mark_maybe_pointer, bounded_number):
49 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
50 (bset_auto_fill_function, bset_auto_save_file_format)
51 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
52 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
53 (bset_cache_long_line_scans, bset_case_fold_search)
54 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
55 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
56 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
57 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
58 (bset_header_line_format, bset_indicate_buffer_boundaries)
59 (bset_indicate_empty_lines, bset_invisibility_spec)
60 (bset_left_fringe_width, bset_major_mode, bset_mark)
61 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
62 (bset_name, bset_overwrite_mode, bset_pt_marker)
63 (bset_right_fringe_width, bset_save_length)
64 (bset_scroll_bar_width, bset_scroll_down_aggressively)
65 (bset_scroll_up_aggressively, bset_selective_display)
66 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
67 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
68 (set_buffer_overlays_after):
69 * category.c (bset_category_table):
70 * charset.c (read_hex):
71 * coding.c (produce_composition, produce_charset)
72 (handle_composition_annotation, handle_charset_annotation)
73 (char_encodable_p):
74 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
75 (assign_row, set_frame_matrix_frame, make_current)
76 (add_row_entry):
77 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
78 * fns.c (maybe_resize_hash_table):
79 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
80 * gmalloc.c (register_heapinfo):
81 * image.c (lookup_image_type):
82 * intervals.c (set_interval_object, set_interval_left)
83 (set_interval_right, copy_interval_parent, rotate_right)
84 (rotate_left, balance_possible_root_interval):
85 * keyboard.c (kset_echo_string, kset_kbd_queue)
86 (kset_keyboard_translate_table, kset_last_prefix_arg)
87 (kset_last_repeatable_command, kset_local_function_key_map)
88 (kset_overriding_terminal_local_map, kset_real_last_command)
89 (kset_system_key_syms, clear_event, set_prop):
90 * lread.c (digit_to_number):
91 * marker.c (attach_marker, live_buffer, set_marker_internal):
92 * nsterm.m (ns_compute_glyph_string_overhangs):
93 * process.c (pset_buffer, pset_command)
94 (pset_decode_coding_system, pset_decoding_buf)
95 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
96 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
97 (pset_status, pset_tty_name, pset_type, pset_write_queue):
98 * syntax.c (bset_syntax_table, dec_bytepos):
99 * terminal.c (tset_param_alist):
100 * textprop.c (interval_has_some_properties)
101 (interval_has_some_properties_list):
102 * window.c (wset_combination_limit, wset_dedicated)
103 (wset_display_table, wset_hchild, wset_left_fringe_width)
104 (wset_left_margin_cols, wset_new_normal, wset_new_total)
105 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
106 (wset_right_fringe_width, wset_right_margin_cols)
107 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
108 (wset_vertical_scroll_bar_type, wset_window_parameters):
109 * xdisp.c (wset_base_line_number, wset_base_line_pos)
110 (wset_column_number_displayed, wset_region_showing)
111 (window_box_edges, run_window_scroll_functions)
112 (append_glyph_string_lists, prepend_glyph_string_lists)
113 (append_glyph_string, set_glyph_string_background_width)
114 (append_glyph, append_composite_glyph)
115 (take_vertical_position_into_account):
116 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
117 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
118 (lface_hash, lface_same_font_attributes_p, lookup_face):
119 * xml.c (libxml2_loaded_p):
120 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
121 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
122 Now 'static', not 'static inline'.
123
124 * bidi.c: Tune.
125 (bidi_copy_it): Do the whole copy with a single memcpy.
126 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
127
128 Revert the FOLLOW-SYMLINKS change for file-attributes.
129 Doing it right would require several changes to Tramp, and there's
130 not enough time to get that tested before the freeze today.
131 * dired.c (directory_files_internal, Ffile_attributes):
132 Undo last change.
133
134 * frame.c (x_report_frame_params): Port better to wider ints.
135 Do not assume that EMACS_UINT is the same width as uprintmax_t,
136 or that pointers can be printed in 15 decimal digits.
137 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
138
139 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
140
141 Support x64 build on MS-Windows.
142 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
143 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
144 compatibility with x64.
145 (x_get_focus_frame): Add prototype.
146
147 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
148 defining an XRectangle structure.
149
150 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
151 arithmetics for compatibility with x64.
152
153 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
154 compatibility with x64.
155
156 * w32heap.h: Adjust prototypes and declarations.
157
158 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
159 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
160 DWORD, long, and unsigned long, for compatibility with x64.
161 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
162 (sbrk): Argument is now of type ptrdiff_t.
163
164 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
165 less than 0x0500.
166 (w32_msg_pump): Use WPARAM type for 'result'.
167
168 * w32.c (init_environment, get_emacs_configuration): Support AMD64
169 architecture.
170 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
171 compatibility with x64.
172
173 * vm-limit.c (lim_data): Now size_t.
174 (check_memory_limits): Adjust prototypes of real_morecore and
175 __morecore to receive argument of type ptrdiff_t. Use size_t for
176 five_percent and data_size.
177
178 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
179 variables, for compatibility with x64.
180 (rva_to_section, offset_to_section, relocate_offset)
181 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
182 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
183 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
184 for compatibility with x64.
185
186 * sysdep.c (STDERR_FILENO): Define if not already defined.
187
188 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
189 (__morecore): Argument type is now ptrdiff_t.
190 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
191 (relinquish): Use ptrdiff_t type for 'excess'.
192 (r_alloc_sbrk): Argument type is now ptrdiff_t.
193
194 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
195 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
196 instead of a literal number.
197
198 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
199 (min): Define only if not already defined.
200
201 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
202 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
203 hosts.
204
205 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
206 'bitmaps' is a pointer.
207
208 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
209
210 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
211
212 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
213
214 file-attributes has a new optional arg FOLLOW-SYMLINKS.
215 * dired.c (directory_files_internal, Ffile_attributes):
216 New arg follow_symlinks. All uses changed.
217
218 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
219
220 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
221
222 2012-09-30 Eli Zaretskii <eliz@gnu.org>
223
224 Support atimers and CPU profiler via profile.c on MS-Windows.
225 * w32proc.c (sig_mask, crit_sig): New static variables.
226 (sys_signal): Support SIGALRM and SIGPROF.
227 (sigemptyset, sigaddset, sigfillset, sigprocmask)
228 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
229 sigfillset, and sigprocmask are no longer no-ops.
230 (sigismember): New function.
231 (struct itimer_data): New definition.
232 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
233 (crit_prof): New static variables.
234 (MAX_SINGLE_SLEEP): New definition.
235 (timer_loop, stop_timer_thread, term_timers, init_timers)
236 (start_timer_thread, getitimer, setitimer): New functions.
237 (alarm): No longer a no-op, calls setitimer.
238
239 * w32.c (term_ntproc): Call term_timers.
240 (init_ntproc): Make sure all signals are unblocked at startup, to
241 erase any traces of dumping. Call init_timers.
242
243 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
244 Windows-specific code to display the hourglass mouse pointer is no
245 longer used.
246 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
247 to hourglass timer expiration.
248 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
249 Remove, no longer used.
250 (w32_note_current_window, show_hourglass, hide_hourglass):
251 New functions, in support of hourglass cursor display similar to other
252 window systems.
253 (syms_of_w32fns): Don't initialize hourglass_timer.
254
255 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
256 WINDOWSNT as well.
257 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
258
259 * w32.h (init_timers, term_timers): Add prototypes.
260
261 2012-09-30 Kenichi Handa <handa@gnu.org>
262
263 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
264 to the buffer relocation which may be caused by ccl_driver.
265
266 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
267
268 * xfns.c (Fx_file_dialog): Update comment.
269
270 * w32fns.c (Fx_file_dialog): Update comment.
271
272 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
273 Initialize panel name field if OSX >= 10.6.
274
275 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
276
277 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
278
279 * nsterm.m (NEW_STYLE_FS): New define.
280 (ns_fullscreen_hook, windowWillEnterFullScreen)
281 (windowDidEnterFullScreen, windowWillExitFullScreen)
282 (windowDidExitFullScreen, toggleFullScreen, handleFS)
283 (setFSValue): New functions.
284 (EmacsFSWindow): New implementation.
285 (canBecomeKeyWindow): New function for EmacsFSWindow.
286 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
287 (dealloc): Release nonfs_window if in fullscreen.
288 (updateFrameSize:): Call windowDidMove to update top/left.
289 (windowWillResize:toSize:): Check if frame is still maximized.
290 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
291 next_maximized, maximized_width, maximized_height and nonfs_window.
292 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
293 tbar_height.
294 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
295 fullscreen. Set maximized_width/height. Act on next_maximized.
296
297 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
298 (EmacsView): Add variables for fullscreen.
299 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
300 (EmacsFSWindow): New interface for fullscreen.
301
302 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
303
304 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
305
306 2012-09-30 Chong Yidong <cyd@gnu.org>
307
308 * fns.c (Frandom): Doc fix.
309
310 2012-09-30 Martin Rudalics <rudalics@gmx.at>
311
312 * window.c (Vwindow_combination_limit): New default value.
313 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
314
315 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
316
317 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
318 Suggested by Eli Zaretskii in
319 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
320
321 2012-09-30 Eli Zaretskii <eliz@gnu.org>
322
323 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
324 HAVE_TIMER_SETTIME is defined.
325
326 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
327
328 Profiler improvements: more-accurate timers, overflow checks.
329 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
330 signal.h, setjmp.h. Include systime.h instead.
331 (saturated_add): New function.
332 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
333 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
334 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
335 New static vars.
336 (enum profiler_cpu_running): New enum.
337 (profiler_cpu_running): Now of that enum type, not bool.
338 All uses changed to store the new value.
339 (handle_profiler_signal): Rename from sigprof_handler_1,
340 for consistency with other handlers. Do not check whether
341 cpu_log is a hash-table if garbage collecting, since it
342 doesn't matter in that case.
343 (deliver_profiler_signal): Rename from sigprof_handler,
344 for consistency with other handlers.
345 (setup_cpu_timer): New function, with much of what used to be in
346 Fprofiler_cpu_start. Check for out-of-range argument.
347 Prefer timer_settime if available, and prefer
348 thread cputime clocks, then process cputime clocks, then
349 monotonic clocks, to the old realtime clock. Use make_timeval
350 to round more-correctly when falling back to setitimer.
351 (Fprofiler_cpu_start): Use it.
352 (Fprofiler_cpu_stop): Prefer timer_settime if available.
353 Don't assume that passing NULL as the 2nd argument of setitimer
354 is the same as passing a pointer to all-zero storage.
355 Ignore SIGPROF afterwards.
356 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
357 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
358 non-fatal signal handlers. Ignore SIGPROF on startup.
359 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
360 in profiler.c, since sysdep.c now uses it.
361
362 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
363 Suggested by Eli Zaretskii in
364 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
365
366 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
367
368 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
369
370 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
371
372 * lisp.h (struct backtrace): Remove indirection for `function' field.
373 * xdisp.c (redisplay_internal):
374 * profiler.c (record_backtrace, sigprof_handler_1):
375 * alloc.c (Fgarbage_collect):
376 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
377 (Fbacktrace_frame): Adjust accordingly.
378
379 2012-09-28 Glenn Morris <rgm@gnu.org>
380
381 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
382 (Frun_hook_with_args_until_failure): Doc fixes.
383
384 2012-09-28 Eli Zaretskii <eliz@gnu.org>
385
386 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
387 Qautomatic_redisplay and change the symbol name. All users changed.
388
389 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
390
391 * profiler.c (sigprof_handler): Fix race condition.
392
393 2012-09-28 Glenn Morris <rgm@gnu.org>
394
395 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
396
397 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
398
399 Check more robustly for timer_settime.
400 * Makefile.in (LIB_TIMER_TIME): New macro.
401 (LIBES): Add it.
402 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
403 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
404 call timer_settime.
405
406 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
407
408 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
409
410 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
411
412 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
413
414 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
415
416 * character.h (MAYBE_UNIFY_CHAR): Remove.
417 * charset.c, charset.h (maybe_unify_char): Now static.
418 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
419 Since this stuff is now private to charset.c, there's no need for
420 a public macro and no need to inline by hand.
421
422 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
423 Stefan Monnier <monnier@iro.umontreal.ca>
424 Juanma Barranquero <lekktu@gmail.com>
425
426 * profiler.c: New file.
427 * Makefile.in (base_obj): Add profiler.o.
428 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
429 ($(BLD)/profiler.$(O)): New target.
430 * emacs.c (main): Call syms_of_profiler.
431 * alloc.c (Qautomatic_gc): New constant.
432 (MALLOC_PROBE): New macro.
433 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
434 (total_bytes_of_live_objects): New function.
435 (Fgarbage_collect): Use it. Record itself in backtrace_list.
436 Call malloc_probe for the memory profiler.
437 (syms_of_alloc): Define Qautomatic_gc.
438 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
439 race condition.
440 (struct backtrace): Move definition...
441 * lisp.h (struct backtrace): ..here.
442 (Qautomatic_gc, profiler_memory_running): Declare vars.
443 (malloc_probe, syms_of_profiler): Declare functions.
444 * xdisp.c (Qautomatic_redisplay): New constant.
445 (redisplay_internal): Record itself in backtrace_list.
446 (syms_of_xdisp): Define Qautomatic_redisplay.
447
448 2012-09-25 Eli Zaretskii <eliz@gnu.org>
449 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
450
451 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
452
453 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
454
455 Prefer POSIX timers if available.
456 They avoid a race if the timer is too close to the current time.
457 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
458 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
459 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
460
461 2012-09-25 Eli Zaretskii <eliz@gnu.org>
462
463 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
464 CHAR_STRING_ADVANCE.
465 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
466 STRING_CHAR_ADVANCE.
467
468 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
469
470 Move Vlibrary_cache to emacs.c and reset before dumping.
471
472 * lisp.h (reset_image_types): Declare.
473 [WINDOWSNT] (Vlibrary_cache): Declare.
474
475 * image.c (reset_image_types): New function.
476
477 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
478 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
479 (Fdump_emacs): Reset Vlibrary_cache and image_types.
480
481 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
482 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
483
484 * w32.h (Vlibrary_cache): Do not declare.
485
486 2012-09-25 Eli Zaretskii <eliz@gnu.org>
487
488 * w32proc.c (sys_signal): Handle all signals defined by the
489 MS-Windows runtime, not just SIGCHLD. Actually install the signal
490 handlers for signals supported by Windows. Don't override
491 term_ntproc as the handler for SIGABRT.
492 (sigaction): Rewrite to call sys_signal instead of duplicating its
493 code.
494 (sys_kill): Improve commentary.
495
496 * w32.c (term_ntproc): Accept (and ignore) one argument, for
497 consistency with a signature of a signal handler. All callers
498 changed.
499 (init_ntproc): Accept an argument DUMPING. If dumping, don't
500 install term_ntproc as a signal handler for SIGABRT, as that
501 should be done by the dumped Emacs.
502
503 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
504
505 * w32select.c (term_w32select): Protect against repeated
506 invocation by setting clipboard_owner to NULL after calling
507 DestroyWindow.
508
509 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
510 and term_ntproc to their modified signatures.
511
512 * character.c (char_string, string_char): Remove calls to
513 MAYBE_UNIFY_CHAR. See the discussion starting at
514 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
515 for the details.
516
517 2012-09-25 Chong Yidong <cyd@gnu.org>
518
519 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
520
521 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
522
523 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
524 when encountering an unknown bytecode.
525
526 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
527
528 image.c, indent.c: Use bool for booleans.
529 * dispextern.h (struct image_type): Members valid_p, load, init
530 now return bool, not int. All uses changed.
531 * image.c: Omit unnecessary static decls.
532 (x_create_bitmap_mask, x_build_heuristic_mask):
533 Return void, not int, since callers don't care about the return value.
534 (x_create_bitmap_mask, define_image_type, valid_image_p)
535 (struct image_keyword, parse_image_spec, image_spec_value)
536 (check_image_size, image_background)
537 (image_background_transparent, x_clear_image_1)
538 (postprocess_image, lookup_image, x_check_image_size)
539 (x_create_x_image_and_pixmap, xbm_image_p)
540 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
541 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
542 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
543 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
544 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
545 (png_image_p, init_png_functions, png_load_body, png_load)
546 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
547 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
548 (init_gif_functions, gif_load, imagemagick_image_p)
549 (imagemagick_load_image, imagemagick_load, svg_image_p)
550 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
551 (gs_load):
552 * nsimage.m (ns_load_image):
553 * nsterm.m (ns_defined_color):
554 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
555 * xfns.c (x_defined_color):
556 * xterm.c (x_alloc_lighter_color_for_widget)
557 (x_alloc_nearest_color_1, x_alloc_nearest_color)
558 (x_alloc_lighter_color):
559 * indent.c (disptab_matches_widthtab, current_column)
560 (scan_for_column, string_display_width, indented_beyond_p)
561 (compute_motion, vmotion, Fvertical_motion):
562 Use bool for booleans.
563
564 2012-09-24 Chong Yidong <cyd@gnu.org>
565
566 * chartab.c (Fset_char_table_default): Obsolete function removed.
567
568 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
569
570 Move pid_t related decls out of lisp.h.
571 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
572 (interruptible_wait_for_termination):
573 Move these decls from lisp.h to syswait.h, since they use pid_t.
574 Needed on FreeBSD; see Herbert J. Skuhra in
575 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
576 * callproc.c: Include syswait.h.
577
578 gnutls.c, gtkutil.c: Use bool for boolean.
579 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
580 (emacs_gnutls_handle_error):
581 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
582 (xg_hide_tooltip, xg_create_frame_widgets)
583 (create_dialog, xg_uses_old_file_dialog)
584 (xg_get_file_with_chooser, xg_get_file_with_selection)
585 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
586 (xg_item_label_same_p, xg_update_menubar)
587 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
588 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
589 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
590 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
591 (update_frame_tool_bar, free_frame_tool_bar):
592 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
593 * nsmenu.m (ns_update_menubar):
594 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
595 * xfns.c (Fx_show_tip) [USE_GTK]:
596 Use bool for boolean.
597 * gtkutil.c (xg_update_frame_menubar):
598 * xmenu.c (update_frame_menubar):
599 Return void, not int, since caller ignores return value.
600 * gtkutil.c (xg_change_toolbar_position):
601 Return void, not 1.
602
603 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
604
605 * makefile.w32-in (BLOCKINPUT_H): Remove.
606 (SYSSIGNAL_H): New macro.
607 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
608 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
609 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
610 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
611 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
612 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
613 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
614 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
615 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
616 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
617 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
618 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
619 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
620 ($(BLD)/w32xfns.$(O)): Update dependencies.
621
622 2012-09-23 Eli Zaretskii <eliz@gnu.org>
623
624 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
625 fatal_error_backtrace.
626
627 * w32proc.c (sys_kill): Undo last change: don't do anything when
628 invoked to deliver SIGABRT to our own process. This is now
629 handled by emacs_raise.
630
631 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
632
633 * w32term.c (w32_read_socket): Remove leftover reference to
634 interrupt_input_pending.
635
636 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
637
638 Do not use SA_NODEFER.
639 Problem reported by Dani Moncayo in
640 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
641 * alloc.c (die):
642 * sysdep.c (emacs_abort): Do not reset signal handler.
643 * emacs.c (terminate_due_to_signal): Reset signal handler here.
644 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
645 wanted even on POSIXish hosts, and it doesn't work on Windows.
646
647 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
648
649 * xterm.c (x_term_init): Call fixup_locale before and after calling
650 gtk_init (Bug#12392).
651
652 2012-09-23 Chong Yidong <cyd@gnu.org>
653
654 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
655 Vdynamic_library_alist.
656
657 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
658 (Fgnutls_available_p): Caller changed.
659
660 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
661 (Flibxml_parse_xml_region): Likewise.
662
663 * dispextern.h (struct image_type): Remove arg from init function.
664
665 * image.c (Finit_image_library, lookup_image_type)
666 (define_image_type): Remove now-unneeded second arg.
667 (init_xpm_functions, init_png_functions, init_jpeg_functions)
668 (init_tiff_functions, init_gif_functions, init_svg_functions):
669 Arglist and w32_delayed_load calling convention changed.
670 (gs_type): Remove init_gs_functions; there is no such function.
671 (valid_image_p, make_image): Fix caller to lookup_image_type.
672
673 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
674
675 Simplify and avoid signal-handling races (Bug#12471).
676 * alloc.c (die):
677 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
678 Avoid recursive loop if there's a fatal error in the function itself.
679 * atimer.c (pending_atimers):
680 * blockinput.h: Don't include "atimer.h"; no longer needed.
681 (interrupt_input_pending): Remove. All uses removed.
682 pending_signals now counts both atimers and ordinary interrupts.
683 This is less racy than having three separate pending-signal flags.
684 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
685 (input_blocked_p):
686 Rename from their upper-case counterparts BLOCK_INPUT,
687 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
688 INPUT_BLOCKED_P, and turn into functions. All uses changed.
689 This makes it easier to access volatile variables more accurately.
690 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
691 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
692 that's more reliable if the code is buggy and sets
693 interrupt_input_blocked to a negative value. All uses changed.
694 * atimer.c (deliver_alarm_signal):
695 Remove. No need to deliver this to the parent; any thread can
696 handle this signal now. All uses replaced by underlying handler.
697 * atimer.c (turn_on_atimers):
698 * dispnew.c (handle_window_change_signal):
699 * emacs.c (handle_danger_signal):
700 * keyboard.c (kbd_buffer_get_event):
701 Don't reestablish signal handler; not needed with sigaction.
702 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
703 (UNBLOCK_INPUT_TO):
704 Rework to avoid unnecessary accesses to volatile variables.
705 (UNBLOCK_INPUT_TO): Now a function.
706 (totally_unblock_input, unblock_input): New decls.
707 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
708 (init_data): Remove. Necessary stuff now done in init_signal.
709 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
710 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
711 (fatal_error_code): Remove; no longer needed.
712 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
713 it doesn't always backtrace. All uses changed. No need to reset
714 signal to default, since sigaction and/or die does that for us now.
715 Use emacs_raise (FOO), not kill (getpid (), FOO).
716 (main): Check more-accurately whether we're dumping.
717 Move fatal-error setup to sysdep.c
718 * floatfns.c: Do not include "syssignal.h"; no longer needed.
719 * gtkutil.c (xg_get_file_name, xg_get_font):
720 Remove no-longer-needed signal-mask manipulation.
721 * keyboard.c, process.c (POLL_FOR_INPUT):
722 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
723 * keyboard.c (read_avail_input): Remove.
724 All uses replaced by gobble_input.
725 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
726 (kbd_buffer_store_event_hold, gobble_input):
727 (record_asynch_buffer_change) [USABLE_SIGIO]:
728 (store_user_signal_events):
729 No need to mess with signal mask.
730 (gobble_input): If blocking input and there are terminals, simply
731 set pending_signals to 1 and return. All hooks changed to not
732 worry about whether input is blocked.
733 (process_pending_signals): Clear pending_signals before processing
734 them, in case a signal comes in while we're processing.
735 By convention callers now test pending_signals before calling us.
736 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
737 New functions, to support changes to blockinput.h.
738 (handle_input_available_signal): Now extern.
739 (reinvoke_input_signal): Remove. All uses replaced by
740 handle_async_input.
741 (quit_count): Now volatile, since a signal handler uses it.
742 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
743 All callers changed. Block SIGINT only if not already blocked.
744 Clear sigmask reliably, even if Fsignal returns, which it can.
745 Omit unnecessary accesses to volatile var.
746 (quit_throw_to_read_char): No need to restore sigmask.
747 * keyboard.c (gobble_input, handle_user_signal):
748 * process.c (wait_reading_process_output):
749 Call signal-handling code rather than killing ourselves.
750 * lisp.h: Include <float.h>, for...
751 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
752 (pending_signals): Now volatile.
753 (syms_of_data): Now const if IEEE floating point.
754 (handle_input_available_signal) [USABLE_SIGIO]:
755 (terminate_due_to_signal, record_child_status_change): New decls.
756 * process.c (create_process): Avoid disaster if memory is exhausted
757 while we're processing a vfork, by tightening the critical section
758 around the vfork.
759 (send_process_frame, process_sent_to, handle_pipe_signal)
760 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
761 ignores SIGPIPE.
762 (send_process): No need for setjmp/longjmp any more, since the
763 SIGPIPE stuff is now gone. Instead, report an error if errno
764 is EPIPE.
765 (record_child_status_change): Now extern. PID and W are now args.
766 Return void, not bool. All callers changed.
767 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
768 Remove. All uses removed. This bug should be fixed now in a
769 different way.
770 (wait_for_termination_1): Use waitpid rather than sigsuspend,
771 and record the child status change directly. This avoids the
772 need to futz with the signal mask.
773 (process_fatal_action): Move here from emacs.c.
774 (emacs_sigaction_flags): New function, containing
775 much of what used to be in emacs_sigaction_init.
776 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
777 caught by emacs, to make races less likely.
778 (deliver_process_signal): Rename from handle_on_main_thread.
779 All uses changed.
780 (BACKTRACE_LIMIT_MAX): Now at top level.
781 (thread_backtrace_buffer, threadback_backtrace_pointers):
782 New static vars.
783 (deliver_thread_signal, deliver_fatal_thread_signal):
784 New functions, for more-accurate delivery of thread-specific signals.
785 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
786 (deliver_arith_signal): Handle in this thread, not
787 in the main thread, since it's triggered by this thread.
788 (maybe_fatal_sig): New function.
789 (init_signals): New arg DUMPING so that we can be more accurate
790 about whether we're dumping. Caller changed.
791 Treat thread-specific signals differently from process-general signals.
792 Block all signals while handling fatal error; that's safer.
793 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
794 on IEEE hosts.
795 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
796 Ignore SIGPIPE unless batch.
797 (emacs_backtrace): Output backtrace for the appropriate thread,
798 which is not necessarily the main thread.
799 * syssignal.h: Include <stdbool.h>.
800 (emacs_raise): New macro.
801 * xterm.c (x_connection_signal): Remove; no longer needed
802 now that we use sigaction.
803 (x_connection_closed): No need to mess with sigmask now.
804 (x_initialize): No need to reset SIGPIPE handler here, since
805 init_signals does this for us now.
806
807 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
808
809 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
810 background rect may be larger (Bug#12245).
811
812 2012-09-23 Chong Yidong <cyd@gnu.org>
813
814 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
815
816 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
817
818 * .gdbinit: Just stop at fatal_error_backtrace.
819 See Stefan Monnier's request in
820 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
821 Remove no-longer-used query of system type.
822
823 2012-09-22 Chong Yidong <cyd@gnu.org>
824
825 * search.c (Freplace_match): Doc fix (Bug#12325).
826
827 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
828
829 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
830 (Fline_end_position): Doc fix.
831
832 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
833
834 2012-09-22 Chong Yidong <cyd@gnu.org>
835
836 * dispextern.h (struct image_type): Add new slot, storing a type
837 initialization function.
838
839 * image.c (define_image_type): Call the image initializer function
840 if it is defined. Arguments and return value changed.
841 (valid_image_p, make_image): Callers changed.
842 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
843 (gif_type, imagemagick_type, svg_type, gs_type):
844 Add initialization functions.
845 (Finit_image_library): Call lookup_image_type.
846 (CHECK_LIB_AVAILABLE): Macro deleted.
847 (lookup_image_type): Call define_image_type here, rather than via
848 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
849 (syms_of_image): Move define_image_type calls for xbm_type and
850 pbm_type to lookup_image_type.
851
852 2012-09-22 Eli Zaretskii <eliz@gnu.org>
853
854 * keyboard.c (timer_check_2): Move calculation of 'timers' and
855 'idle_timers' from here ...
856 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
857 lists, to avoid infloops when the timer does something stupid,
858 like reinvoke itself with the same or smaller time-out.
859 (Bug#12447)
860
861 2012-09-22 Martin Rudalics <rudalics@gmx.at>
862
863 * window.c (Fsplit_window_internal): Handle only Qt value of
864 Vwindow_combination_limit separately.
865 (Qtemp_buffer_resize): New symbol.
866 (Vwindow_combination_limit): New default value.
867 Rewrite doc-string.
868
869 2012-09-22 Eli Zaretskii <eliz@gnu.org>
870
871 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
872 the new overlay string. (Bug#10159)
873
874 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
875
876 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
877 or that fprintf is async-signal-safe. POSIX doesn't require
878 either assumption.
879
880 2012-09-22 Chong Yidong <cyd@gnu.org>
881
882 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
883 (Bug#8207).
884
885 2012-09-22 Kenichi Handa <handa@gnu.org>
886
887 * composite.c (composition_reseat_it): Handle the case that a
888 grapheme cluster is not covered by a single font (Bug#12352).
889
890 2012-09-21 Chong Yidong <cyd@gnu.org>
891
892 * image.c (define_image_type): Avoid adding duplicate types to
893 image_types (Bug#12463). Suggested by Jörg Walter.
894
895 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
896
897 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
898 (print_load_command_name): Add case LC_DATA_IN_CODE.
899 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
900
901 2012-09-21 Glenn Morris <rgm@gnu.org>
902
903 * eval.c (Frun_hook_with_args_until_success)
904 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
905
906 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
907
908 * fileio.c (Ffile_selinux_context): Only call freecon when
909 lgetfilecon succeeded.
910 (Fset_file_selinux_context): Likewise. (Bug#12444)
911
912 2012-09-21 Eli Zaretskii <eliz@gnu.org>
913
914 * xdisp.c (try_window_reusing_current_matrix): Under bidi
915 reordering, locate the cursor by calling set_cursor_from_row; if
916 that fails, clear the desired glyph matrix before returning a
917 failure indication to the caller. Fixes leaving garbled display
918 when fast scrolling with a down-key. (Bug#12403)
919 (compute_stop_pos_backwards): Fix a typo that caused crashes while
920 scrolling through multibyte text.
921
922 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
923
924 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
925 calling mark_vectorlike since that's the one that marks the window.
926 (mark_discard_killed_buffers): Mark the final cdr.
927 * window.h (struct window): Move prev/next_buffers to the
928 non-standard fields.
929 * window.c (make_window): Initialize prev/next_buffers manually.
930
931 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
932
933 Omit unused arg EXPECTED from socket hooks.
934 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
935 * nsterm.m (ns_term_init):
936 * termhooks.h (struct terminal.read_socket_hook):
937 * w32inevt.c (w32_console_read_socket):
938 * w32term.c (w32_read_socket):
939 * xterm.c (XTread_socket):
940 Omit unused arg EXPECTED. All callers changed.
941 (store_user_signal_events): Return void, not int, since callers no
942 longer care about the return value. All uses changed.
943
944 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
945
946 * w32gui.h (XParseGeometry): Do not declare.
947
948 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
949
950 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
951 Ignore 'expected'. See Eli Zaretskii in
952 <http://bugs.gnu.org/12471#8> (last line).
953
954 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
955 (XParseGeometry): Now static. Substitute extremal values for
956 values that are out of range.
957
958 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
959
960 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
961
962 * nsfns.m (XParseGeometry): Remove.
963 (Fx_create_frame): Call x_set_offset to correctly interpret
964 top_pos in geometry.
965
966 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
967 (Fx_parse_geometry): If there is a space in string, call
968 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
969
970 2012-09-17 Eli Zaretskii <eliz@gnu.org>
971
972 * search.c (scan_buffer): Use character positions in calls to
973 region_cache_forward and region_cache_backward, not byte
974 positions. (Bug#12196)
975
976 * w32term.c (w32_read_socket): Set pending_signals to 1, like
977 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
978
979 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
980 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
981 emacs_blocked_malloc, now deleted.
982
983 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
984
985 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
986 The workaround was for improving performance on Solaris 2.4, but
987 is getting in the way now. Emacs will still work if someone is
988 still running Solaris 2.4 in a museum somewhere; Sun dropped
989 support for Solaris 2.4 in 2003.
990 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
991 * process.c (create_process) [HAVE_WORKING_VFORK]:
992 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
993 since Emacs no longer uses vfork on that platform.
994
995 2012-09-17 Glenn Morris <rgm@gnu.org>
996
997 * emacs.c: Use COPYRIGHT.
998
999 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1000
1001 Remove configure's --without-sync-input option (Bug#12450).
1002 When auditing signal-handling in preparation for cleaning it up,
1003 I found that SYNC_INPUT has race conditions and would be a real
1004 pain to fix. Since it's an undocumented and deprecated
1005 configure-time option, now seems like a good time to remove it.
1006 Also see <http://bugs.gnu.org/11080#16>.
1007 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1008 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1009 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1010 (malloc_hysteresis):
1011 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1012 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1013 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1014 (dont_register_blocks, bytes_used_when_reconsidered)
1015 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1016 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1017 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1018 Remove. All uses removed.
1019 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1020 implementation, one that depends on whether the new macro
1021 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1022 is defined.
1023 * atimer.c (run_timers, handle_alarm_signal):
1024 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1025 (handle_async_input, process_pending_signals)
1026 (handle_input_available_signal, init_keyboard):
1027 * nsterm.m (ns_read_socket):
1028 * process.c (wait_reading_process_output):
1029 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1030 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1031 (emacs_write):
1032 * xterm.c (XTread_socket):
1033 Assume SYNC_INPUT.
1034 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1035 * eval.c (handling_signal): Remove. All uses removed.
1036 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1037 All uses replaced with the SYNC_INPUT version.
1038 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1039 Remove decls.
1040 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1041 Now static.
1042
1043 * font.c (Ffont_shape_gstring): Remove unused local.
1044
1045 2012-09-16 Glenn Morris <rgm@gnu.org>
1046
1047 * Makefile.in (clean): No longer run nextstep's clean.
1048
1049 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1050 (ns_frag): Remove.
1051 (ns-app): Move here from ns.mk, and simplify.
1052 (clean): Simplify nextstep entry.
1053 * ns.mk: Remove file.
1054
1055 2012-09-17 Kenichi Handa <handa@gnu.org>
1056
1057 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1058 not covert the last few charactes.
1059
1060 2012-09-16 Kenichi Handa <handa@gnu.org>
1061
1062 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1063 here, but just check the validity of glyphs in the glyph-string.
1064
1065 2012-09-16 Martin Rudalics <rudalics@gmx.at>
1066
1067 * window.c (Fwindow_parameter, Fset_window_parameter):
1068 Accept any window as argument (Bug#12452).
1069
1070 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1071
1072 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1073 to ns_term_init to avoid memory leak.
1074
1075 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1076 explicit retain/release.
1077 (ns_term_init): Only allow one display. Initialize outerpool and
1078 ns_*_types.
1079
1080 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1081
1082 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1083 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1084 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1085 the Microsoft problem in a different way, by altering ../nt/config.nt.
1086
1087 2012-09-15 Eli Zaretskii <eliz@gnu.org>
1088
1089 * w32xfns.c:
1090 * w32uniscribe.c:
1091 * w32term.c:
1092 * w32select.c:
1093 * w32reg.c:
1094 * w32proc.c:
1095 * w32menu.c:
1096 * w32inevt.c:
1097 * w32heap.c:
1098 * w32font.c:
1099 * w32fns.c:
1100 * w32console.c:
1101 * w32.c:
1102 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1103 by lisp.h. This completes removal of setjmp.h inclusion
1104 erroneously announced in the previous commit. (Bug#12446)
1105
1106 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1107 more accurate.
1108
1109 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1110 not defined as a macro. The latter happens on MS-Windows.
1111 (Bug#12446)
1112
1113 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1114
1115 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1116 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1117 Some instances of '#include <setjmp.h>' removed, if the
1118 only reason for the instance was because "lisp.h" was included.
1119 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1120 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1121 and _longjmp with the new symbols. Emacs already uses _setjmp if
1122 available, so this change affects only POSIXish hosts that have
1123 sigsetjmp but not _setjmp, such as some versions of Solaris and
1124 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1125 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1126 (png_load_body) [HAVE_PNG]:
1127 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1128 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1129 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1130 since PNG requires jmp_buf. This is the only exception to the
1131 general rule that we now use sys_setjmp and sys_longjmp.
1132 This exception is OK since this code does not change the signal
1133 mask or longjmp out of a signal handler.
1134
1135 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1136
1137 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1138 Include "syssignal.h", for 'main_thread'.
1139
1140 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1141
1142 Avoid out-of-range marker position (Bug#12426).
1143 * insdel.c (replace_range, replace_range_2):
1144 Adjust markers before overlays, as suggested by comments.
1145 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1146 Remove redundant check before calling offset_intervals.
1147
1148 2012-09-14 Martin Rudalics <rudalics@gmx.at>
1149
1150 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1151 current buffer (Bug#12387).
1152
1153 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
1154
1155 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1156
1157 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1158
1159 Use a more backwards-compatible timer format (Bug#12430).
1160 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1161 vector element, not from the 4th, since PSECS is now at the end.
1162 (Fcurrent_idle_time): Doc fix.
1163
1164 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1165
1166 Function to mark objects and remove killed buffers at once.
1167 * alloc.c (discard_killed_buffers): Rename to ...
1168 (mark_discard_killed buffers) ... new name. Add marking
1169 of remaining objects. Fix comment. Adjust users.
1170 (mark_object): Do not touch frame buffer lists here.
1171 * frame.c (delete_frame): Reset frame buffer lists here.
1172
1173 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1174
1175 Better workaround for GNOME bug when --enable-gcc-warnings.
1176 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1177 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1178 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1179
1180 Simplify SIGIO usage (Bug#12408).
1181 The code that dealt with SIGIO was crufty and confusing, e.g., it
1182 played tricks like "#undef SIGIO" but these tricks were not used
1183 consistently. Simplify mostly by not #undeffing standard symbols,
1184 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1185 or not as we please) rather than "defined SIGIO" (standard symbol
1186 that we probably shouldn't #undef).
1187 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1188 Modules that need it can include it.
1189 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1190 * dispextern.h (ignore_sigio): New decl.
1191 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1192 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1193 * emacs.c (shut_down_emacs):
1194 * keyboard.c (kbd_buffer_store_event_hold):
1195 Use ignore_sigio rather than invoking 'signal' directly.
1196 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1197 for FIONREAD.
1198 (FIONREAD, SIGIO): Do not #undef.
1199 (tty_read_avail_input): Use #error rather than a syntax error.
1200 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1201 for I_PIPE, used by SETUP_SLAVE_PTY.
1202 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1203 * sysdep.c (croak): Remove; no longer needed. This bit of
1204 temporary code, with Fred N. Fish's comment that it's temporary,
1205 has been in Emacs since at least 1992!
1206 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1207 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1208 * syssignal.h (croak): Remove decl.
1209 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1210 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1211 now that we're termios-only.
1212 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1213 * term.c (dissociate_if_controlling_tty): Use #error rather than
1214 a run-time error.
1215
1216 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1217 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1218 to work around GNOME bug 683906.
1219 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1220 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1221 This works around GCC bug 54561.
1222
1223 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1224
1225 More fixes for 'volatile' and setjmp/longjmp.
1226 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1227 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1228 (png_load_body) [HAVE_PNG]:
1229 (jpeg_load_body) [HAVE_JPEG]:
1230 New function, with most of the old parent function's body.
1231 (png_load) [HAVE_PNG]:
1232 (jpeg_load) [HAVE_JPEG]:
1233 Invoke the new function, to avoid longjmp munging our locals.
1234 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1235 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1236 longjmp is passed 2, as the C standard doesn't guarantee this.
1237 Instead, store the failure code into mgr->failure_code.
1238
1239 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1240
1241 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1242 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1243 (syms_of_keyboard): Remove support for unread-command-char.
1244
1245 2012-09-12 Eli Zaretskii <eliz@gnu.org>
1246
1247 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1248 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1249 violation. (Bug#12426)
1250
1251 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1252
1253 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1254
1255 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1256
1257 * eval.c: Add `inhibit-debugger'.
1258 (Qinhibit_debugger): New symbol.
1259 (call_debugger): Bind it instead of Qdebug_on_error.
1260 (maybe_call_debugger): Test Vinhibit_debugger.
1261 (syms_of_eval): Define inhibit-debugger.
1262 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1263 (syms_of_xdisp): Remove inhibit-debug-on-message.
1264
1265 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1266
1267 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1268 If a nonvolatile local variable is written before a _longjmp to
1269 the frame containing the variable, and is read after the _longjmp,
1270 the value read is indeterminate. Some local variables of type
1271 'struct handler' and 'struct catchtag' are used in this way, so
1272 mark each of their slots as volatile if the slot can be set before
1273 _longjmp and read afterwards.
1274 * lisp.h (struct handler): var and chosen_clause are now volatile.
1275 (struct catchtag): val, next, and pdlcount are now volatile.
1276
1277 * bidi.c (bidi_push_it, bidi_pop_it):
1278 * fns.c (copy_hash_table):
1279 * image.c (define_image_type):
1280 * keyboard.c (kbd_buffer_store_event_hold):
1281 * process.c (Fprocess_send_eof):
1282 * xfaces.c (x_create_gc) [HAVE_NS]:
1283 * xgselect.c (xg_select):
1284 Prefer assignment to memcpy when either will do.
1285
1286 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1287 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1288 time an item is removed. No need to mark this function 'inline';
1289 the compiler knows better than we do.
1290
1291 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1292
1293 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1294 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1295 to change_frame_size (Bug#12388).
1296 (windowDidResize:): Pass YES to updateFrameSize.
1297
1298 * nsterm.h: Add delay parameter to updateFrameSize.
1299
1300 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1301
1302 Discard killed buffers from deleted window and frame objects.
1303 This reduces an amount of references to killed buffers and
1304 helps GC to reclaim them faster.
1305 * alloc.c (discard_killed_buffers): New function.
1306 (mark_object): Use it for deleted windows and frames.
1307 (mark_object): If symbol's value is set up for a killed buffer
1308 or deleted frame, restore it's global binding.
1309 * data.c (swap_in_global_binding): Add GC notice.
1310 (swap_in_symval_forwarding): Use convenient set_blv_where.
1311 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1312 * window.h: ... to here.
1313
1314 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1315
1316 Convenient macro to check whether the buffer is live.
1317 * buffer.h (BUFFER_LIVE_P): New macro.
1318 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1319 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1320
1321 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1322
1323 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1324 composition cases (Bug#12364).
1325
1326 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1327 overhang of succeeding glyphs overlapping box cursor.
1328
1329 * w32term.c (x_draw_glyph_string): Likewise.
1330
1331 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1332
1333 Simplify, document, and port floating-point (Bug#12381).
1334 The porting part of this patch fixes bugs on non-IEEE platforms
1335 with frexp, ldexp, logb.
1336 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1337 Now static.
1338 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1339 support, by removing commented-out code and briefly listing the
1340 C89 functions excluded. The commented-out stuff was confusing
1341 maintenance, e.g., we thought we needed cbrt but it was commented out.
1342 (logb): Remove decl; no longer needed.
1343 (isfinite): New macro, if not already supplied.
1344 (isnan): Don't replace any existing macro.
1345 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1346 are present on all C89 platforms.
1347 (Ffrexp): Do not special-case zero, as frexp does the right thing
1348 for that case.
1349 (Flogb): Do not use logb, as it doesn't have the desired meaning
1350 on hosts that use non-base-2 floating point. Instead, stick with
1351 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1352 frexp, to avoid getting an unspecified result.
1353
1354 * xdisp.c (Qinhibit_debug_on_message): Now static.
1355
1356 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1357
1358 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1359 NSBezierPath (Bug#12131).
1360
1361 2012-09-10 Chong Yidong <cyd@gnu.org>
1362
1363 * fns.c (Fdelq, Fdelete): Doc fix.
1364
1365 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1366
1367 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1368 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1369
1370 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1371
1372 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1373 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1374 Use it.
1375
1376 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1377
1378 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1379 left fringe if the window has a left margin. This avoids leaving
1380 traces of the cursor because its leftmost pixel is not drawn over.
1381
1382 * dispnew.c (update_window_line): When the left margin area of a
1383 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1384 that screen line. (Bug#12277)
1385
1386 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1387
1388 Assume C89 or later for math functions (Bug#12381).
1389 This simplifies the code, and makes it a bit smaller and faster,
1390 and (most important) makes it easier to clean up signal handling
1391 since we can stop worring about floating-point exceptions in
1392 library code. That was a problem before C89, but the problem
1393 went away many years ago on all practical Emacs targets.
1394 * data.c, image.c, lread.c, print.c:
1395 Don't include <math.h>; no longer needed.
1396 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1397 might be autoconfigured, as that never happens.
1398 * data.c (fmod):
1399 * doprnt.c (DBL_MAX_10_EXP):
1400 * print.c (DBL_DIG):
1401 Remove. C89 or later always defines these.
1402 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1403 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1404 (arith_error, domain_error, domain_error2):
1405 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1406 no longer needed -- we simply return what C returns. All uses removed.
1407 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1408 the wrapped code.
1409 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1410 Remove. All uses expanded, as these macros are no longer used
1411 more than once and are now more trouble than they're worth.
1412 (Ftan): Use tan, not sin / cos.
1413 (Flogb): Assume C89 frexp.
1414 (fmod_float): Assume C89 fmod.
1415 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1416 (init_floatfns): Remove. All uses removed.
1417
1418 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1419
1420 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1421 compositeToPoint for OSX < 10.6 (Bug#12390).
1422
1423 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1424
1425 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1426 This produces more-accurate results.
1427
1428 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1429
1430 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1431 changes (Bug#12088).
1432
1433 2012-09-08 Chong Yidong <cyd@gnu.org>
1434
1435 * syntax.c (Fstring_to_syntax): Doc fix.
1436
1437 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1438
1439 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1440 in the internal border.
1441 (x_set_window_size): Remove static variables and their usage.
1442 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1443 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1444 Remove fringe/internal border adjustment (Bug#11052).
1445 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1446 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1447 (ns_fix_rect_ibw): Remove.
1448 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1449 (ns_dumpglyphs_box_or_relief): Ditto.
1450 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1451 adjustment.
1452 (ns_dumpglyphs_image): Ditto.
1453 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1454 border adjustment.
1455 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1456 their usage. Add fringe_extended_p and its use as in other terms.
1457 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1458 scroll bar was removed.
1459 (updateFrameSize): New function.
1460 (windowDidResize): Move code to updateFrameSize and call it.
1461
1462 * nsterm.h (EmacsView): Add updateFrameSize.
1463
1464 2012-09-07 Chong Yidong <cyd@gnu.org>
1465
1466 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1467
1468 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1469
1470 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1471
1472 More signal-handler cleanup (Bug#12327).
1473 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1474 Problem introduced when merging patches. Noted by Eli Zaretskii in
1475 <http://bugs.gnu.org/12327#67>.
1476 * floatfns.c: Comment fix.
1477 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1478 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1479 and anyway the declaration is harmless even if SIGDANGER is not defined.
1480 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1481 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1482 source files not surprisingly expected syssignal.h to define, or
1483 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1484 Include <sys/ioctl.h>, for FIONREAD.
1485 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1486 This eliminates a problem whereby other files mysteriously had
1487 to include "syssignal.h" before including "systty.h" if they
1488 wanted to use "#ifdef SIGIO".
1489
1490 2012-09-07 Eli Zaretskii <eliz@gnu.org>
1491
1492 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1493
1494 * w32.c (sigemptyset): Empty the set.
1495 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1496
1497 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1498
1499 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1500
1501 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1502 (mark_object): Likewise for frame objects.
1503
1504 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1505
1506 * syssignal.h (handle_on_main_thread): Always declare,
1507 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1508 This ports to platforms without HAVE_PTHREAD.
1509
1510 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1511
1512 Signal-handler cleanup (Bug#12327).
1513 Emacs's signal handlers were written in the old 4.2BSD style with
1514 sigblock and sigmask and so forth, and this led to some
1515 inefficiencies and confusion. Rewrite these to use
1516 pthread_sigmask etc. without copying signal sets around. Also,
1517 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1518 'signal', and instead use functions that do not attempt to take
1519 over the system name space. This patch causes Emacs's text
1520 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1521 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1522 Do not include <signal.h> or "syssignal.h", as these
1523 modules do not use signals.
1524 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1525 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1526 Do not include <signal.h>, as "syssignal.h" does that for us now.
1527 * atimer.c (sigmask_atimers): New function.
1528 (block_atimers, unblock_atimers): New functions,
1529 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1530 All uses replaced.
1531 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1532 no longer needed here.
1533 * emacs.c (main): Inspect existing signal handler with sigaction,
1534 so that there's no need to block and unblock SIGHUP.
1535 * sysdep.c (struct save_signal): New member 'action', replacing
1536 old member 'handler'.
1537 (save_signal_handlers, restore_signal_handlers):
1538 Use sigaction instead of 'signal' to save and restore.
1539 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1540 New function. All users of 'signal' modified to use set_sighandler
1541 if they're writeonly, and to use sys_signal if they're read+write.
1542 (emacs_sigaction_init, forwarded_signal): New functions.
1543 (sys_signal): Remove. All uses replaced by calls to sigaction
1544 and emacs_sigaction_init, or by direct calls to 'signal'.
1545 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1546 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1547 all uses replaced by pthread_sigmask etc. calls.
1548 * syssignal.h: Include <signal.h>.
1549 (emacs_sigaction_init, forwarded_signal): New decls.
1550 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1551 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1552 (sigmask, sys_sigmask): Remove; no longer needed.
1553 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1554 (sigblock, sigunblock, sigfree):
1555 (sigsetmask) [!defined sigsetmask]:
1556 Remove. All uses replaced by pthread_sigmask.
1557 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1558 no longer need to be replaced, and its typical old uses
1559 are now done via emacs_sigaction_init and sigaction.
1560 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1561 (sys_sigdel): Remove; unused.
1562 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1563
1564 2012-09-06 Eli Zaretskii <eliz@gnu.org>
1565
1566 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1567 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1568
1569 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1570
1571 Explicitly mark buffer_defaults and buffer_local_symbols.
1572 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1573 mark_local_symbols here.
1574 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1575 since special buffers aren't marked here any more.
1576 (allocate_buffer): Chain new buffer with all_buffers here...
1577 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1578 not here.
1579 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1580 (syms_of_buffer): Remove staticpro of the above.
1581 (init_buffer_once): Set names for buffer_defaults and
1582 buffer_local_symbols.
1583
1584 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1585
1586 Use bool for booleans in font-related modules.
1587 * font.c (font_intern_prop, font_style_to_value)
1588 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1589 (generate_otf_features, font_check_otf_features, font_check_otf)
1590 (font_match_p, font_list_entities, font_at):
1591 * fontset.c (fontset_id_valid_p, reorder_font_vector
1592 (fontset_find_font, Fset_fontset_font)
1593 (face_suitable_for_char_p) [0]:
1594 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1595 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1596 (m17n_flt_initialized, ftfont_shape_by_flt):
1597 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1598 * nsfont.m (nsfont_draw):
1599 * w32font.c (w32font_draw):
1600 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1601 Use bool for booleans.
1602 * font.h: Adjust to above API changes.
1603 (struct font, struct font_driver, struct font_driver_list):
1604 Use bool for booleans.
1605 (struct font): Remove useless member encoding_type.
1606 All users removed.
1607 * fontset.c, xftfont.c: Omit unnecessary static decls.
1608
1609 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1610
1611 * alloc.c (mark_object): Revert window marking code
1612 since it's unsafe for the Fset_window_configuration.
1613
1614 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1615
1616 Fix race conditions with signal handlers and errno (Bug#12327).
1617 Be more systematic about preserving errno whenever a signal
1618 handler returns, even if it's not in the main thread. Do this by
1619 renaming signal handlers to distinguish between signal delivery
1620 and signal handling. All uses changed.
1621 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1622 * data.c (deliver_arith_signal): Rename from arith_error.
1623 * dispnew.c (deliver_window_change_signal): Rename from
1624 window_change_signal.
1625 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1626 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1627 * keyboard.c (deliver_input_available_signal): Rename from
1628 input_available_signal.
1629 (deliver_user_signal): Rename from handle_user_signal.
1630 (deliver_interrupt_signal): Rename from interrupt_signal.
1631 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1632 (deliver_child_signal): Rename from sigchld_handler.
1633 * atimer.c (handle_alarm_signal):
1634 * data.c (handle_arith_signal):
1635 * dispnew.c (handle_window_change_signal):
1636 * emacs.c (handle_fatal_signal, handle_danger_signal):
1637 * keyboard.c (handle_input_available_signal):
1638 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1639 * process.c (handle_pipe_signal, handle_child_signal):
1640 New functions, with the actual signal-handling code taken from the
1641 original respective signal handlers, sans the sporadic attempts to
1642 preserve errno, since that's now done by handle_on_main_thread.
1643 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1644 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1645 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1646 Move to sysdep.c.
1647 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1648 Move initialization of main_thread to sysdep.c's init_signals.
1649 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1650 our usage, and simplifies the mainline code.
1651 (record_child_status_change): New static function, as a helper
1652 for handle_child_signal, and with most of the old child handler's
1653 contents.
1654 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1655 (handle_child_signal): Use the above.
1656 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1657 Moved here from emacs.c.
1658 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1659 code moved here from emacs.c's main function.
1660 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1661 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1662 This lets callers save and restore errno properly.
1663
1664 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1665
1666 Remove redundant or unused things here and there.
1667 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1668 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1669 * editfns.c (Fcompare_buffer_substrings): Likewise.
1670 * frame.h (struct terminal, struct font_driver_list):
1671 Remove redundant declarations.
1672 * window.h (Qleft, Qright): Likewise.
1673
1674 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1675
1676 Do not mark objects from deleted buffers, windows and frames.
1677 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1678 (mark_object): Likewise for windows and frames.
1679
1680 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1681
1682 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1683 buffer_defaults and buffer_local_symbols as valid objects.
1684 Return special value to denote them.
1685
1686 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1687
1688 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1689 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1690 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1691 (file_name_absolute_p, Fsubstitute_in_file_name):
1692 (check_executable, check_writable, Ffile_accessible_directory_p)
1693 (Fset_file_selinux_context, Fdefault_file_modes)
1694 (Finsert_file_contents, choose_write_coding_system)
1695 (Fwrite_region, build_annotations, a_write, e_write)
1696 (Fdo_auto_save):
1697 * filelock.c (boot_time_initialized, get_boot_time)
1698 (get_boot_time_1, lock_file_1, within_one_second):
1699 * floatfns.c (in_float):
1700 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1701 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1702 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1703 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1704 * window.c (compare_window_configurations):
1705 Use bool for booleans.
1706 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1707 (Fdefault_file_modes): Now mode_t, not int, for modes.
1708 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1709 (internal_delete_file): Now returns void, not a (boolean) int,
1710 since nobody was looking at the return value.
1711 * lisp.h, window.h: Adjust to above API changes.
1712
1713 * xdisp.c (set_message): Simplify and reindent last change.
1714
1715 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
1716
1717 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1718
1719 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1720
1721 * eval.c (call_debugger): Make the function non-static so that we
1722 can call it from set_message.
1723
1724 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1725 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1726
1727 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1728
1729 Give more-useful info on a fatal error (Bug#12328).
1730 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1731 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1732 of doing the work ourselves.
1733 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1734 do most of the work.
1735 (fatal_error_backtrace): New function, taken from the guts
1736 of the old fatal_error_signal, but with a new option to output
1737 a backtrace.
1738 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1739 info about the signal than just its number.
1740 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1741 * sysdep.c: Include <execinfo.h>
1742 (emacs_backtrace): New function, taken partly from the previous
1743 code of the 'die' function.
1744 (emacs_abort): Call fatal_error_backtrace rather than abort.
1745
1746 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1747
1748 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1749 eager (load-time) macro-expansion.
1750 * lisp.mk (lisp): Add macroexp.
1751
1752 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1753
1754 Simplify redefinition of 'abort' (Bug#12316).
1755 Do not try to redefine the 'abort' function. Instead, redo
1756 the code so that it calls 'emacs_abort' rather than 'abort'.
1757 This removes the need for the NO_ABORT configure-time macro
1758 and makes it easier to change the abort code to do a backtrace.
1759 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1760 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1761 Remove; sysdep.c's emacs_abort now takes its place.
1762 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1763 'abort' changed to use 'emacs_abort'.
1764 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1765 (abort) [!defined abort]: Rename to ...
1766 (emacs_abort): ... new name.
1767 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1768 the place of the old 'abort' in emacs.c.
1769 * w32.c, w32fns.c (abort): Do not #undef.
1770 * w32.c (emacs_abort): Rename from w32_abort.
1771
1772 2012-09-04 Eli Zaretskii <eliz@gnu.org>
1773
1774 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1775 offsets[j].dv, since the y axis of the screen coordinates points
1776 down, while the y axis of the font definition coordinates points
1777 up. This fixes display of Arabic diacritics such as KASRA and
1778 KASRATAN. (Bug#11860)
1779
1780 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1781
1782 Be more systematic about _setjmp vs setjmp.
1783 * alloc.c (test_setjmp, mark_stack):
1784 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1785 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1786 (png_load, my_error_exit, jpeg_load):
1787 * process.c (send_process_trap, send_process):
1788 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1789 The underscored versions are up to 30x faster on some hosts.
1790 Formerly, the code used setjmp+longjmp sometimes and
1791 _setjmp+_longjmp at other times, with no particular reason to
1792 prefer setjmp+longjmp.
1793
1794 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1795
1796 Fix minor problem found by static checking.
1797 * buffer.c (Fdelete_all_overlays): Return nil.
1798
1799 2012-09-03 Martin Rudalics <rudalics@gmx.at>
1800
1801 * buffer.c (Fdelete_all_overlays): New function.
1802
1803 2012-09-03 Chong Yidong <cyd@gnu.org>
1804
1805 * gtkutil.c: Add extern decl for Qxft.
1806
1807 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1808
1809 * emacs.c, eval.c: Use bool for boolean.
1810 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1811 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1812 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1813 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1814 (main, decode_env_path, Fdaemon_initialized):
1815 * eval.c (call_debugger, Finteractive_p, interactive_p):
1816 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1817 (maybe_call_debugger, Fbacktrace):
1818 * process.c (read_process_output, exec_sentinel):
1819 Use bool for booleans.
1820 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1821 All callers changed.
1822 * eval.c (interactive_p): Omit always-true boolean argument
1823 EXCLUDE_SUBRS_P. All callers changed.
1824 * dispextern.h, lisp.h: Reflect above API changes.
1825 * firstfile.c (dummy): Use the address of 'main', whose signature
1826 won't change, instead of the address of 'initialize', whose
1827 signature just changed from int to bool.
1828 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1829 * msdos.c (fatal_error_in_progress): ... from here.
1830 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1831 of incrementing it.
1832 (redisplay_internal, unwind_redisplay): Simply clear
1833 REDISPLAYING_P when unwinding, instead of saving its previous,
1834 always-false value and then restoring it.
1835
1836 Clean up some extern decls.
1837 Mostly, this hoists extern decls out of .c files and into .h files.
1838 That way, we're more likely to catch errors if the interfaces change.
1839 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1840 declare xg_mark_data.
1841 * dispextern.h (x_frame_parm_handlers):
1842 * font.h (Qxft):
1843 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1844 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1845 (Qultra_bold, Qoblique, Qitalic):
1846 Move extern decl here from .c file.
1847 * alloc.c (xg_mark_data) [USE_GTK]:
1848 * doc.c (Qclosure):
1849 * eval.c (Qlexical_binding):
1850 * fns.c (time) [!HAVE_UNISTD_H]:
1851 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1852 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1853 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1854 * lread.c (Qinternal_interpreter_environment):
1855 * minibuf.c (Qbuffer):
1856 * process.c (QCfamily, QCfilter):
1857 * widget.c (free_frame_faces):
1858 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1859 * xfont.c (x_clear_errors):
1860 * xterm.c (x_frame_parm_handlers):
1861 Remove now-redundant extern decls.
1862 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1863 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1864 Now static.
1865 * xfaces.c: Remove unnecessary static decls.
1866 * xterm.c (updating_frame): Remove decl of nonexistent object.
1867
1868 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1869 when building globals.h, as the objects that are not built on
1870 this host are not needed to compile C files on this host.
1871
1872 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1873
1874 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1875
1876 * frame.h: Add missing prototype for x_wm_set_size_hint.
1877
1878 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1879
1880 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1881 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1882 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1883 (Fsubstitute_command_keys):
1884 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1885 (save_excursion_save, save_excursion_restore)
1886 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1887 (format_time_string, general_insert_function)
1888 (make_buffer_string, make_buffer_string_both)
1889 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1890 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1891 (copy_text, insert_1, insert_1_both, insert_from_string)
1892 (insert_from_string_before_markers, insert_from_string_1)
1893 (insert_from_buffer, insert_from_buffer_1, replace_range)
1894 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1895 (del_range_2, modify_region):
1896 * intervals.c (intervals_equal, balance_possible_root_interval)
1897 (adjust_intervals_for_insertion, merge_properties_sticky)
1898 (graft_intervals_into_buffer, lookup_char_property)
1899 (adjust_for_invis_intang, set_point_both)
1900 (get_property_and_range, compare_string_intervals)
1901 (set_intervals_multibyte_1, set_intervals_multibyte):
1902 * keyboard.c (decode_timer):
1903 Use bool for boolean.
1904 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1905 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1906
1907 2012-09-02 Chong Yidong <cyd@gnu.org>
1908
1909 * keymap.c (push_key_description): Print M-TAB as C-M-i
1910 (Bug#11758).
1911
1912 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1913
1914 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1915 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1916 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1917 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1918 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1919 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1920 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1921
1922 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1923
1924 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1925 more than one grapheme cluster passed to the shaper: compute the
1926 offset adjustment values separately for each cluster. (Bug#11860)
1927
1928 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1929 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1930 about implicit conversions from integer to pointer.
1931
1932 2012-09-01 Daniel Colascione <dancol@dancol.org>
1933
1934 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1935 system used too early.
1936
1937 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1938
1939 Better seed support for (random).
1940 * emacs.c (main): Call init_random.
1941 * fns.c (Frandom): Set the seed from a string argument, if given.
1942 Remove long-obsolete Gentzel cruft.
1943 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1944 (init_random): New function.
1945
1946 2012-09-01 Daniel Colascione <dancol@dancol.org>
1947
1948 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1949 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1950 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1951 x_wm_set_size_hint, x_query_colors, x_real_positions,
1952 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1953 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1954 all of which have been moved to common code.
1955
1956 * xfaces.c: Include TERM_HEADER instead of listing all possible
1957 window-system headers.
1958
1959 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1960 to match header.
1961
1962 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1963 directly accessing frame internals.
1964
1965 * w32font.h: Include font.h. Define syms_of_w32font and
1966 globals_of_w32font.
1967
1968 * process.c: Include TERM_HEADER instead of listing all possible
1969 window-system headers.
1970
1971 * nsterm.h: Remove declarations now in frame.h.
1972 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
1973
1974 * menu.c: Include TERM_HEADER instead of listing all possible
1975 window-system headers.
1976
1977 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1978 window system.
1979
1980 * keyboard.c: Include TERM_HEADER instead of listing all possible
1981 window-system headers.
1982
1983 * image.c: Include TERM_HEADER instead of listing all possible
1984 window-system headers. Declare Vlibrary_cache when compiling for
1985 Windows.
1986
1987 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1988 window system declarations.
1989
1990 * frame.h: Move common functions here: set_frame_menubar,
1991 x_set_window_size, x_sync, x_get_focus_frame,
1992 x_set_mouse_position, x_set_mouse_pixel_position,
1993 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1994 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1995 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1996 x_activate_menubar, x_real_positions, x_bitmap_icon,
1997 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1998 and x_query_colors.
1999
2000 * frame.c: Include TERM_HEADER instead of listing all possible
2001 window-system headers.
2002
2003 * font.c: Include TERM_HEADER instead of listing all possible
2004 window-system headers.
2005
2006 * emacs.c: Include TERM_HEADER.
2007
2008 * dispnew.c: Include TERM_HEADER instead of listing all possible
2009 window-system headers.
2010
2011 * ccl.h: Include character.h.
2012
2013 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2014 the current window system; include in list of objects to link into
2015 Emacs.
2016
2017 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2018
2019 Remove mark_ttys function and fix tty_display_info initialization.
2020 * lisp.h (mark_ttys): Remove prototype.
2021 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2022 to mark_ttys because all possible values of 'top_frame' slot are
2023 the frames which are reachable from Vframe_list.
2024 * term.c (mark_ttys): Remove.
2025 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2026
2027 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2028
2029 Change struct frame bitfields from unsigned char to unsigned.
2030 * frame.h (struct frame): Change type of 'display_preempted',
2031 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2032 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2033 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2034 bitfields from unsigned char to unsigned.
2035
2036 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2037
2038 Remove unused member of struct x_output and struct w32_output.
2039 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2040 * w32term.h (struct w32_output): Likewise.
2041
2042 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2043
2044 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2045 does not become zero (Bug#12234).
2046
2047 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2048
2049 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2050 for GCC 4.7.1 x86-64.
2051
2052 2012-08-30 Glenn Morris <rgm@gnu.org>
2053
2054 * lread.c (init_lread): For out-of-tree builds, only add the
2055 source directory's site-lisp dir to the load-path if it exists,
2056 consistent with in-tree builds. (Bug#12302)
2057
2058 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2059
2060 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2061 button_values to NULL. Call setStykeMask so dialogs get a close button.
2062 (windowShouldClose:): Set window_closed.
2063 (dealloc): New member, free button_values.
2064 (process_dialog:): Make member function. Remove window argument,
2065 replace window with self. Count buttons and allocate and store values
2066 in button_values.
2067 (addButton:value:row:): value is int with the name tag. Call setTag
2068 with tag. Remove return self, declare return value as void.
2069 (addString:row:): Remove return self, declare return value as void.
2070 (addSplit): Remove return self, declare return value as void.
2071 (clicked:): Remove return self, declare return value as void.
2072 Set dialog_return to button_values[seltag]. Code formatting change.
2073 (initFromContents:isQuestion:): Adjust call to process_dialog.
2074 Code formatting change.
2075 (timeout_handler:): Set timer_fired to YES.
2076 (runDialogAt:): Set timer_fired to NO.
2077 Handle click on close button as quit.
2078
2079 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2080 Add window_closed and button_values. Add void as return value for
2081 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2082 Add process_dialog as new member.
2083
2084 2012-08-28 Eli Zaretskii <eliz@gnu.org>
2085
2086 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2087 is not one of the heaps we manage. (Bug#12242)
2088
2089 2012-08-28 Glenn Morris <rgm@gnu.org>
2090
2091 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2092
2093 2012-08-28 Martin Rudalics <rudalics@gmx.at>
2094
2095 * window.c (Fset_window_configuration): Remove handling of
2096 auto-buffer-name window parameter. Install revision of reverted
2097 fix.
2098
2099 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2100
2101 Do not allow to set major mode for a dead buffer.
2102 * buffer.c (Fset_buffer_major_mode): Signal an error
2103 if the buffer is dead.
2104 (Fother_buffer, other_buffer_safely): Remove redundant
2105 nested declaration.
2106
2107 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2108
2109 Always use set_buffer_if_live to restore original buffer at unwind.
2110 * buffer.h (record_unwind_current_buffer): New function.
2111 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2112 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2113 * undo.c, window.c: Adjust users.
2114 * buffer.c (set_buffer_if_live): Fix comment.
2115
2116 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2117
2118 Fix usage of set_buffer_internal.
2119 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2120 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2121 * coding.c (decode_coding): Omit redundant test.
2122 * fileio.c (decide_coding_unwind): Likewise.
2123 * fns.c (secure_hash): Likewise.
2124 * insdel.c (modify_region): Likewise.
2125 * keyboard.c (command_loop_1): Likewise.
2126 * print.c (PRINTFINISH): Likewise.
2127 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2128
2129 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2130
2131 * dispnew.c: Use bool for boolean.
2132 (frame_garbaged, display_completed, delayed_size_change)
2133 (fonts_changed_p, add_window_display_history)
2134 (add_frame_display_history, verify_row_hash)
2135 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2136 (row_equal_p, realloc_glyph_pool)
2137 (allocate_matrices_for_frame_redisplay)
2138 (showing_window_margins_p)
2139 (adjust_frame_glyphs_for_frame_redisplay)
2140 (build_frame_matrix_from_leaf_window, make_current)
2141 (mirrored_line_dance, mirror_line_dance, update_frame)
2142 (update_window_tree, update_single_window)
2143 (check_current_matrix_flags, update_window, update_text_area)
2144 (update_window_line, set_window_update_flags, scrolling_window)
2145 (update_frame_1, scrolling, buffer_posn_from_coords)
2146 (do_pending_window_change, change_frame_size)
2147 (change_frame_size_1, sit_for):
2148 Use bool for boolean.
2149 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2150 and remove last int (actually boolean) argument, which was always 0.
2151 All callers changed.
2152 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2153 * dispextern.h (struct composition_it): Use bool for boolean.
2154 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2155 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2156 * dired.c (file_name_completion):
2157 Use bool for boolean. (This was missed in an earlier change.)
2158
2159 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2160
2161 * window.c (Fset_window_configuration): Revert first part of
2162 last change.
2163
2164 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2165
2166 * nsterm.h (NSPanel): New class variable dialog_return.
2167
2168 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2169 Initialize dialog_return.
2170 (windowShouldClose:): Use stop instead of stopModalWithCode.
2171 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2172 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2173 event.
2174 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2175 modal loop returns.
2176
2177 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2178
2179 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2180 * composite.c (find_composition, composition_gstring_p)
2181 (composition_reseat_it, find_automatic_composition):
2182 * data.c (let_shadows_buffer_binding_p)
2183 (let_shadows_global_binding_p, set_internal, make_blv)
2184 (Fmake_variable_buffer_local, Fmake_local_variable)
2185 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2186 (cons_to_signed, arith_driver):
2187 * dbusbind.c (xd_in_read_queued_messages):
2188 * dired.c (directory_files_internal, file_name_completion):
2189 Use bool for booleans.
2190 * dired.c (file_name_completion):
2191 * process.h (fd_callback):
2192 Omit int (actually boolean) argument. It wasn't being used.
2193 All uses changed.
2194 * composite.h, lisp.h: Reflect above API changes.
2195
2196 * cmds.c, coding.c: Use bool for booleans.
2197 * cmds.c (move_point, Fself_insert_command):
2198 * coding.h (struct composition status, struct coding_system):
2199 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2200 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2201 (emacs_mule_char, decode_coding_emacs_mule)
2202 (encode_coding_emacs_mule, detect_coding_iso_2022)
2203 (decode_coding_iso_2022, encode_invocation_designation)
2204 (encode_designation_at_bol, encode_coding_iso_2022)
2205 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2206 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2207 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2208 (encode_coding_raw_text, detect_coding_charset)
2209 (decode_coding_charset, encode_coding_charset, detect_eol)
2210 (detect_coding, get_translation_table, produce_chars)
2211 (consume_chars, reused_workbuf_in_use)
2212 (make_conversion_work_buffer, code_conversion_save)
2213 (decode_coding_object, encode_coding_object)
2214 (detect_coding_system, char_encodable_p)
2215 (Funencodable_char_position, code_convert_region)
2216 (code_convert_string, code_convert_string_norecord)
2217 (Fset_coding_system_priority):
2218 * fileio.c (Finsert_file_contents):
2219 Use bool for booleans.
2220 * coding.h, lisp.h: Reflect above API changes.
2221 * coding.c: Remove unnecessary static function decls.
2222 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2223 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2224 not a boolean 'int', since callers never look at the return value.
2225 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2226 * coding.h (decoding_buffer_size, encoding_buffer_size)
2227 (emacs_mule_string_char): Remove unused extern decls.
2228 (struct iso_2022_spec, struct coding_system):
2229 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2230 (struct emacs_mule_spec): Remove unused field 'full_support'.
2231 All initializations removed.
2232 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2233
2234 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2235
2236 Fix spare memory change (Bug#12286).
2237 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2238 (valid_lisp_object_p): Likewise.
2239
2240 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2241
2242 * window.c (Fset_window_configuration): Record any window's old
2243 buffer if it's replaced (see Bug#8789). If the new current
2244 buffer doesn't appear in the selected window, go to its old
2245 point (Bug#12208).
2246
2247 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2248
2249 Special MEM_TYPE_SPARE to denote reserved memory.
2250 * alloc.c (enum mem_type): New memory type.
2251 (refill_memory_reserve): Use new type for spare memory.
2252 This prevents live_cons_p and live_string_p from incorrect
2253 detection of uninitialized objects from spare memory as live.
2254
2255 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2256
2257 Spelling fixes.
2258 * Makefile.in (.PHONY): versioclean -> versionclean.
2259
2260 Remove unused external symbols.
2261 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2262 * window.c (Qwindow_valid_p, decode_valid_window):
2263 Now static, not extern.
2264 * data.c (Qinterval): Remove; unused.
2265 (syms_of_data): Do not define 'interval'.
2266 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2267 * window.h (decode_valid_window):
2268 Remove decls.
2269
2270 * character.c, charset.c, chartab.c: Use bool for booleans.
2271 * character.c (lisp_string_width, string_count_byte8)
2272 (string_escape_byte8):
2273 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2274 (load_charset_map_from_file, map_charset_chars)
2275 (Fdefine_charset_internal, define_charset_internal)
2276 (Fdeclare_equiv_charset, find_charsets_in_text)
2277 (Ffind_charset_region, char_charset, Fiso_charset):
2278 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2279 (sub_char_table_set, sub_char_table_set_range)
2280 (char_table_set_range, optimize_sub_char_table)
2281 (map_sub_char_table):
2282 Use bool for boolean.
2283 * character.c (str_to_unibyte): Omit last boolean argument; it was
2284 always 0. All callers changed.
2285 * character.h, charset.h: Adjust to match previous changes.
2286 * character.h (char_printable_p): Remove decl of nonexistent function.
2287 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2288 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2289 are all boolean, so make them single-bit bitfields.
2290
2291 * lisp.h (ASET): Remove attempt to detect side effects.
2292 It was meant to be temporary and it often doesn't work,
2293 because when IDX has side effects the behavior of IDX==IDX
2294 is undefined. See Stefan Monnier in
2295 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2296
2297 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2298
2299 * lisp.h (functionp): New function (extracted from Ffunctionp).
2300 (FUNCTIONP): Use it.
2301 * eval.c (Ffunctionp): Use it.
2302
2303 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2304
2305 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2306 as that's faster and simpler than static storage. Don't bother
2307 with the g_main_context_query overhead if g_main_context_pending
2308 says no events are pending.
2309 (gfds, gfds_size): Remove these static vars.
2310 (xgselect_initialize): Remove; no longer needed.
2311 All uses and decls removed.
2312
2313 * emacs.c (fatal_error_signal_hook): Remove.
2314 All uses removed. This leftover from old code was always 0.
2315
2316 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2317 * casefiddle.c (casify_object, casify_region):
2318 * casetab.c (set_case_table):
2319 * category.c, category.h (word_boundary_p):
2320 * category.h (CHAR_HAS_CATEGORY):
2321 Use bool for booleans, instead of int.
2322
2323 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2324
2325 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2326
2327 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2328
2329 On assertion failure, print backtrace if available.
2330 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2331 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2332 * Makefile.in (LIB_EXECINFO): New macro.
2333 (LIBES): Use it.
2334
2335 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2336 * bytecode.c (exec_byte_code):
2337 * callint.c (check_mark, Fcall_interactively):
2338 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2339 (getenv_internal, sync_process_alive, call_process_exited):
2340 * lisp.h (USE_SAFE_ALLOCA):
2341 Use bool for booleans, instead of int.
2342 * lisp.h, process.h: Adjust prototypes to match above changes.
2343 * callint.c (Fcall_interactively): Don't assume the mark's
2344 offset fits in 'int'.
2345
2346 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2347
2348 * buffer.c, buffer.h: Use bool for boolean.
2349 * buffer.c (reset_buffer_local_variables)
2350 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2351 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2352 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2353 (overlay_touches_p, overlay_strings, Foverlay_put)
2354 (report_overlay_modification, call_overlay_mod_hooks):
2355 (mmap_enlarge, mmap_set_vars):
2356 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2357 Use bool for booleans, instead of int.
2358 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2359 since the 1-or-0 return value is always ignored anyway.
2360 (mmap_initialized_p):
2361 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2362 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2363
2364 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2365
2366 * bidi.c: Use bool for boolean.
2367 This is a bit more readable, and makes the text segment of bidi.o
2368 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2369 Presumably it's faster too.
2370 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2371 Now bool.
2372 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2373 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2374 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2375 (bidi_explicit_dir_char, bidi_level_of_next_char)
2376 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2377 Use bool for booleans, instead of int.
2378 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2379 (bidi_unshelve_cache): Adjust decls to match code.
2380
2381 2012-08-23 Martin Rudalics <rudalics@gmx.at>
2382
2383 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2384 argument.
2385
2386 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2387
2388 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2389 * atimer.h: Include <stdbool.h>.
2390
2391 2012-08-22 Dan Nicolaescu <dann@gnu.org>
2392
2393 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2394 compile time tests instead of run time tests on systems that do
2395 not use them.
2396 (FRAME_MAC_P): Remove leftover from deleted code.
2397 * frame.c (syms_of_frame): Remove leftover from deleted code.
2398
2399 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2400
2401 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2402
2403 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2404
2405 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2406 Otherwise, the compiler complains about (A?B:C) where B is void
2407 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2408 (fontset_add): Return void, for FONTSET_ADD.
2409
2410 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2411
2412 * alloc.c: Use bool for booleans.
2413 (gc_in_progress, abort_on_gc)
2414 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2415 (dont_register_blocks) [GC_MALLOC_CHECK]:
2416 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2417 (check_string_bytes, make_specified_string, memory_full)
2418 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2419 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2420 (mark_stack, valid_pointer_p, make_pure_string)
2421 (Fgarbage_collect, survives_gc_p, gc_sweep):
2422 Use bool for booleans, instead of int.
2423 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2424 Remove unused local.
2425 * alloc.c (PURE_POINTER_P):
2426 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2427 * editfns.c (Fformat):
2428 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2429 (Fdo_auto_save):
2430 * fns.c (sweep_weak_table):
2431 * lisp.h (suppress_checking, push_message, survives_gc_p)
2432 (make_pure_string, gc_in_progress, abort_on_gc):
2433 * lread.c (readchar, read1):
2434 * print.c (Fprin1_to_string):
2435 * xdisp.c (push_message):
2436 Use bool for booleans affected directly or indirectly by
2437 alloc.c's changes.
2438
2439 Make recently-introduced setters macros.
2440 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2441 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2442 (set_fontset_default, set_fontset_fallback): Rename from their
2443 upper-case counterparts, and make them functions rather than macros.
2444 This is more consistent with the other recently-introduced setters.
2445 These don't need to be inline, since they're local.
2446
2447 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2448
2449 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2450 the loop (Bug#12247).
2451
2452 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2453
2454 * lisp.h (vcopy): Use memcpy rather than our own loop.
2455 This fixes a performance regression introduced by the recent
2456 addition of vcopy. This means 'vcopy' will need to be modified
2457 for a copying collector, but that's OK. Also, tighten the
2458 checking in the assertion.
2459
2460 2012-08-21 Eli Zaretskii <eliz@gnu.org>
2461
2462 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2463 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2464 non-base glyph for the width of the base character, according to
2465 what x_draw_composite_glyph_string_foreground expects.
2466 Generate WADJUST value according to composition_gstring_width's
2467 expectations, to produce correct width of the composed character.
2468 Reverse the sign of the DU offset produced by ScriptPlace.
2469
2470 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2471
2472 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2473
2474 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2475
2476 Avoid direct writes to contents member of struct Lisp_Vector.
2477 * lisp.h (vcopy): New function to copy data into vector.
2478 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2479 * fns.c (Ffillarray): Use ASET.
2480 * keyboard.c (timer_check_2): Use AREF and ASET.
2481 (append_tool_bar_item, Frecent_keys): Use vcopy.
2482 * lread.c (read_vector): Use ASET.
2483 * msdos.c (Frecent_doskeys): Use vcopy.
2484 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2485 (Finternal_merge_in_global_face): Use ASET and vcopy.
2486 * xfont.c (xfont_list_pattern): Likewise.
2487
2488 2012-08-21 Martin Rudalics <rudalics@gmx.at>
2489
2490 * window.c (Fwindow_point): For the selected window always return
2491 the position of its buffer's point.
2492 (Fset_window_point): For the selected window always go in its
2493 buffer to the specified position.
2494
2495 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2496
2497 Setter macros for fontsets.
2498 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2499 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2500 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2501 Adjust users.
2502
2503 2012-08-20 Glenn Morris <rgm@gnu.org>
2504
2505 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2506 Don't assume that `ln -f' works.
2507
2508 2012-08-20 Eli Zaretskii <eliz@gnu.org>
2509
2510 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2511 and later about non-assignments with no effect. See discussion at
2512 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2513 details.
2514
2515 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2516
2517 Inline setter functions for Lisp_Objects slots of struct specbinding.
2518 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2519 Adjust users.
2520
2521 2012-08-20 Martin Rudalics <rudalics@gmx.at>
2522
2523 * window.c (select_window): Always make selected window's buffer
2524 current.
2525
2526 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2527
2528 Use AREF and ASET for docstrings of category tables.
2529 * category.h (CATEGORY_DOCSTRING): Use AREF.
2530 (SET_CATEGORY_DOCSTRING): Use ASET.
2531 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2532
2533 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2534
2535 Inline setter functions for hash table members.
2536 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2537 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2538 (set_hash_key_and_value, set_hash_index, set_hash_next)
2539 (set_hash_hash): New functions.
2540 * charset.c, fns.c: Adjust users.
2541
2542 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2543
2544 Inline getter and setter functions for per-buffer values.
2545 * buffer.h (per_buffer_default, set_per_buffer_default)
2546 (per_buffer_value, set_per_buffer_value): New functions.
2547 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2548 * buffer.c, data.c: Adjust users.
2549
2550 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
2551
2552 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2553
2554 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2555
2556 Rely on <config.h> + <unistd.h> to declare 'environ',
2557 as gnulib does this if the system doesn't.
2558 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2559 Remove declaration. MS-Windows declares it on stdlib.h which is
2560 included by conf_post.h.
2561 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2562 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2563 * vm-limit.c: Include <unistd.h>, for 'environ'.
2564
2565 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2566 (start_of_data): Remove decl; mem-limits.h provides it.
2567
2568 * xdisp.c (handle_invisible_prop): Make it a bit faster
2569 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2570
2571 2012-08-19 Chong Yidong <cyd@gnu.org>
2572
2573 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2574 ends (Bug#3874).
2575
2576 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2577
2578 * .gdbinit: Use call instead of set when calling a function in the
2579 inferior.
2580
2581 * data.c (set_internal): Don't use set_blv_found.
2582 (Fkill_local_variable): Likewise.
2583
2584 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2585
2586 * nsfont.m (ns_ascii_average_width): Ensure the string
2587 ascii_printable is initialized with a null-terminated character
2588 array. Otherwise, it can contain undesired extra characters.
2589
2590 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2591
2592 port new setting code to Sun C 5.8 2005/10/13
2593 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2594 Return void, not Lisp_Object. Otherwise, the compiler
2595 complains about (A?B:C) where B is void and C is Lisp_Object
2596 when compiling CHAR_TABLE_SET, due to the recent change to
2597 the API of sub_char_table_set_contents.
2598
2599 2012-08-18 Chong Yidong <cyd@gnu.org>
2600
2601 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2602 for the string case (Bug#3874).
2603
2604 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2605
2606 * buffer.h (BSET): Remove (Bug#12215).
2607 Replace all uses with calls to new setter functions.
2608 (bset_bidi_paragraph_direction, bset_case_canon_table)
2609 (bset_case_eqv_table, bset_directory, bset_display_count)
2610 (bset_display_time, bset_downcase_table)
2611 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2612 (bset_last_selected_window, bset_local_var_alist)
2613 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2614 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2615 (bset_width_table):
2616 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2617 (bset_auto_fill_function, bset_auto_save_file_format)
2618 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2619 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2620 (bset_cache_long_line_scans, bset_case_fold_search)
2621 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2622 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2623 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2624 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2625 (bset_header_line_format, bset_indicate_buffer_boundaries)
2626 (bset_indicate_empty_lines, bset_invisibility_spec)
2627 (bset_left_fringe_width, bset_major_mode, bset_mark)
2628 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2629 (bset_name, bset_overwrite_mode, bset_pt_marker)
2630 (bset_right_fringe_width, bset_save_length)
2631 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2632 (bset_scroll_up_aggressively, bset_selective_display)
2633 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2634 (bset_word_wrap, bset_zv_marker):
2635 * category.c (bset_category_table):
2636 * syntax.c (bset_syntax_table):
2637 New setter functions.
2638
2639 * process.h (PSET): Remove (Bug#12215).
2640 Replace all uses with calls to new setter functions.
2641 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2642 (PROCESS_INLINE): New macro.
2643 (pset_childp): New setter function.
2644 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2645 * process.c (PROCESS_INLINE):
2646 Define to EXTERN_INLINE, so that the corresponding functions
2647 are compiled into code.
2648 (pset_buffer, pset_command, pset_decode_coding_system)
2649 (pset_decoding_buf, pset_encode_coding_system)
2650 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2651 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2652 (pset_type, pset_write_queue): New setter functions.
2653
2654 * window.h (WSET): Remove (Bug#12215).
2655 Replace all uses with calls to new setter functions.
2656 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2657 (WINDOW_INLINE): New macro.
2658 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2659 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2660 (wset_total_lines, wset_vertical_scroll_bar)
2661 (wset_window_end_pos, wset_window_end_valid)
2662 (wset_window_end_vpos): New setter functions.
2663 * window.c (WINDOW_INLINE):
2664 Define to EXTERN_INLINE, so that the corresponding functions
2665 are compiled into code.
2666 (wset_combination_limit, wset_dedicated, wset_display_table)
2667 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2668 (wset_new_normal, wset_new_total, wset_next_buffers)
2669 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2670 (wset_prev_buffers, wset_right_fringe_width)
2671 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2672 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2673 (wset_window_parameters):
2674 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2675 (wset_column_number_displayed, wset_region_showing):
2676 New setter functions.
2677
2678 * termhooks.h (TSET): Remove (Bug#12215).
2679 Replace all uses with calls to new setter functions.
2680 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2681 (TERMHOOKS_INLINE): New macro.
2682 (tset_charset_list, tset_selection_alist): New setter functions.
2683 * terminal.c (TERMHOOKS_INLINE):
2684 Define to EXTERN_INLINE, so that the corresponding functions
2685 are compiled into code.
2686 (tset_param_alist): New setter function.
2687
2688 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2689
2690 * keyboard.h (KSET): Remove (Bug#12215).
2691 Replace all uses with calls to new setter functions.
2692 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2693 (KEYBOARD_INLINE): New macro.
2694 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2695 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2696 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2697 New setter functions.
2698 * keyboard.c (KEYBOARD_INLINE):
2699 Define to EXTERN_INLINE, so that the corresponding functions
2700 are compiled into code.
2701 (kset_echo_string, kset_kbd_queue)
2702 (kset_keyboard_translate_table, kset_last_prefix_arg)
2703 (kset_last_repeatable_command, kset_local_function_key_map)
2704 (kset_overriding_terminal_local_map, kset_real_last_command)
2705 (kset_system_key_syms): New setter functions.
2706
2707 * frame.h (FSET): Remove (Bug#12215).
2708 Replace all uses with calls to new setter functions.
2709 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2710 (FRAME_INLINE): New macro.
2711 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2712 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2713 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2714 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2715 (fset_param_alist, fset_root_window, fset_scroll_bars)
2716 (fset_selected_window, fset_title, fset_tool_bar_items)
2717 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2718 * frame.c (FRAME_INLINE):
2719 Define to EXTERN_INLINE, so that the corresponding functions
2720 are compiled into code.
2721 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2722
2723 A few more naming-convention fixes for getters and setters.
2724 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2725 and rename from buffer_overlays_set_before.
2726 (set_buffer_overlays_after): Move here from buffer.h, and rename
2727 from buffer_overlays_set_after.
2728 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2729 All uses changed.
2730 (set_buffer_intervals): Rename from buffer_set_intervals.
2731 * intervals.c (set_interval_object): Move here from intervals.h,
2732 and rename from interval_set_object.
2733 (set_interval_left): Move here from intervals.h, and rename from
2734 interval_set_left.
2735 (set_interval_right): Move here from intervals.h, and rename from
2736 interval_set_right.
2737 (copy_interval_parent): Move here from intervals.h, and rename from
2738 interval_copy_parent.
2739 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2740 (set_interval_plist): Rename from interval_set_plist.
2741 Return void, not Lisp_Object, since no caller uses the result.
2742 * lisp.h (string_intervals): Rename from string_get_intervals.
2743 (set_string_intervals): Rename from string_set_intervals.
2744
2745 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2746 (set_char_table_contents): Rename from char_table_set_contents.
2747 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2748 All uses changed. See the end of
2749 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2750
2751 * lisp.h (CSET): Remove (Bug#12215).
2752 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2753 (set_char_table_purpose): New functions,
2754 replacing CSET. All uses changed. For example, replace
2755 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2756 "set_char_table_parent (char_table, parent);".
2757 The old version was confusing because it used the same name
2758 'parent' for two different things.
2759
2760 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2761
2762 Functions to get and set Lisp_Object fields of buffer-local variables.
2763 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2764 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2765 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2766 * data.c, eval.c, frame.c: Adjust users.
2767
2768 2012-08-17 Chong Yidong <cyd@gnu.org>
2769
2770 * xfaces.c (merge_face_vectors): If the target font specfies a
2771 font spec, make the font's attributes take precedence over
2772 directly-specified attributes.
2773 (merge_face_ref): Recognize :font.
2774
2775 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2776
2777 Do not use memcpy for copying intervals.
2778 * intervals.c (reproduce_interval): New function.
2779 (reproduce_tree, reproduce_tree_obj): Use it.
2780 (reproduce_tree_obj): Remove prototype.
2781
2782 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2783
2784 * lisp.h (duration_to_sec_usec): Remove unused decl.
2785
2786 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2787
2788 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2789 to an allocated instance of NSString, not to the class itself.
2790
2791 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
2792
2793 * makefile.w32-in (C_CTYPE_H): New macro.
2794 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2795 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2796 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2797
2798 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2799
2800 Use ASCII tests for character types.
2801 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2802 * xfns.c, xterm.c:
2803 Don't include <ctype.h>; was not needed.
2804 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2805 * sysdep.c, xfaces.c:
2806 Include <c-ctype.h> instead of <ctype.h>.
2807 * nsterm.m: Include <c-ctype.h>.
2808 * charset.c (read_hex):
2809 * doc.c (Fsnarf_documentation):
2810 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2811 (DRIVE_LETTER) [DOS_NT]:
2812 (Ffile_name_directory, Fexpand_file_name)
2813 (Fsubstitute_in_file_name):
2814 * font.c (font_parse_xlfd, font_parse_fcname):
2815 * frame.c (x_set_font_backend):
2816 * gtkutil.c (xg_get_font):
2817 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2818 * nsimage.m (hexchar):
2819 * nsterm.m (ns_xlfd_to_fontname):
2820 * sysdep.c (system_process_attributes):
2821 * xfaces.c (hash_string_case_insensitive):
2822 Use C-locale tests instead of locale-specific tests for character
2823 types, since we want the ASCII interpretation here, not the
2824 interpretation suitable for whatever happens to be the current locale.
2825
2826 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2827
2828 Consistently check windows for validity/liveness
2829 (Bug#11984, Bug#12025, Bug#12026).
2830 * lisp.h (CHECK_VALID_WINDOW): New macro.
2831 * window.c (decode_window): Rename to decode_live_window.
2832 (decode_valid_window, Fwindow_valid_p): New functions.
2833 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2834 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2835 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2836 (Fwindow_prev_sibling, Fwindow_combination_limit)
2837 (Fset_window_combination_limit, Fwindow_use_time)
2838 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2839 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2840 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2841 (Fwindow_hscroll, Fset_window_hscroll)
2842 (Fwindow_redisplay_end_trigger)
2843 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2844 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2845 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2846 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2847 (Fwindow_end, Fset_window_point, Fset_window_start)
2848 (Fpos_visible_in_window_p, Fwindow_line_height)
2849 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2850 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2851 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2852 (Fset_window_parameter, Fwindow_display_table)
2853 (Fset_window_display_table, Fdelete_other_windows_internal)
2854 (Fset_window_buffer, Fset_window_new_total)
2855 (Fset_window_new_normal, Fdelete_window_internal)
2856 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2857 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2858 (Fwindow_scroll_bars): Check whether argument window is a valid or
2859 live window. Update doc-strings.
2860 (syms_of_window): New symbol Qwindow_valid_p.
2861 * keyboard.c (Fposn_at_x_y): Check whether argument
2862 frame_or_window denotes a valid window.
2863
2864 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2865
2866 Fix previous char table change.
2867 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2868 * chartab.c (optimize_sub_char_table): Likewise.
2869
2870 2012-08-16 Chong Yidong <cyd@gnu.org>
2871
2872 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2873
2874 * xfont.c (xfont_open):
2875 * xftfont.c (xftfont_open): Set the font's max_width field.
2876
2877 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2878 min_width to space_width and average_width to the average over
2879 printable ASCII characters.
2880 (ns_char_width): Code cleanup.
2881 (ns_ascii_average_width): New utility function.
2882
2883 * font.h (struct font): Update comments.
2884
2885 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2886
2887 Simple interface to set Lisp_Object fields of character tables.
2888 * lisp.h (CSET): New macro.
2889 (char_table_set_extras, char_table_set_contents)
2890 (sub_char_table_set_contents): New function.
2891 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2892 * syntax.c: Adjust users.
2893
2894 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2895
2896 * eval.c (eval_sub): Bind lexical-binding.
2897 * lread.c (Qlexical_binding): Make non-static.
2898
2899 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2900
2901 * nsmenu.m (popupSession): Remove.
2902 (pop_down_menu): Remove endModalSession.
2903 (timeout_handler:): New method.
2904 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2905 Call runModalForWindow. Check timer_fired when it returns.
2906 If not set, cancel timer and break out of loop.
2907 Otherwise loop again, with a new timeout.
2908
2909 * nsterm.m: Include fcntl.h if present.
2910 (fd_entry, t_readfds, inNsSelect): Remove.
2911 (select_writefds, select_valid, select_timeout, selfds)
2912 (select_mutex, apploopnr): Add.
2913 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2914 Otherwise call kbd_buffer_store_event.
2915 (ns_send_appdefined): Remove release of fd_entry.
2916 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2917 Increment and decrement apploopnr.
2918 (ns_select): If no file descriptors, just do a NSTimer.
2919 Otherwise copy read/write masks and start select thread (fd_handler).
2920 Start main loop and wait for application defined event.
2921 Inform select thread to stop selecting after main loop is exited.
2922 (ns_term_init): Create selfds pipe and set non-blocking.
2923 Initialize select_mutex. Start the select thread (fd_handler).
2924 (fd_handler:): Loop forever, wait for info from the main thread
2925 to either start or stop selecting. When select returns, send
2926 and appdefined event.
2927 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2928 If not call kbd_buffer_store_event.
2929
2930 * nsterm.h (EmacsApp): fd_handler takes id argument.
2931 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2932
2933 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2934
2935 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2936
2937 * region-cache.c (move_cache_gap): Update gap_len using the actual
2938 growth of the boundaries array. Do not change cache_len.
2939 (Bug#12196)
2940
2941 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2942
2943 Generalize and cleanup font subsystem checks.
2944 * font.h (FONT_DEBUG, font_assert): Remove.
2945 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2946 Change font_assert to eassert. Use eassert where appropriate.
2947
2948 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2949
2950 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2951
2952 2012-08-15 Chong Yidong <cyd@gnu.org>
2953
2954 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2955 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2956 extract the font descriptor instead of just the font name.
2957 In that case, return a font spec instead of a string.
2958 (x_last_font_name): Move to this file from xfns.c.
2959
2960 * xfns.c (Fx_select_font): The return value can also be a font
2961 spec. Move x_last_font_name management to gtkutil.c.
2962
2963 * xfaces.c: Make font weight and style symbols non-static.
2964
2965 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2966
2967 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2968 (bug#12117).
2969
2970 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2971
2972 * alloc.c (Fgarbage_collect): Use plural form consistently.
2973
2974 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2975
2976 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2977 iteration through the command loop. Fixes a problem whereby mouse
2978 movements are ignored until the first mouse click.
2979
2980 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2981
2982 Use bool, not int, for Lisp booleans.
2983 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2984 makes Emacs a bit smaller and presumably a bit faster.
2985 * lisp.h: Include <stdbool.h>.
2986 (struct Lisp_Boolfwd, defvar_bool):
2987 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2988 * regex.c [!emacs]: Include <stdbool.h>.
2989 (false, true): Remove; <stdbool.h> does this for us now.
2990
2991 2012-08-14 Chong Yidong <cyd@gnu.org>
2992
2993 * character.c (Fcharacterp): Doc fix (Bug#12076).
2994
2995 * data.c (Findirect_variable): Doc fix (Bug#11040).
2996
2997 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2998
2999 * editfns.c (Fformat): Doc fix (Bug#12059).
3000 (Fsave_current_buffer): Doc fix (Bug#11542).
3001
3002 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3003
3004 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3005 (bug#12022).
3006
3007 2012-08-14 Martin Rudalics <rudalics@gmx.at>
3008
3009 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3010 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3011 * minibuf.c (choose_minibuf_frame, read_minibuf):
3012 * w32fns.c (x_create_tip_frame):
3013 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3014 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3015
3016 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3017
3018 * intervals.c (offset_intervals): Remove obsolete comment.
3019
3020 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3021
3022 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3023
3024 2012-08-14 Gergely Risko <gergely@risko.hu>
3025
3026 * coding.c (decode_coding): Record buffer modification before
3027 disabling undo_list (Bug#11773).
3028
3029 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3030
3031 Revert and cleanup some recent overlay changes.
3032 * buffer.h (enum overlay_type): Remove.
3033 (buffer_get_overlays, buffer_set_overlays): Likewise.
3034 (buffer_set_overlays_before, buffer_set_overlays_after):
3035 New function. Adjust users.
3036 (unchain_both): Add eassert.
3037
3038 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3039
3040 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3041
3042 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3043
3044 * gtkutil.c (xg_mark_data): Don't assume C99.
3045
3046 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3047
3048 * gtkutil.c (xg_frame_tb_info): New struct.
3049 (TB_INFO_KEY): New define.
3050 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3051 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3052 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3053 if not present.
3054 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3055 is up to date. Otherwise store new data.
3056 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3057
3058 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3059
3060 Use KSET for write access to Lisp_Object members of struct kboard.
3061 * keyboard.h (KSET): New macro.
3062 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3063 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3064 * xterm.c: Adjust users.
3065
3066 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3067
3068 Use BSET for write access to Lisp_Object members of struct buffer.
3069 * buffer.h (BSET): New macro.
3070 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3071 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3072 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3073 * window.c, xdisp.c, xfns.c: Adjust users.
3074
3075 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3076
3077 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3078
3079 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3080
3081 * nsterm.m (not_in_argv): New function.
3082 (application:openFile, application:openTempFile:):
3083 (application:openFileWithoutUI:, application:openFiles:): Open file
3084 if not_in_argv returns non-zero (bug#12171).
3085
3086 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3087 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3088 Define for Gtk+ versions less than 3.2.
3089 (xg_get_font_name): Use those functions/macros here.
3090 Reported by Frans Oilinki <moilinki@gmail.com>.
3091
3092 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3093
3094 * unexmacosx.c (copy_data_segment): Copy initialized data in
3095 statically linked libraries from input file rather than memory.
3096
3097 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3098 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3099 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3100
3101 2012-08-10 Glenn Morris <rgm@gnu.org>
3102
3103 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3104 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3105
3106 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3107
3108 Fix last change to allow compilation with low optimization levels.
3109 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3110 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3111
3112 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3113
3114 Use common inline syntax in intervals.h.
3115 * intervals.h (INTERVALS_INLINE): New macro.
3116 Change all users from LISP_INLINE.
3117
3118 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3119
3120 Define Qnone once for all platforms.
3121 * frame.c (Qnone): Define here.
3122 (syms_of_frame): DEFSYM it.
3123 * lisp.h (Qnone): New declaration.
3124 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3125 * xfns.c: Remove duplication. Adjust users.
3126
3127 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3128
3129 Remove unused macros from intervals.h.
3130 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3131 * intervals.c: Adjust comment.
3132
3133 2012-08-10 Eli Zaretskii <eliz@gnu.org>
3134
3135 * w32fns.c <w32_unicode_gui>: New static variable.
3136 (globals_of_w32fns): Initialize it according to os_subtype.
3137 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3138 testing os_subtype.
3139
3140 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
3141 Eli Zaretskii <eliz@gnu.org>
3142
3143 Fix bug #10299 with Unicode characters sent by customized
3144 keyboards created by MSKLC.
3145 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3146 (w32_init_class): Use it to initialize the Emacs class with either
3147 ANSI or Unicode API calls.
3148 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3149 later.
3150 (w32_wnd_proc): If the character code sent by WM_CHAR or
3151 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3152 original message. Call DefWindowProcW on NT and later.
3153
3154 2012-08-10 Glenn Morris <rgm@gnu.org>
3155
3156 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3157
3158 * lisp.h (DIRECTORY_SEP): Let configure set it.
3159
3160 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3161
3162 Use TSET for write access to Lisp_Object slots of struct terminal.
3163 * termhooks.h (TSET): New macro.
3164 * coding.c, terminal.c, xselect.c: Adjust users.
3165
3166 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3167
3168 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3169 the failing expression, include them in the error message.
3170 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3171 * lisp.h (internal_condition_case_n): Update declaration.
3172
3173 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3174
3175 Inline functions to examine and change buffer overlays.
3176 * buffer.c (unchain_both): New function.
3177 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3178 (buffer_has_overlays): New function.
3179 (enum overlay_type): New enum.
3180 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3181 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3182
3183 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3184
3185 Inline functions to examine and change buffer intervals.
3186 * alloc.c (mark_interval_tree): Remove.
3187 (MARK_INTERVAL_TREE): Simplify.
3188 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3189 * intervals.c (buffer_balance_intervals): New function.
3190 (graft_intervals_into_buffer): Adjust indentation.
3191 (set_intervals_multibyte): Simplify.
3192 * buffer.h (BUF_INTERVALS): Remove.
3193 (buffer_get_intervals, buffer_set_intervals): New function.
3194 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3195 * intervals.c, textprop.c: Adjust users.
3196
3197 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3198
3199 Inline functions to examine and change string intervals.
3200 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3201 (string_get_intervals, string_set_intervals): New function.
3202 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3203 * lread.c, print.c, textprop.c: Adjust users.
3204
3205 2012-08-08 Glenn Morris <rgm@gnu.org>
3206
3207 * lisp.mk (lisp): Remove language/persian.elc.
3208
3209 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3210
3211 Cleanup intervals.
3212 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3213 (NULL_INTERVAL_P): Likewise. Adjust users.
3214 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3215 Adjust comment. Move under #if 0.
3216 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3217 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3218
3219 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3220
3221 Check total length of intervals with eassert.
3222 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3223 * intervals.c: Change all users to eassert.
3224
3225 2012-08-07 Eli Zaretskii <eliz@gnu.org>
3226
3227 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3228 Rename fields to match removal of FGET and WGET and disuse of
3229 INTERNAL_FIELD in Lisp_Cons.
3230
3231 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3232
3233 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3234 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3235 name since all xname users are fixed long time ago. Do not
3236 use INTERNAL_FIELD.
3237 (set_symbol_name, set_symbol_function, set_symbol_plist):
3238 (set_symbol_next, set_overlay_plist): New function.
3239 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3240 (struct Lisp_Overlay): Likewise.
3241 (CVAR, MVAR, SVAR): Remove.
3242 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3243 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3244 * xterm.c: Adjust users.
3245 * .gdbinit: Change to use name field of struct Lisp_Symbol
3246 where appropriate.
3247
3248 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3249
3250 Basic functions to set Lisp_Object and pointer slots of intervals.
3251 * intervals.h (interval_set_parent, interval_set_object):
3252 (interval_set_left, interval_set_right, interval_set_plist):
3253 (interval_copy_parent): New function.
3254 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
3255 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3256 Adjust indentation.
3257 (INTERVAL_SIZE): Remove. Adjust users.
3258 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3259
3260 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3261
3262 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3263 * process.h (PGET): Remove.
3264 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3265 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3266
3267 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3268
3269 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3270 * window.h (WGET): Remove.
3271 (struct window): Do not use INTERNAL_FIELD.
3272 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3273 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3274 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3275 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3276 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3277 Adjust users.
3278
3279 2012-08-07 Chong Yidong <cyd@gnu.org>
3280
3281 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3282 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3283 (Fdelete_window_internal): Signal an error if the window is not on
3284 a live frame (Bug#12025).
3285
3286 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3287
3288 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3289 * frame.h (FGET): Remove.
3290 (struct frame): Do not use INTERNAL_FIELD.
3291 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3292 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3293 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3294 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3295
3296 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
3297
3298 * w32.c: Silence compiler warnings.
3299 (map_w32_filename): Remove unused variable `is_fat'.
3300 (chase_symlinks): Add parentheses around expression.
3301
3302 2012-08-06 Glenn Morris <rgm@gnu.org>
3303
3304 * sysdep.c: Respect BROKEN_GETWD.
3305
3306 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3307 Let configure handle it.
3308 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3309
3310 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3311
3312 Use GCALIGNMENT where appropriate.
3313 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3314 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3315 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3316
3317 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3318
3319 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3320 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3321
3322 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3323
3324 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3325 that should be sufficient for everyone.
3326
3327 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3328
3329 * keyboard.c (timer_check_2): Add break so timer_check returns next
3330 timeout.
3331
3332 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3333
3334 Fix Windows build errors introduced after converting to WGET and WSET.
3335 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3336 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3337
3338 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3339
3340 * nsterm.m (ns_frame_rehighlight): Use FSET.
3341
3342 * nsmenu.m (ns_update_menubar): Use FSET.
3343
3344 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3345
3346 Separate read and write access to Lisp_Object slots of Lisp_Process.
3347 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3348 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3349
3350 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3351
3352 Separate read and write access to Lisp_Object slots of struct window.
3353 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3354 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3355 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3356 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3357 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3358 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3359 Adjust users.
3360
3361 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3362
3363 Fix Windows build errors introduced after converting to FGET and FSET.
3364 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3365 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3366 (w32_judge_scroll_bars): Change to use FSET.
3367 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3368
3369 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3370
3371 Fix replacement typo.
3372 * window.c (replace_window): Set root_window instead of
3373 selected_window. This fixes a total window subsystem
3374 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3375
3376 2012-08-06 Glenn Morris <rgm@gnu.org>
3377
3378 * lisp.mk (lisp): Add language/persian.elc.
3379
3380 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3381
3382 Separate read and write access to Lisp_Object slots of struct frame.
3383 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3384 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3385 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3386 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3387 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3388
3389 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3390
3391 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3392
3393 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3394
3395 Generalize common compile-time constants.
3396 * lisp.h (header_size, bool_header_size, word_size): Now here.
3397 (struct Lisp_Vector): Add comment.
3398 (struct Lisp_Bool_Vector): Move up to define handy constants.
3399 (VECSIZE, PSEUDOVECSIZE): Simplify.
3400 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3401 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3402 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3403 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3404 * xfont.c, xmenu.c: Use word_size where appropriate.
3405
3406 2012-08-05 Lawrence Mitchell <wence@gmx.li>
3407
3408 * search.c (Freplace_match): Treat \? in the replacement text
3409 literally (Bug#8161).
3410
3411 2012-08-05 Chong Yidong <cyd@gnu.org>
3412
3413 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3414 * frame.c (Vdelete_frame_functions):
3415 * emacs.c (Vkill_emacs_hook): Doc fix.
3416
3417 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3418
3419 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3420 --with-x-toolkit=no builds.
3421 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3422
3423 2012-08-04 Chong Yidong <cyd@gnu.org>
3424
3425 * syntax.c (Fmodify_syntax_entry): Doc fix.
3426
3427 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3428
3429 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3430 * w32.c (init_environment): Change the default values of many
3431 environment variables in dflt_envvars[] to NULL, to avoid pushing
3432 them into environment when they were not already defined.
3433 Remove the code that deletes site-lisp subdirectories from the default
3434 value of EMACSLOADPATH, as it is no longer needed.
3435 (check_windows_init_file): Now external, not static.
3436 Use Vload_path as is, without adding anything, as this function is now
3437 called when Vload_path is already set up.
3438
3439 * w32.h (check_windows_init_file): Add prototype.
3440
3441 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3442 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3443 compatibility with Posix platforms.
3444 (main): Move the call to check_windows_init_file to here from
3445 w32.c.
3446 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3447 any, in the DEFALT argument into the root of the Emacs build or
3448 installation tree, as appropriate.
3449
3450 * callproc.c (init_callproc_1): Call decode_env_path instead of
3451 doing its equivalent by hand.
3452 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3453 the code that sets Vexec_path run on MS-Windows.
3454
3455 * lread.c (init_lread): Add comments to #ifdef's.
3456
3457 * msdos.c (dos_set_window_size, IT_update_begin)
3458 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3459 instead of direct references.
3460
3461 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3462
3463 Export DEFAULT_REHASH_* to GDB.
3464 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3465 Now constants, not macros.
3466
3467 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3468
3469 Remove unnecessary casts involving pointers.
3470 These casts are no longer needed now that we assume C89 or later,
3471 since they involve casting to or from void *.
3472 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3473 (make_pure_float, make_pure_vector):
3474 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3475 * macros.c (Fstart_kbd_macro):
3476 * menu.c (find_and_return_menu_selection):
3477 * minibuf.c (read_minibuf_noninteractive):
3478 * sysdep.c (closedir):
3479 * xdisp.c (x_produce_glyphs):
3480 * xfaces.c (compare_fonts_by_sort_order):
3481 * xfns.c (x_real_positions, select_visual):
3482 * xselect.c (x_stop_queuing_selection_requests)
3483 (x_get_window_property, x_get_window_property_as_lisp_data):
3484 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3485 Remove unnecessary pointer casts.
3486 * alloc.c (record_xmalloc): New function.
3487 * lisp.h (record_xmalloc): New decl.
3488 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3489 more like a function. This is because the pointer cast is not
3490 needed. All uses changed.
3491 * print.c (print_string, print_error_message): Avoid length recalc.
3492
3493 Improve fix for macroexp crash with debugging (Bug#12118).
3494 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3495 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3496 not supposed to be invoked from the garbage collector.
3497 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3498 (gc_aset): New function, which is like ASET but can be
3499 used in the garbage collector.
3500 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3501 (set_hash_index): Use it instead of ASET.
3502
3503 2012-08-03 Eli Zaretskii <eliz@gnu.org>
3504
3505 Support symlinks on latest versions of MS-Windows.
3506 * w32.c: Include winioctl.h and aclapi.h.
3507 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3508 (revert_to_self): Forward declarations of static functions.
3509 <static BOOL g_b_init_get_security_info>:
3510 <g_b_init_create_symbolic_link>: New static flags.
3511 (globals_of_w32): Initialize them to zero.
3512 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3513 (map_w32_filename): Improve commentary. Simplify switch.
3514 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3515 headers (most versions of MinGW w32api don't).
3516 (get_security_info, create_symbolic_link)
3517 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3518 New functions.
3519 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3520 in the argument file name.
3521 (sys_access): Call unc_volume_file_attributes only if
3522 GetFileAttributes fails with network-related error codes.
3523 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3524 have the required privileges.
3525 (get_file_security_desc_by_name): Rename from
3526 get_file_security_desc.
3527 (stat_worker): New function, with most of the guts of 'stat', and
3528 with addition of handling of symlinks and support for 'lstat'.
3529 If possible, get file's attributes and security information by
3530 handle, not by name. Produce S_IFLNK bit for symlinks, when
3531 called from 'lstat'.
3532 (stat, lstat): New functions, call 'stat_worker'.
3533 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3534 symlinks when the underlying filesystem supports them.
3535
3536 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3537
3538 Fix macroexp crash on Windows with debugging (Bug#12118).
3539 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3540 checking subscripts; problem introduced with the recent
3541 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3542 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3543 since it's used in non-static inline functions now.
3544
3545 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3546 Don't assume buffer size fits in 'int'. Remove unused local.
3547
3548 Use C99-style 'extern inline' if available.
3549 * buffer.h (BUFFER_INLINE):
3550 * category.h (CATEGORY_INLINE):
3551 * character.h (CHARACTER_INLINE):
3552 * charset.h (CHARSET_INLINE):
3553 * composite.h (COMPOSITE_INLINE):
3554 * dispextern.h (DISPEXTERN_INLINE):
3555 * lisp.h (LISP_INLINE):
3556 * systime.h (SYSTIME_INLINE):
3557 New macro, replacing 'static inline' in this header.
3558 * buffer.h, category.h, character.h, charset.h, composite.h:
3559 * dispextern.h, lisp.h, systime.h:
3560 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3561 * alloc.c (LISP_INLINE):
3562 * buffer.c (BUFFER_INLINE):
3563 * category.c (CATEGORY_INLINE):
3564 * character.c (CHARACTER_INLINE):
3565 * charset.c (CHARSET_INLINE):
3566 * composite.c (COMPOSITE_INLINE):
3567 * dispnew.c (DISPEXTERN_INLINE):
3568 * sysdep.c (SYSTIME_INLINE):
3569 Define to EXTERN_INLINE, so that the corresponding functions
3570 are compiled into code.
3571 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3572 (INLINE_HEADER_END): New macros.
3573 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3574 since it's used in non-static inline functions now.
3575 (VALMASK) [!USE_LSB_TAG]: Likewise.
3576
3577 2012-08-02 Glenn Morris <rgm@gnu.org>
3578
3579 * s/: Remove empty directory.
3580
3581 * s/ms-w32.h: Move to ../nt/inc.
3582 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3583 Update for new ms-w32.h location.
3584
3585 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 Port to Solaris 8.
3588 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3589
3590 2012-08-02 Glenn Morris <rgm@gnu.org>
3591
3592 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3593 hard-coding the path separator.
3594
3595 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3596
3597 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3598 This how ASET and AREF are supposed to work, and makes
3599 it easier to think about future improvements. See
3600 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3601 * charset.h (set_charset_attr): New function.
3602 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3603 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3604 (aref_addr): New function. All uses of &AREF(...) changed.
3605 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3606 (set_hash_index): New functions. All lvalue-style uses of
3607 HASH_KEY etc. changed.
3608 * keyboard.c (set_prop): New function. All lvalue-style uses
3609 of PROP changed.
3610
3611 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3612
3613 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3614 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3615 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3616 * nsfns.m (ns_set_name_as_filename): Likewise.
3617 * nsmenu.m (ns_update_menubar): Likewise.
3618 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3619
3620 2012-08-01 Eli Zaretskii <eliz@gnu.org>
3621
3622 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3623 Adapt to latest changes in field names of the corresponding Lisp
3624 objects.
3625
3626 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3627
3628 2012-08-01 Glenn Morris <rgm@gnu.org>
3629
3630 * s/msdos.h: Remove file.
3631 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3632 * Makefile.in (S_FILE): Remove.
3633 (config_h): Remove S_FILE.
3634
3635 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3636
3637 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3638 Remove; moved to nt/config.nt.
3639
3640 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3641
3642 Use INTERNAL_FIELD for conses and overlays.
3643 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3644 Remove obsolete comment.
3645 (MVAR): New macro.
3646 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3647 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3648
3649 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3650
3651 Use INTERNAL_FIELD for symbols.
3652 * lisp.h (SVAR): New macro. Adjust users.
3653 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3654 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3655
3656 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3657
3658 Use INTERNAL_FIELD for processes.
3659 * process.h (PVAR): New macro. Adjust style.
3660 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3661 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3662
3663 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3664
3665 Use INTERNAL_FIELD for windows.
3666 * window.h (WVAR): New macro.
3667 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3668 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3669 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3670 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3671 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3672 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3673
3674 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3675
3676 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3677
3678 2012-08-01 Glenn Morris <rgm@gnu.org>
3679
3680 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3681 Move to configure.ac.
3682
3683 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3684
3685 * makefile.w32-in (CONFIG_H): Update dependencies.
3686 (CONF_POST_H): New macro.
3687
3688 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3689
3690 2012-07-31 Glenn Morris <rgm@gnu.org>
3691
3692 * Makefile.in (S_FILE): No longer set by configure.
3693
3694 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3695 is available.
3696 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3697
3698 * process.h (NULL_DEVICE):
3699 * emacs.c (SEPCHAR):
3700 * editfns.c (USER_FULL_NAME): Let configure set them.
3701
3702 * s/README, s/template.h: Remove files.
3703
3704 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3705
3706 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3707 Move to configure.ac.
3708
3709 2012-07-31 Eli Zaretskii <eliz@gnu.org>
3710
3711 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3712 resulting renaming of 'struct frame' members.
3713
3714 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3715
3716 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3717 after introduction of FVAR.
3718
3719 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3720
3721 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3722
3723 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3724 instead of compositeToPoint.
3725 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3726
3727 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3728
3729 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3730
3731 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3732 * lisp.h (INTERNAL_FIELD): New macro.
3733 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3734 (BVAR): Change to use INTERNAL_FIELD.
3735 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3736 (KVAR): Change to use INTERNAL_FIELD.
3737 * frame.h (FVAR): New macro.
3738 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3739 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3740 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3741 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3742 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3743
3744 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3745
3746 Miscellaneous fixes for non-default X toolkits.
3747 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3748 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3749 Move under #ifdef USE_LUCID.
3750 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3751 definition and usage to avoid warnings.
3752
3753 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3754
3755 * nsterm.m (openFiles): Fix previous checkin.
3756
3757 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3758
3759 * indent.c (compute_motion): Remove unused local.
3760
3761 2012-07-31 Glenn Morris <rgm@gnu.org>
3762
3763 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3764
3765 * conf_post.h [USG5_4]:
3766 Move remaining contents of s/usg5-4-common.h here.
3767 * s/usg5-4-common.h: Remove file.
3768
3769 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3770 * s/irix6-5.h: Remove file.
3771
3772 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3773 * s/darwin.h: Remove file.
3774
3775 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3776 * s/hpux10-20.h: Remove file, which is now empty.
3777
3778 2012-07-30 Glenn Morris <rgm@gnu.org>
3779
3780 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3781 * Makefile.in (config_h): Add conf_post.h.
3782 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3783
3784 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3785
3786 * nsterm.m (ns_do_open_file): New variable.
3787 (ns_term_init): Set ns_do_open_file to YES after run returns.
3788 (openFile, openTempFile, openFileWithoutUI, openFiles):
3789 Open files only if ns_do_open_file.
3790
3791 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3792
3793 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3794 This no-op macro hasn't been needed for many years.
3795 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3796
3797 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3798 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3799 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3800 gdb_make_enums_visible.
3801 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3802 (DIRECTORY_SEP): Now a constant, not a macro.
3803
3804 2012-07-30 Eli Zaretskii <eliz@gnu.org>
3805
3806 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3807 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3808
3809 * w32term.c <w32_keyboard_codepage>: Renamed from
3810 keyboard_codepage and now external. All users changed.
3811
3812 * w32term.h: Add declaration of w32_keyboard_codepage.
3813
3814 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3815 the codepage to translate keys to Unicode. If this argument is
3816 -1, use the value returned by GetConsoleCP. All callers changed.
3817
3818 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3819
3820 Update .PHONY listings in makefiles.
3821 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3822 bootstrap-clean, distclean, maintainer-clean, versioclean,
3823 extraclean, frc.
3824
3825 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3826 This is a bit clearer. Fix some commentary typos.
3827
3828 2012-07-30 Glenn Morris <rgm@gnu.org>
3829
3830 * s/netbsd.h: Let configure include signal.h if needed.
3831 Remove file, which is now empty.
3832
3833 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3834 Let configure set them.
3835 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3836 No more need to undefine.
3837
3838 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3839
3840 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3841 non-single-byte char when adding meta modifier. (Bug#12090)
3842
3843 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3844
3845 Convert safe_call to use variable number of arguments.
3846 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3847 (safe_call2): Fix comment.
3848 * lisp.h (safe_call): Adjust prototype.
3849 * coding.c (encode_coding_object): Change to use safe_call2.
3850 * xfaces.c (merge_face_heights): Change to use safe_call1.
3851
3852 2012-07-30 Glenn Morris <rgm@gnu.org>
3853
3854 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3855 does that unconditionally. Remove file, which is now empty.
3856
3857 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3858 Remove empty files.
3859
3860 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3861
3862 Export to GDB most of lisp.h's remaining object-like macros.
3863 * lisp.h (min, max): Move earlier, because they're used earlier now.
3864 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3865 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3866 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3867 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3868 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3869 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3870 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3871 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3872 Now constants, for GDB. They need not be macros.
3873 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3874 Now constants, for GDB, as well as macros, for static initializers.
3875 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3876 Move to after the definition of struct Lisp_Char_Table,
3877 since the former now needs that type defined.
3878 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3879 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3880 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3881 New enums, for gdb_make_enums_visible.
3882 (GLYPH_MODE_LINE_FACE): Remove; unused.
3883 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3884 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3885 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3886 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3887 enum maxargs, enum MAX_ALLOCA.
3888 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3889 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3890 no longer needed, now that they are done in lisp.h.
3891
3892 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3893
3894 Cleanup string bytes checking.
3895 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3896 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3897 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3898 (check_sblock, compact_small_strings): Simplify.
3899
3900 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3901
3902 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3903 These macros are confusing and no longer need to be defined, as
3904 the enum values now suffice. All uses replaced with definiens.
3905 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3906
3907 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3908
3909 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3910 ($(BLD)/w32console.$(O)): Update dependencies.
3911
3912 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3913
3914 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3915 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3916 time. Adjust users.
3917 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3918
3919 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3920
3921 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3922 setting sitelisp (Bug#12010).
3923
3924 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3925
3926 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3927
3928 * w32heap.c (cache_system_info):
3929 * w32.c (sys_rename):
3930 * w32proc.c (find_child_console, sys_kill): All users changed.
3931
3932 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3933
3934 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3935
3936 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3937
3938 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3939
3940 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3941
3942 Cleanup statistics calculation in Fgarbage_collect.
3943 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3944 Fix zombies percentage calculation. Simplify elapsed time calculation.
3945
3946 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3947
3948 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3949 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3950 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3951 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3952 (replace_range, replace_range_2, del_range_2): Change to eassert.
3953 * marker.c (byte_char_debug_check): Adjust style.
3954
3955 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3956
3957 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3958 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3959 long-ago-commented-out code that talks about "WIN32".
3960 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3961 All uses changed.
3962
3963 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3964
3965 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3966 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3967 Simplify by using alignof.
3968 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3969 * lisp.h: Include <stdalign.h>.
3970 (GCALIGNMENT): New macro and constant.
3971 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3972 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3973 (stdalign): New macro, if not already defined.
3974
3975 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3976
3977 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3978 * w32inevt.c: Include w32inevt.h.
3979 (w32_read_console_input): New inline function, calls either
3980 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3981 w32_console_unicode_input.
3982 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3983 (w32_kbd_patch_key, key_event): Use the codepage returned by
3984 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3985 (key_event): use uChar.UnicodeChar only if
3986 w32_console_unicode_input is non-zero.
3987
3988 * w32console.c: Include w32heap.h.
3989 <w32_console_unicode_input>: New global variable.
3990 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3991 family of Windows, zero otherwise.
3992
3993 * w32inevt.h: Declare w32_console_unicode_input.
3994
3995 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3996 --without-x. (Bug#11742)
3997
3998 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3999
4000 Adjust GDB to reflect pvec_type changes (Bug#12036).
4001 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4002 2012-07-04 changes to pseudovector representation.
4003 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4004
4005 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
4006
4007 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4008 bus address.
4009 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4010
4011 2012-07-27 Eli Zaretskii <eliz@gnu.org>
4012
4013 * alloc.c (listn): Fix the order the arguments are consed onto the
4014 list.
4015
4016 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4017 enumeration constants, as PURE and HEAP are too general, and clash
4018 with other headers and sources, such as gmalloc.c and the
4019 MS-Windows system headers. All users changed.
4020
4021 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4022
4023 Revert last save_excursion_save and save_excursion_restore changes.
4024 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4025 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4026
4027 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4028
4029 Fix recently-introduced typos in Windows port.
4030 Reported by Martin Rudalics <rudalics@gmx.at>.
4031 * w32.c (init_environment): Replace comma with semicolon.
4032 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4033
4034 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4035
4036 Improve GDB symbol export (Bug#12036).
4037 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4038 arms of an 'if', not using conditional expressions; otherwise GDB
4039 complains about the types in the unevaluated arm when the argument
4040 is an integer literal.
4041 (xgetint): Simplify expression.
4042 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4043 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4044 Zaretskii in <http://bugs.gnu.org/12036#13>.
4045 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4046 needed now that we have gdb_make_enums_visible.
4047 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4048 (enum enum_USE_LSB_TAG):
4049 New enum types, packaging up enums that need to be exported to GDB.
4050
4051 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4052
4053 Utility function to make a list from specified amount of objects.
4054 * lisp.h (enum constype): New datatype.
4055 (listn): New prototype.
4056 * alloc.c (listn): New function.
4057 (Fmemory_use_count, syms_of_alloc): Use it.
4058 * buffer.c (syms_of_buffer): Likewise.
4059 * callint.c (syms_of_callint): Likewise.
4060 * charset.c (define_charset_internal): Likewise.
4061 * coding.c (syms_of_coding): Likewise.
4062 * keymap.c (syms_of_keymap): Likewise.
4063 * search.c (syms_of_search): Likewise.
4064 * syntax.c (syms_of_syntax): Likewise.
4065 * w32.c (init_environment): Likewise.
4066 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4067 * xdisp.c (syms_of_xdisp): Likewise.
4068 * xfns.c (syms_of_xfns): Likewise.
4069
4070 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4071
4072 Fast save_excursion_save and save_excursion_restore.
4073 * lisp.h (struct Lisp_Excursion): New data type.
4074 (PVEC_EXCURSION): New pseudovector type.
4075 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4076 to deal with it. Adjust comments.
4077 (init_marker, attach_marker): New prototype.
4078 (unchain_marker): Adjust prototype.
4079 * marker.c (attach_marker): Change to global.
4080 (init_marker): New function.
4081 * alloc.c (Fmake_marker, build_marker): Use it.
4082 (build_marker): More easserts.
4083 (mark_object): Handle struct Lisp_Excursion.
4084 * editfns.c (save_excursion_save, save_excursion_restore):
4085 Reimplement to use struct Lisp_Excursion. Add comments.
4086
4087 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4088
4089 Fix export of symbols to GDB (Bug#12036).
4090 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4091 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4092 emacs.c, as this is a more-suitable home. Had this been done earlier
4093 the fix for 12036 would have avoided some of the problems noted in
4094 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4095 would have been more obvious.
4096 * emacs.c: Do not include <verify.h>; no longer needed.
4097 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4098 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4099 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4100 Remove; now done in lisp.h.
4101 * lisp.h (PUBLISH_TO_GDB): New macro.
4102 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4103 (DATA_SEG_BITS): Use it.
4104 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4105 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4106 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4107 not be usable in #if. This simplifies things.
4108
4109 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
4110
4111 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4112
4113 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4114
4115 Simplify export of symbols to GDB (Bug#12036).
4116 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4117 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4118 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4119 Adjust to changes in lisp.h and emacs.c, by using
4120 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4121 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4122 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4123 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4124 instead of gdb_valbits.
4125 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4126 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4127 instead of gdb_array_mark_flag.
4128 (xboolvector): Get size from $->size, not $->header.size.
4129 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4130 (xreload, hook-run, hookpost-run): Remove.
4131 * emacs.c: Include <verify.h>.
4132 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4133 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4134 Remove.
4135 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4136 (gdb_USE_LSB_TAG): New enum constants.
4137 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4138 Also define these as enum constants, so they're visible to GDB.
4139 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4140 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4141 as constants, so they're visible to GDB.
4142 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4143 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4144 Now enum constants, not macros, so they're visible to GDB.
4145 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4146 more convenient now. All uses changed.
4147 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4148 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4149
4150 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4151
4152 Explicitly free restriction data that are not needed anymore.
4153 * editfns.c (save_restriction_restore): Free restriction data.
4154
4155 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4156
4157 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4158 add argument, tune behavior, and adjust all callers.
4159
4160 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4161
4162 Use typedef for EMACS_INT, EMACS_UINT.
4163 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4164 than macros. This simplifies debugging in the usual case, since
4165 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4166 and it allows expressions involving EMACS_INT casts.
4167 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4168
4169 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4170
4171 * nsterm.m (ns_read_socket): Return early if there is a modal
4172 window (Bug#12043).
4173
4174 2012-07-25 Martin Rudalics <rudalics@gmx.at>
4175
4176 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4177 that FOCUS-FRAME can be omitted.
4178
4179 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4180
4181 Adjust buffer text indirection counters at the end of Fkill_buffer.
4182 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4183 buffer is definitely dead. This should really fix an issue reported
4184 by Christoph Scholtes again. (Bug#12007).
4185 (init_buffer_once): Initialize indirection counters of
4186 buffer_defaults and buffer_local_symbols (for sanity and safety).
4187
4188 2012-07-24 Eli Zaretskii <eliz@gnu.org>
4189
4190 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4191 and continuation glyphs on tooltip frames, leave them at zero.
4192 Avoids continued lines in tooltips. (Bug#11832)
4193
4194 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4195
4196 Simplify copy_overlay.
4197 * buffer.c (copy_overlay): Simplify. Use build_marker.
4198 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4199
4200 2012-07-23 Eli Zaretskii <eliz@gnu.org>
4201
4202 * print.c (print_object): Don't crash when a frame's name is nil
4203 or invalid. (Bug#12025)
4204
4205 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4206 it signals an error when a tooltip frame is being created.
4207
4208 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4209
4210 Cleanup miscellaneous objects allocation and initialization.
4211 * alloc.c (allocate_misc): Change to static. Add argument to
4212 specify the subtype. Adjust comment and users.
4213 (build_overlay): New function.
4214 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4215 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4216 (allocate_misc): Remove prototype.
4217 (build_overlay): Add prototype.
4218
4219 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4220
4221 Swap buffer text indirection counters in Fbuffer_swap_text.
4222 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4223 This avoids crash reported by Christoph Scholtes at
4224 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4225
4226 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4227
4228 * nsmenu.m (Popdown_data): New struct.
4229 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4230 free Popdown_data.
4231 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4232 (initWithContentRect): Make imgView and contentView non-static
4233 and autorelease them. Also autorelease img and matrix (Bug#12005).
4234 (dealloc): Remove (Bug#12005).
4235
4236 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4237
4238 Adjust consing_since_gc when objects are explicitly freed.
4239 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4240 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4241 (free_cons, free_misc): Subtract object size from consing_since_gc.
4242
4243 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4244
4245 Simplify and cleanup markers positioning code.
4246 * marker.c (attach_marker): More useful eassert.
4247 (live_buffer, set_marker_internal): New function.
4248 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4249 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4250
4251 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4252
4253 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4254 as it's limited by the amount of memory, not by INT_MAX.
4255
4256 2012-07-21 Eli Zaretskii <eliz@gnu.org>
4257
4258 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4259 in special-event-map. See the discussion at
4260 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4261 for the reasons.
4262
4263 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4264 info.dwItemData. Fixes crashes on 64-bit Windows.
4265 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4266
4267 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4268
4269 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4270 (conversationIdentifier): Return value is NSInteger.
4271 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4272
4273 2012-07-21 Chong Yidong <cyd@gnu.org>
4274
4275 * window.c (decode_any_window): Signal an error if the window is
4276 on a dead frame (Bug#11984).
4277
4278 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4279
4280 Add indirection counting to speed up Fkill_buffer.
4281 * buffer.h (struct buffer): New member.
4282 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4283 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4284 base buffer indirection counter.
4285 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4286 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4287 through buffer list if indirection counter is 0.
4288
4289 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4290
4291 Extend the value returned by Fgarbage_collect with heap statistics.
4292 * alloc.c (Qheap): New symbol.
4293 (syms_of_alloc): DEFSYM it.
4294 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4295 (Fmemory_free): Remove.
4296 (syms_of_alloc): Don't defsubr it.
4297 * buffer.c (Fcompact_buffer): Remove.
4298 (syms_of_buffer): Don't defsubr it.
4299
4300 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4301
4302 Make maybe_gc inline.
4303 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4304 * lisp.h (consing_since_gc, gc_relative_threshold)
4305 (memory_full_cons_threshold): Revert declaration.
4306 (maybe_gc): Remove prototype, define as inline.
4307 * alloc.c: Remove old commented-out code.
4308 (consing_since_gc, gc_relative_threshold)
4309 (memory_full_cons_threshold): Revert to global.
4310 (maybe_gc): Remove.
4311
4312 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4313
4314 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4315 * lisp.h (build_unibyte_string): New function.
4316 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4317 * sysdep.c, w32fns.c, xfns.c: Use it.
4318 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4319 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4320 Adjust users accordingly.
4321 * font.h (font_open_by_name): Adjust prototype.
4322
4323 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4324
4325 Cleanup calls to Fgarbage_collect.
4326 * lisp.h (maybe_gc): New prototype.
4327 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4328 Remove declarations.
4329 * alloc.c (maybe_gc): New function.
4330 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4331 Make them static.
4332 * bytecode.c (MAYBE_GC): Use maybe_gc.
4333 * eval.c (eval_sub, Ffuncall): Likewise.
4334 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4335 to avoid dependency from auto-save feature.
4336
4337 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4338
4339 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4340 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4341 'for_each_per_buffer_object_at'.
4342 All uses changed. It's better to use upper-case for macros that
4343 cannot be implemented as functions, to give the reader a clue
4344 that they're special.
4345
4346 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4347
4348 * alloc.c (Fgarbage_collect): Tweak docstring.
4349
4350 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4351
4352 Tweak the value returned from Fgarbage_collect again.
4353 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4354 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4355 Adjust documentation.
4356 (total_vector_bytes): Rename to total_vector_slots, adjust
4357 accounting.
4358 (total_free_vector_bytes): Rename to total_free_vector_slots,
4359 adjust accounting.
4360 (Qstring_bytes, Qvector_slots): New symbols.
4361 (syms_of_alloc): DEFSYM them.
4362
4363 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4364
4365 Buffer compaction primitive which may be used from Lisp.
4366 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4367 (syms_of_buffer): Register Fcompact_buffer.
4368 * alloc.c (Fgarbage_collect): Use compact_buffer.
4369 * buffer.h (compact_buffer): New prototype.
4370 (struct buffer_text): New member.
4371
4372 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4373
4374 New macro to iterate over all buffers, miscellaneous cleanups.
4375 * lisp.h (all_buffers): Remove declaration.
4376 * buffer.h (all_buffers): Add declaration, with comment.
4377 (for_each_buffer): New macro.
4378 * alloc.c (Fgarbage_collect, mark_object): Use it.
4379 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4380 (init_buffer): Likewise.
4381 * data.c (Fset_default): Likewise.
4382 * coding.c (code_conversion_restore): Remove redundant check
4383 for dead buffer.
4384 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4385
4386 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4387
4388 Fix bug that created negative-length intervals.
4389 * intervals.c (merge_interval_right, merge_interval_left):
4390 Do not zero out this interval if it is absorbed by its children,
4391 as this interval's total length doesn't change in that case. See
4392 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4393
4394 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4395
4396 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4397 when invoking (make-bool-vector N t) and N is a positive
4398 multiple of 8 -- the last 8 bits were mistakenly cleared.
4399
4400 Remove some struct layout assumptions in bool vectors.
4401 * alloc.c (bool_header_size): New constant.
4402 (header_size, word_size): Move earlier, as they're now used earlier.
4403 Use 'word_size' in a few more places, where it's appropriate.
4404 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4405 padding before the data member of a bool vector.
4406 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4407 than doing the check by hand with an abort ().
4408
4409 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4410
4411 * eval.c (Fdefvar): Don't check constants since we only set the var if
4412 it's not yet defined anyway (bug#11904).
4413
4414 * lisp.h (last_undo_boundary): Declare new var.
4415 * keyboard.c (command_loop_1): Set it.
4416 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4417 were auto-added by the command loop (bug#11774).
4418
4419 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4420
4421 * w32font.c (Qsymbol): Remove local definition.
4422 (syms_of_w32font): Don't DEFSYM it.
4423
4424 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4425
4426 Fix sweep_vectors to handle large bool vectors correctly.
4427 * alloc.c (sweep_vectors): Account total_vector_bytes for
4428 bool vectors larger than VBLOCK_BYTES_MAX.
4429
4430 2012-07-18 Chong Yidong <cyd@gnu.org>
4431
4432 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4433 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4434
4435 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4436
4437 Return more descriptive data from Fgarbage_collect.
4438 Suggested by Stefan Monnier in
4439 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4440 * alloc.c (bounded_number): New function.
4441 (total_buffers, total_vectors): New variable.
4442 (total_string_size): Rename to total_string_bytes, adjust users.
4443 (total_vector_size): Rename to total_vector_bytes, adjust users.
4444 (sweep_vectors): Account total_vectors and total_vector_bytes.
4445 (Fgarbage_collect): New return value. Adjust documentation.
4446 (gc_sweep): Account total_buffers.
4447 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4448 (VECTOR_SIZE): Remove.
4449 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4450 (Qinterval, Qmisc): New symbols.
4451 (syms_of_data): Initialize them.
4452 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4453 (Qcons, Qbuffer): New declarations.
4454
4455 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4456
4457 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4458 Round up, not down. Improve doc.
4459
4460 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4461
4462 Restore old code in allocate_string_data to avoid Faset breakage.
4463 Reported by Julien Danjou <julien@danjou.info> in
4464 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4465 * alloc.c (allocate_string_data): Restore old code with minor
4466 adjustments, fix comment to explain this subtle issue.
4467
4468 2012-07-17 Eli Zaretskii <eliz@gnu.org>
4469
4470 Remove FILE_SYSTEM_CASE.
4471 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4472
4473 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4474 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4475 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4476 call-process-region passes it through expand-file-name.
4477
4478 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4479
4480 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4481
4482 Fix crash when creating indirect buffer (Bug#11917)
4483 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4484 Don't handle unbound variables specially if non-zero.
4485 (Fbuffer_local_variables): Pass zero.
4486 (clone_per_buffer_values): Pass non-zero.
4487
4488 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4489
4490 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4491 to make the loop interruptible.
4492
4493 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4494
4495 * gnutls.c (emacs_gnutls_handshake): Only retry if
4496 GNUTLS_E_INTERRUPTED.
4497
4498 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4499
4500 Cleanup and convert miscellaneous checks to eassert.
4501 * alloc.c (mark_interval): Fix comment, partially rephrase
4502 old comment from intervals.h (see below).
4503 * intervals.c (find_interval, adjust_intervals_for_insertion)
4504 (delete_interval, adjust_intervals_for_deletion)
4505 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4506 Convert to eassert.
4507 (adjust_intervals_for_insertion, make_new_interval):
4508 Remove obsolete and unused code.
4509 * intervals.h (struct interval): Remove obsolete comment.
4510 * textprotp.c (erase_properties): Remove unused code.
4511 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4512 (Fremove_list_of_text_properties): Convert to eassert.
4513
4514 2012-07-17 Chong Yidong <cyd@gnu.org>
4515
4516 * editfns.c (Finsert_char): Doc fix.
4517
4518 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4519
4520 Fix previous change to make Fmemory_free always accurate.
4521 * alloc.c (make_interval): Update total_free_intervals.
4522 (make_float): Likewise for total_free_floats.
4523 (free_cons, Fcons): Likewise for total_free_conses.
4524 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4525 Likewise for total_free_vector_bytes.
4526 (Fmake_symbol): Likewise for total_free_symbols.
4527 (bytes_free): Remove.
4528
4529 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4530
4531 Simple free memory accounting feature.
4532 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4533 (sweep_vectors): Accumulate size of free vectors.
4534 (Fgarbage_collect): Setup bytes_free.
4535 (Fmemory_free): New function.
4536 (syms_of_alloc): Register it.
4537
4538 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4539
4540 Cleanup overlays checking.
4541 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4542 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4543 eassert and OVERLAYP.
4544 (sort_overlays): Change to use OVERLAYP.
4545
4546 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4547
4548 * editfns.c (Finsert_char): Make it interactive, and make the
4549 second arg optional. Copy interactive spec and docstring from
4550 ucs-insert.
4551
4552 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4553
4554 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4555 Unlike the other wrapped functions, fabs has an unspecified
4556 effect on errno.
4557
4558 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4559
4560 * nsterm.m (keyDown): Interpret flags without left/right bits
4561 as the left key (Bug#11670).
4562
4563 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4564
4565 Remove empty and useless init functions.
4566 * lisp.h (init_character_once, init_fns, init_image)
4567 (init_filelock, init_sound): Remove prototype.
4568 * character.c (init_character_once): Remove.
4569 * filelock.c (init_filelock): Likewise.
4570 * fns.c (init_fns): Likewise.
4571 * image.c (init_image): Likewise.
4572 * sound.c (init_sound): Likewise.
4573 * emacs.c (main): Adjust accordingly.
4574
4575 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4576
4577 * gtkutil.h: Tiny cleanups.
4578 (use_old_gtk_file_dialog): Remove useless declaration.
4579 (xg_uses_old_file_dialog): Add suggested const attribute.
4580
4581 2012-07-15 Eli Zaretskii <eliz@gnu.org>
4582
4583 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4584 (bidi_paragraph_init): Use it to limit search forward for a strong
4585 directional character in abnormally large paragraphs full of
4586 neutral or weak characters. (Bug#11943)
4587
4588 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4589
4590 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4591 the toolbar (Bug#9451).
4592 (xg_make_tool_item): Give the widget event box a transparent
4593 background.
4594
4595 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4596
4597 Cleanup basic allocation variables and functions.
4598 * alloc.c (ignore_warnings, init_intervals, init_float)
4599 (init_cons, init_symbol, init_marker): Remove.
4600 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4601 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4602 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4603 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4604 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4605 (staticidx, init_alloc_once, init_strings, free_ablock):
4606 Remove redundant initialization.
4607 * fns.c (init_weak_hash_tables): Remove.
4608 * lisp.h (init_weak_hash_tables): Remove prototype.
4609
4610 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4611
4612 Use zero_vector where appropriate.
4613 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4614 accordingly.
4615 * lisp.h (zero_vector): New declaration.
4616 * font.c (null_vector): Remove.
4617 (syms_of_font): Remove initialization and staticpro.
4618 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4619 * keymap.c (Faccessible_keymaps): Likewise.
4620
4621 2012-07-15 Leo Liu <sdl.web@gmail.com>
4622
4623 * fringe.c: Fix typo in comments.
4624
4625 2012-07-14 Leo Liu <sdl.web@gmail.com>
4626
4627 * fringe.c: Add a new bitmap exclamation-mark.
4628
4629 2012-07-14 Eli Zaretskii <eliz@gnu.org>
4630
4631 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4632
4633 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4634 (HAVE_MENUS): Don't define, defined by editing config.in with
4635 msdos/sed2v2.inp.
4636 (GMALLOC_INHIBIT_VALLOC): Don't define.
4637 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4638
4639 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
4640
4641 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4642
4643 2012-07-14 Glenn Morris <rgm@gnu.org>
4644
4645 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4646 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4647 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4648
4649 2012-07-13 Glenn Morris <rgm@gnu.org>
4650
4651 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4652
4653 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4654 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4655
4656 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4657
4658 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4659 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4660 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4661 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4662 where appropriate.
4663 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4664 as boolean expression.
4665 (x_set_window_size): Remove unused variable toolbar.
4666 (ns_get_color_default, ns_mod_to_lisp): Remove.
4667 (ns_mouse_position): Remove unused variables xchar and ychar.
4668 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4669 (ns_set_vertical_scroll_bar): Remove unused variable count.
4670 (ns_delete_terminal): Remove unused variable i.
4671 (ns_term_init): Remove unused variables r, g and b.
4672 (mouseDown): Remove unused variable window.
4673 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4674 (initFrameFromEmacs): Remove unused variable vbextra.
4675 (mouseEntered): Remove unused variables p and dpyinfo.
4676 (mouseExited): Remove unused variables p and r.
4677 (ns_define_frame_cursor, ns_clear_frame_area)
4678 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4679 (menuDown): Assign [sender tag] to variable and cast the variable.
4680
4681 * nsterm.h (menuDown): Add id as type to argument sender.
4682 (ns_display_info_for_name): Add Lisp_Object argument.
4683 (ns_term_init): Add Lisp_Object argument.
4684 (ns_map_event_to_object): Add void argument.
4685 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4686 prototype with arguments and only declare if __OBJC__.
4687 (nxatoms_of_nsselect): Add void argument.
4688 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4689 (ns_alloc_autorelease_pool): Add void argument.
4690 (ns_release_autorelease_pool): Add void* argument.
4691 (ns_get_defaults_value): Add const char* argument.
4692
4693 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4694 (initFromContents): Use SSDATA where appropriate.
4695 (ns_update_menubar): Add braces to ambigous if-else.
4696 (initWithTitle): Put () around assignment in if statement.
4697 (ns_menu_show): Remove unused variables window and keymap.
4698 (update_frame_tool_bar): Remove unused variable selected_p.
4699 (initWithContentRect): Remove unused variable this_cmd_name.
4700
4701 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4702 appropriate.
4703 (setXBMColor): Remove unused variable len.
4704 (setPixmapData): Put () around assignment in loop statement.
4705
4706 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4707 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4708 where appropriate.
4709 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4710 around assignment in loop statement.
4711 (nsfont_open): Remove unused variable i.
4712 (nsfont_open): Remove unused variable len.
4713 (nsfont_draw): Remove unused variable cs.
4714
4715 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4716 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4717 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4718 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4719 (Fns_font_name, Fns_perform_service)
4720 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4721 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4722 (ns_set_name): Remove unused variable view.
4723 (x_set_menu_bar_lines): Remove unused variable olines.
4724 (x_set_tool_bar_lines): Remove unused variable root_window.
4725 (Fns_list_colors): Put () around assignment in while statement.
4726 (Fns_perform_service): Remove unused variable len.
4727 (Fns_display_usable_bounds): Remove unused variable top.
4728 (syms_of_nsfns): Remove unused variable i.
4729
4730 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4731 memcpy (Bug#11907).
4732
4733 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4734
4735 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4736 and free it with DestroyExceptionInfo (Bug#11558).
4737
4738 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
4739
4740 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4741 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4742 Set here, not in nt/config.nt.
4743
4744 2012-07-13 Eli Zaretskii <eliz@gnu.org>
4745
4746 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4747 cursor overflow into the last glyph on display line when the right
4748 fringe is off. (Bug#11832)
4749
4750 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4751
4752 * xdisp.c (produce_special_glyphs): Now static.
4753 * dispextern.h (produce_special_glyphs): Remove decl.
4754
4755 2012-07-13 Glenn Morris <rgm@gnu.org>
4756
4757 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4758 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4759
4760 * s/usg5-4-common.h (USG, USG5):
4761 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4762 * s/sol2-6.h (SOLARIS2):
4763 * s/irix6-5.h (IRIX6_5):
4764 * s/hpux10-20.h (USG, USG5, HPUX):
4765 * s/gnu-linux.h (USG, GNU_LINUX):
4766 * s/freebsd.h (BSD_SYSTEM):
4767 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4768 * s/cygwin.h (CYGWIN):
4769 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4770 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4771
4772 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4773
4774 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4775
4776 2012-07-13 Glenn Morris <rgm@gnu.org>
4777
4778 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4779
4780 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4781
4782 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4783 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4784
4785 2012-07-12 Glenn Morris <rgm@gnu.org>
4786
4787 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4788
4789 * process.c (init_process_emacs): Rename from init_process.
4790 The old name is also the name of a Mach system call.
4791 * lisp.h, emacs.c: Update for this name change.
4792 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4793 longer needed.
4794
4795 2012-07-12 Eli Zaretskii <eliz@gnu.org>
4796
4797 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4798 memmove call that removes glyphs covered by the left truncation
4799 glyph. Improve commentary.
4800 (display_line): Fix display of continuation glyphs on GUI frames
4801 when the right fringe is turned off and variable-size fonts are
4802 used in the window. Move the code that appends a stretch glyph to
4803 produce_special_glyphs, so that it could be used for truncation
4804 and continuation glyphs alike.
4805 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4806 glyph of a suitably computed width, to align the special glyphs at
4807 the window margin. Code moved from display_line. (Bug#11832)
4808
4809 2012-07-12 Glenn Morris <rgm@gnu.org>
4810
4811 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4812
4813 * s/gnu-linux.h, s/hpux10-20.h:
4814 Do not unconditionally define HAVE_XRMSETDATABASE.
4815
4816 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4817
4818 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4819
4820 Fix typos that broke OS X build.
4821 Reported by Randal L. Schwartz in
4822 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4823 * nsterm.m (ns_timeout): Add missing local decl.
4824 (ns_get_color): snprintf -> sprintf, to fix typo.
4825
4826 2012-07-12 Glenn Morris <rgm@gnu.org>
4827
4828 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4829 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4830 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4831 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4832
4833 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4834 Move PTY_OPEN to configure.
4835
4836 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4837 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4838 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4839
4840 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4841
4842 Use empty_unibyte_string where applicable.
4843 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4844 * lread.c (read1): Likewise.
4845 * xsettings.c (syms_of_xsettings): Likewise.
4846
4847 2012-07-12 Glenn Morris <rgm@gnu.org>
4848
4849 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4850 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4851 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4852 * s/hpux10-20.h (RUN_TIME_REMAP):
4853 * s/bsd-common.h (TABDLY): Move to configure.
4854
4855 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4856
4857 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4858
4859 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4860 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4861
4862 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4863
4864 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4865 * s/template.h: Move NARROWPROTO to configure.
4866
4867 2012-07-11 Glenn Morris <rgm@gnu.org>
4868
4869 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4870 unused since 2011-01-17 change to systty.h.
4871
4872 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4873 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4874 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4875
4876 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4877
4878 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4879
4880 2012-07-11 Glenn Morris <rgm@gnu.org>
4881
4882 * s/darwin.h, s/gnu-linux.h, s/template.h:
4883 Move INTERRUPT_INPUT to configure.
4884
4885 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4886
4887 Minor adjustments to interning code.
4888 * lisp.h (intern, intern_c_string): Redefine as static inline
4889 wrappers for intern_1 and intern_c_string_1, respectively.
4890 (intern_1, intern_c_string_1): Rename prototypes.
4891 * lread.c (intern_1, intern_c_string_1, oblookup):
4892 Simplify Vobarray checking.
4893 * font.c (font_intern_prop): Likewise. Adjust comment.
4894 * w32font.c (intern_font_name): Likewise.
4895
4896 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4897
4898 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4899
4900 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4901 of Fcar/Fcdr if possible.
4902 * font.c (check_otf_features): Likewise.
4903 * fontset.c (Fnew_fontset): Likewise.
4904 * gnutls.c (Fgnutls_boot): Likewise.
4905 * minibuf.c (read_minibuf): Likewise.
4906 * msdos.c (IT_set_frame_parameters): Likewise.
4907 * xmenu.c (Fx_popup_dialog): Likewise.
4908 * w32menu.c (Fx_popup_dialog): Likewise.
4909
4910 2012-07-11 Glenn Morris <rgm@gnu.org>
4911
4912 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4913 since nothing has defined it on these platforms.
4914
4915 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4916 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4917
4918 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4919 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4920 Move CLASH_DETECTION to configure.
4921
4922 * s/gnu.h: Remove file, which is now empty.
4923
4924 * s/gnu.h, s/gnu-linux.h:
4925 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4926
4927 2012-07-11 John Wiegley <johnw@newartisans.com>
4928
4929 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4930 function attribute, so we only use it if it exists in the
4931 compiler.
4932
4933 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4934
4935 Avoid call to strlen in fast_c_string_match_ignore_case.
4936 * search.c (fast_c_string_match_ignore_case): Change to use
4937 length argument. Adjust users accordingly.
4938 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4939
4940 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4941
4942 Assume mkdir, rmdir.
4943 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4944 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4945
4946 Assume rename.
4947 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4948
4949 Assume perror.
4950 * s/hpux10-20.h (HAVE_PERROR): Remove.
4951 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4952 Remove dummy definition, as this problem was obsolete long ago.
4953
4954 Assume strerror.
4955 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4956
4957 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4958
4959 Avoid calls to strlen in font processing functions.
4960 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4961 (font_open_by_name): Change to use length argument.
4962 Adjust users accordingly.
4963 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4964 Adjust prototypes.
4965 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4966 Change to return ptrdiff_t.
4967 (xfont_list_pattern, xfont_match): Use length returned by
4968 xfont_decode_coding_xlfd.
4969 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4970
4971 2012-07-11 Glenn Morris <rgm@gnu.org>
4972
4973 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4974 Move DONT_REOPEN_PTY to configure.
4975
4976 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4977 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4978
4979 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4980
4981 Remove "#define unix" that is no longer needed (Bug#11905).
4982 * s/aix4-2.h (unix): Remove; no longer needed.
4983
4984 EMACS_TIME simplification (Bug#11875).
4985 This replaces macros (which typically do not work in GDB)
4986 with functions, typedefs and enums, making the code easier to debug.
4987 The functional style also makes code easier to read and maintain.
4988 * systime.h: Include <sys/time.h> on all hosts, not just if
4989 WINDOWSNT, since 'struct timeval' is needed in general.
4990 (EMACS_TIME): Now a typedef, not a macro.
4991 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4992 not macros.
4993 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4994 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4995 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4996 (EMACS_TIME_LE): Now functions, not macros.
4997 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4998 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4999 which are not functions. All uses rewritten to use:
5000 (make_emacs_time): New function.
5001 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5002 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5003 not functions. All uses rewritten to use the following, respectively:
5004 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5005 (add_emacs_time, sub_emacs_time): New functions.
5006 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5007 * fileio.c (Fcopy_file):
5008 * xterm.c (XTflash): Get the current time closer to when it's used.
5009 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5010
5011 * bytecode.c (targets): Suppress -Woverride-init warnings.
5012
5013 Simplify by avoiding confusing use of strncpy etc.
5014 * doc.c (Fsnarf_documentation):
5015 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5016 * frame.c (Fmake_terminal_frame):
5017 * gtkutil.c (get_utf8_string):
5018 * lread.c (openp):
5019 * nsmenu.m (ns_update_menubar):
5020 * regex.c (regerror):
5021 Prefer memcpy to strncpy and strncat when either will do.
5022 * fileio.c (Fsubstitute_in_file_name):
5023 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5024 (menu_separator_name_p):
5025 * nsmenu.m (ns_update_menubar):
5026 Prefer memcmp to strncmp when either will do.
5027 * nsterm.m: Include <ftoastr.h>.
5028 (ns_get_color):
5029 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5030 Prefer snprintf to strncpy.
5031 * nsterm.m (ns_term_init):
5032 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5033 * nsterm.m (ns_term_init):
5034 Avoid the need for strncpy, by using build_string or
5035 make_unibyte_string directly. Use dtoastr, not snprintf.
5036 * process.c (Fmake_network_process): Diagnose service names that
5037 are too long, rather than silently truncating them or creating
5038 non-null-terminated names.
5039 (Fnetwork_interface_info): Likewise, for interface names.
5040 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5041 Prefer sprintf to strncat.
5042 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5043 Prefer vsnprintf to vsprintf + strncpy.
5044
5045 2012-07-10 Glenn Morris <rgm@gnu.org>
5046
5047 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5048 Clarify fallback case.
5049
5050 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5051
5052 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5053 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5054 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5055 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5056 where argument type is known to be a Lisp_Cons.
5057
5058 2012-07-10 Tom Tromey <tromey@redhat.com>
5059
5060 * bytecode.c (BYTE_CODE_THREADED): New macro.
5061 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5062 (enum byte_code_op): New type.
5063 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5064 (exec_byte_code): Use them. Use token threading when applicable.
5065
5066 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5067
5068 Optimize pure C strings initialization.
5069 * lisp.h (make_pure_string): Fix prototype.
5070 (build_pure_c_string): New function, defined as static inline. This
5071 provides a better opportunity to optimize away calls to strlen when
5072 the function is called with compile-time constant argument.
5073 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5074 argument, adjust users accordingly. Use build_pure_c_string where
5075 appropriate.
5076 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5077 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5078 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5079
5080 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5081
5082 Avoid calls to strlen in miscellaneous functions.
5083 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5084 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5085 * lread.c (openp): Likewise.
5086
5087 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5088
5089 Avoid calls to strlen in path processing functions.
5090 * fileio.c (file_name_as_directory): Add comment. Change to add
5091 srclen argument and return the length of result. Adjust users
5092 accordingly.
5093 (directory_file_name): Fix comment. Change to add srclen argument,
5094 swap 1st and 2nd arguments to obey the common convention.
5095 Adjust users accordingly.
5096 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5097
5098 2012-07-10 Glenn Morris <rgm@gnu.org>
5099
5100 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5101 Move PENDING_OUTPUT_COUNT definition to configure.
5102
5103 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5104 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5105 * s/gnu.h (DATA_START): Move definitions to configure.
5106
5107 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5108 We include usg5-4-common.h, which defines them both.
5109
5110 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5111 O_RDONLY already includes it).
5112
5113 Stop ns builds setting the EMACSLOADPATH environment variable.
5114 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5115 Now it does not set EMACSLOADPATH, just returns the load-path string.
5116 * nsterm.h: Update accordingly.
5117 * lread.c [HAVE_NS]: Include nsterm.h.
5118 (init_lread) [HAVE_NS]: Use ns_load_path.
5119 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5120
5121 2012-07-09 Glenn Morris <rgm@gnu.org>
5122
5123 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5124 since the included bsd-common.h does so.
5125
5126 Stop ns builds setting the EMACSPATH environment variable.
5127 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5128 (ns_init_paths): Do not set EMACSPATH.
5129 * nsterm.h (ns_exec_path): Add it.
5130 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5131 Use ns_exec_path.
5132
5133 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5134
5135 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5136
5137 * process.c (wait_reading_process_output): 'waitchannels' was unset
5138 when read_kbd || !NILP (wait_for_cell); fix this.
5139
5140 Add GCC-style 'const' attribute to functions that can use it.
5141 * character.h (char_resolve_modifier_mask):
5142 * keyboard.h (make_ctrl_char):
5143 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5144 (init_character_once, next_almost_prime, init_fns, init_image)
5145 (flush_pending_output, init_sound):
5146 * mem-limits.h (start_of_data):
5147 * menu.h (finish_menu_items):
5148 Add ATTRIBUTE_CONST.
5149 * emacs.c (DEFINE_DUMMY_FUNCTION):
5150 Declare the dummy function with ATTRIBUTE_CONST.
5151 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5152 Add decls with ATTRIBUTE_CONST.
5153
5154 Minor improvements to make_formatted_string.
5155 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5156 where int is good enough, as vsprintf returns an int.
5157 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5158
5159 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5160
5161 Use make_formatted_string to avoid double length calculation.
5162 * lisp.h (make_formatted_string): New prototype.
5163 * alloc.c (make_formatted_string): New function.
5164 * buffer.c (Fgenerate_new_buffer_name): Use it.
5165 * dbus.c (syms_of_dbusbind): Likewise.
5166 * editfns.c (Fcurrent_time_zone): Likewise.
5167 * filelock.c (get_boot_time): Likewise.
5168 * frame.c (make_terminal_frame, set_term_frame_name)
5169 (x_report_frame_params): Likewise.
5170 * image.c (gs_load): Likewise.
5171 * minibuf.c (get_minibuffer): Likewise.
5172 * msdos.c (dos_set_window_size): Likewise.
5173 * process.c (make_process): Likewise.
5174 * xdisp.c (ensure_echo_area_buffers): Likewise.
5175 * xsettings.c (apply_xft_settings): Likewise.
5176
5177 2012-07-09 Glenn Morris <rgm@gnu.org>
5178
5179 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5180 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5181 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5182 * nsterm.h (ns_etc_directory): Add it.
5183 * callproc.c [HAVE_NS]: Include nsterm.h.
5184 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5185
5186 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5187
5188 Move marker debugging code under MARKER_DEBUG.
5189 * marker.c (MARKER_DEBUG): Move marker debugging code under
5190 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5191 for bootstrap with --enable-checking (~3x slowdown reported
5192 by Juanma Barranquero <lekktu@gmail.com>).
5193 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5194
5195 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5196
5197 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5198 See <http://bugs.gnu.org/11825#29>.
5199
5200 2012-07-08 Eli Zaretskii <eliz@gnu.org>
5201
5202 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5203 has no font, use the frame's font. (Bug#11813)
5204 (display_line): Add commentary about displaying truncation glyphs
5205 on GUI frames.
5206 (produce_special_glyphs): Move here from term.c.
5207
5208 * term.c (produce_special_glyphs): Move to xdisp.c.
5209
5210 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5211 section.
5212
5213 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5214
5215 * xdisp.c (display_line): Avoid warning about implicit declaration
5216 of FRAME_FONT.
5217
5218 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5219
5220 * lisp.h: Remove empty conditional.
5221
5222 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5223
5224 * lread.c (load_path_check): Now static.
5225
5226 Fix some minor --with-ns problems found by static checking.
5227 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5228 (x_set_font) [!HAVE_X_WINDOWS]:
5229 * image.c (xpm_load_image) [HAVE_NS]:
5230 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5231 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5232 Remove unused local.
5233 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5234 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5235 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5236 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5237 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5238 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5239 Fix pointer signedness problem.
5240 * xfaces.c (FRAME_X_FONT_TABLE):
5241 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5242
5243 2012-07-07 Glenn Morris <rgm@gnu.org>
5244
5245 * lread.c (load_path_check): New function, split from init_lread.
5246 (init_lread): Reorganize. Motivation:
5247 If EMACSLOADPATH is set, check/warn about that rather than the
5248 defaults, which we are not going to use. Hence we can remove
5249 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5250 Don't warn if site-lisp directories are missing.
5251 If not installed, start from a blank load-path, since
5252 PATH_LOADSEARCH refers to the eventual installation directories.
5253
5254 2012-07-07 Eli Zaretskii <eliz@gnu.org>
5255
5256 Support truncation and continuation glyphs on GUI frames, when
5257 fringes are disabled. (Bug#11832)
5258 * xdisp.c (init_iterator): Get dimensions of truncation and
5259 continuation glyphs even if on GUI frames.
5260 Adjust it->last_visible_x on GUI frames when the left or right fringes,
5261 or both, are absent.
5262 (start_display, move_it_in_display_line_to): Handle the case of a
5263 GUI frame without a fringe to display continuation or truncation
5264 glyphs.
5265 (insert_left_trunc_glyphs): Support GUI frames: make sure
5266 truncation glyphs overwrite enough glyphs from the current line to
5267 have sufficient space in pixels.
5268 (display_line): Support truncation and continuation glyphs on GUI
5269 frames. If some spare pixels are left on the line after inserting
5270 the truncation glyphs, fill that space with a stretch glyph of a
5271 suitably computed width.
5272
5273 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5274 produce_glyphs, to support GUI sessions.
5275
5276 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5277
5278 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5279
5280 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5281
5282 Do not require float-time's arg to fit in time_t (Bug#11825).
5283 This works better on hosts where time_t is unsigned, and where
5284 float-time is applied to the (negative) difference between two times.
5285 * editfns.c (decode_time_components): Last arg is now double *,
5286 not int *, and means to store all the result as a double, without
5287 worrying about whether the seconds part fits in time_t.
5288 All callers changed.
5289 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5290 All callers changed.
5291 (Ffloat_time): Do not fail merely because the specified time falls
5292 outside of time_t range.
5293
5294 2012-07-07 Glenn Morris <rgm@gnu.org>
5295
5296 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5297 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5298 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5299
5300 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
5301
5302 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5303 Update dependencies.
5304
5305 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5306
5307 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5308
5309 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5310 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5311 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5312 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5313 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5314 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5315
5316 * xfont.c (compare_font_names): Redo to omit the need for casts.
5317
5318 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5319
5320 * xfns.c (Fx_change_window_property): Doc fix.
5321 * w32fns.c (Fx_change_window_property): Doc fix.
5322
5323 * w32fns.c (Fx_window_property): Accept the same arguments as the
5324 X Windows version. Doc fix.
5325 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5326
5327 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5328 Eli Zaretskii <eliz@gnu.org>
5329
5330 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5331 Windows-specific code from nt/config.nt moved here.
5332 Obsolete settings removed.
5333
5334 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5335
5336 * process.c: Avoid unnecessary calls to gettime.
5337 (wait_reading_process_output): Don't get the time of day
5338 when gobbling data immediately and not waiting, as there's no need
5339 for it in that case. This removes a FIXME.
5340
5341 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5342
5343 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5344 is defined (Bug#11768).
5345
5346 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5347
5348 Fix marker debugging code.
5349 * marker.c (byte_char_debug_check): Do not perform the check
5350 if buffer is not multibyte.
5351 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5352 Call byte_char_debug_check with correct arguments.
5353
5354 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5355
5356 Compile marker debugging code only if ENABLE_CHECKING is defined.
5357 * marker.c (byte_char_debug_check, count_markers):
5358 Use only if ENABLE_CHECKING is defined.
5359 (byte_debug_flag): Remove.
5360 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5361 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5362
5363 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5364
5365 Avoid code repetition in marker-related functions.
5366 * marker.c (attach_marker): New function.
5367 (Fset_marker, set_marker_restricted, set_marker_both)
5368 (set_marker_restricted_both): Use it.
5369 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5370 Consistently rename charno to charpos.
5371 (marker_position): Add eassert.
5372 (marker_byte_position): Convert to eassert.
5373
5374 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5375
5376 Simplify list operations in unchain_overlay and unchain_marker.
5377 * buffer.c (unchain_overlay): Simplify. Add comment.
5378 * marker.c (unchain_marker): Simplify. Fix comments.
5379
5380 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5381
5382 Introduce fast path for the widely used marker operation.
5383 * alloc.c (build_marker): New function.
5384 * lisp.h (build_marker): New prototype.
5385 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5386 * composite.c (autocmp_chars): Likewise.
5387 * editfns.c (buildmark): Remove.
5388 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5389 (save_restriction_save): Use build_marker.
5390 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5391 * window.c (save_window_save): Likewise.
5392
5393 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5394
5395 Do not use Fdelete_overlay in delete_all_overlays
5396 to avoid redundant calls to unchain_overlay.
5397 * buffer.c (drop_overlay): New function.
5398 (delete_all_overlays, Fdelete_overlay): Use it.
5399 * minibuf.c (get_minibuffer): Fix comment.
5400
5401 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5402
5403 Port to OpenBSD 5.1 amd64.
5404 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5405 This is needed for OpenBSD, and should be harmless on all BSD systems.
5406 Also, include <sys/sysctl.h>, as it should be available on all
5407 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5408 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5409 use p_pid member, not kp_proc.pid.
5410
5411 2012-07-06 Glenn Morris <rgm@gnu.org>
5412
5413 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5414
5415 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5416
5417 More xmalloc and related cleanup.
5418 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5419 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5420 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5421 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5422 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5423 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5424 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5425 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5426 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5427 * xterm.c:
5428 Omit needless casts involving void * pointers and allocation.
5429 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5430 as the former is more robust if P's type is changed.
5431 Prefer xzalloc to xmalloc + memset 0.
5432 Simplify malloc-or-realloc to realloc.
5433 Don't worry about xmalloc returning a null pointer.
5434 Prefer xstrdup to xmalloc + strcpy.
5435 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5436 growing it.
5437 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5438 alloca of a constant.
5439
5440 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5441
5442 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5443 hscroll is larger than the line width. Fixes long and futile
5444 looping inside extend_face_to_end_of_line (on a TTY) producing
5445 glyphs that are not needed and thrown away.
5446
5447 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5448
5449 * marker.c (set_marker_restricted_both): Simplify by using
5450 clip_to_bounds.
5451
5452 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5453
5454 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5455
5456 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5457
5458 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5459 not defined (Bug#11768).
5460 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5461 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5462 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5463 followed by gtk_box_set_homogeneous (Bug#11768).
5464 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5465 (update_theme_scrollbar_width, xg_create_scroll_bar):
5466 Use gtk_scrollbar_new (Bug#11768).
5467 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5468 (is_box_type): New function (Bug#11768).
5469 (xg_tool_item_stale_p): Call is_box_type.
5470 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5471 with default display (Bug#11768).
5472
5473 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5474
5475 * xdisp.c (window_hscroll_limited): New function.
5476 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5477 coordinates when window's hscroll is set to insanely large
5478 values. (Bug#11857)
5479
5480 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
5481
5482 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5483 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5484
5485 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5486
5487 Cleanup xmalloc.
5488 * lisp.h (xzalloc): New prototype. Omit needless casts.
5489 * alloc.c (xzalloc): New function. Omit needless casts.
5490 * charset.c: Omit needless casts. Convert all calls to
5491 xmalloc with following memset to xzalloc.
5492 * dispnew.c: Likewise.
5493 * fringe.c: Likewise.
5494 * image.c: Likewise.
5495 * sound.c: Likewise.
5496 * term.c: Likewise.
5497 * w32fns.c: Likewise.
5498 * w32font.c: Likewise.
5499 * w32term.c: Likewise.
5500 * xfaces.c: Likewise.
5501 * xfns.c: Likewise.
5502 * xterm.c: Likewise.
5503 * atimer.c: Omit needless casts.
5504 * buffer.c: Likewise.
5505 * callproc.c: Likewise.
5506 * ccl.c: Likewise.
5507 * coding.c: Likewise.
5508 * composite.c: Likewise.
5509 * doc.c: Likewise.
5510 * doprnt.c: Likewise.
5511 * editfns.c: Likewise.
5512 * emacs.c: Likewise.
5513 * eval.c: Likewise.
5514 * filelock.c: Likewise.
5515 * fns.c: Likewise.
5516 * gtkutil.c: Likewise.
5517 * keyboard.c: Likewise.
5518 * lisp.h: Likewise.
5519 * lread.c: Likewise.
5520 * minibuf.c: Likewise.
5521 * msdos.c: Likewise.
5522 * print.c: Likewise.
5523 * process.c: Likewise.
5524 * region-cache.c: Likewise.
5525 * search.c: Likewise.
5526 * sysdep.c: Likewise.
5527 * termcap.c: Likewise.
5528 * terminal.c: Likewise.
5529 * tparam.c: Likewise.
5530 * w16select.c: Likewise.
5531 * w32.c: Likewise.
5532 * w32reg.c: Likewise.
5533 * w32select.c: Likewise.
5534 * w32uniscribe.c: Likewise.
5535 * widget.c: Likewise.
5536 * xdisp.c: Likewise.
5537 * xmenu.c: Likewise.
5538 * xrdb.c: Likewise.
5539 * xselect.c: Likewise.
5540
5541 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5542
5543 * fileio.c (time_error_value): Check the right error number.
5544 Problem reported by Troels Nielsen in
5545 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5546
5547 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5548
5549 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5550 This should be fixed in a better way; see Eli Zaretskii in
5551 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5552 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5553
5554 * fileio.c (time_error_value): Rename from special_mtime.
5555 The old name's problems were noted by Eli Zaretskii in
5556 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5557
5558 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5559 This variable's comment says Emacs needs at least one GDB-visible
5560 symbol of type enum pvec_type, to work around GDB problems.
5561 The symbol's value doesn't matter.
5562
5563 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5564 that causes compilation to fail on pre-C99 compilers.
5565
5566 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
5567
5568 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5569 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5570
5571 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5572
5573 * buffer.c (init_buffer_once): Fix initialization of
5574 headers for buffer_defaults and buffer_local_symbols.
5575 Reported by Juanma Barranquero <lekktu@gmail.com>.
5576
5577 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5578
5579 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5580 * lisp.h (enum pvec_type): Use fewer bits.
5581 (PSEUDOVECTOR_SIZE_BITS): New constant.
5582 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5583 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5584 change in pvec_type.
5585 (PSEUDOVECTOR_TYPEP): New macro.
5586 (TYPED_PSEUDOVECTORP): Use it.
5587 * fns.c (internal_equal): Adapt code to extract pvectype.
5588 * emacs.c (gdb_pvec_type): Update type.
5589 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5590 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5591 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5592 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5593 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5594 abusing vector->header.next.nbytes.
5595 (live_vector_p): Use PVEC_TYPE.
5596 (mark_object): Adapt code to extract pvectype. Use switch.
5597
5598 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5599
5600 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5601 Tighten new eassert a bit.
5602
5603 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5604
5605 Fix compilation with --enable-gcc-warnings and -O1
5606 optimization level.
5607 * doprnt.c (doprnt): Change type of tem to int, initialize
5608 to avoid compiler warning. Add eassert.
5609 * search.c (simple_search): Initialize match_byte to avoid
5610 compiler warning. Add eassert.
5611
5612 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5613
5614 Avoid weird behavior with large horizontal scrolls.
5615 Without this change, for example, large hscroll values would
5616 mess up Emacs's display on Fedora 15 x86, presumably due to
5617 overflows in int calculations in the display code.
5618 Also, if buffers had long lines, Emacs would freeze.
5619 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5620 (set_window_hscroll): New function, containing the old guts of
5621 Fset_window_hscroll. Return the clipped value.
5622 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5623 This avoids the need to check against PTRDIFF_MAX.
5624
5625 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5626
5627 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5628
5629 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5630
5631 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5632
5633 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5634 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5635 since GCC 4.4.6 issues a bogus warning for them.
5636
5637 Fix bugs in file timestamp newness comparisons.
5638 * fileio.c (Ffile_newer_than_file_p):
5639 * lread.c (Fload): Use full timestamp resolution of files,
5640 not just the 1-second resolution, so that files that are only
5641 slightly newer still count as newer.
5642 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5643 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5644
5645 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5646
5647 * fileio.c: Improve handling of file time marker. (Bug#11852)
5648 (special_mtime): New function.
5649 (Finsert_file_contents, Fverify_visited_file_modtime):
5650 Use it to set special mtime values consistently.
5651
5652 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5653
5654 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5655 marker for non-existing file. (Bug#11852)
5656
5657 2012-07-03 Glenn Morris <rgm@gnu.org>
5658
5659 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5660 and did not make it into globals.h).
5661
5662 2012-07-03 Tom Tromey <tromey@redhat.com>
5663
5664 * window.c (Fset_window_margins, Fset_window_fringes)
5665 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5666 * textprop.c (Fprevious_property_change): No longer static.
5667 * syntax.c (Fsyntax_table_p): No longer static.
5668 * process.c (Fget_process, Fprocess_datagram_address): No longer
5669 static.
5670 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5671 * keyboard.c (Fcommand_execute): No longer static.
5672 Remove EXFUN.
5673 * insdel.c (Fcombine_after_change_execute): No longer static.
5674 * image.c (Finit_image_library): No longer static.
5675 * fileio.c (Fmake_symbolic_link): No longer static.
5676 * eval.c (Ffetch_bytecode): No longer static.
5677 * editfns.c (Fuser_full_name): No longer static.
5678 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5679 No longer static.
5680 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5681 static.
5682 * dired.c (Ffile_attributes): No longer static.
5683 * composite.c (Fcomposition_get_gstring): No longer static.
5684 * callproc.c (Fgetenv_internal): No longer static.
5685
5686 * ccl.h: Remove EXFUNs.
5687 * buffer.h: Remove EXFUNs.
5688 * dispextern.h: Remove EXFUNs.
5689 * intervals.h: Remove EXFUNs.
5690 * fontset.h: Remove EXFUN.
5691 * font.h: Remove EXFUNs.
5692 * dosfns.c (system_process_attributes): Remove EXFUN.
5693 * keymap.h: Remove EXFUNs.
5694 * lisp.h: Remove EXFUNs.
5695 * w32term.h: Remove EXFUNs.
5696 * window.h: Remove EXFUNs.
5697 * xsettings.h: Remove EXFUN.
5698 * xterm.h: Remove EXFUN.
5699
5700 2012-07-03 Glenn Morris <rgm@gnu.org>
5701
5702 * lisp.h (Frandom): Make it visible to C.
5703 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5704 buffer for invisible buffers. (Bug#1229)
5705
5706 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5707
5708 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5709 values which aren't power of 2.
5710 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5711 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5712 accordingly.
5713
5714 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5715
5716 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5717
5718 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5719
5720 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5721
5722 * alloc.c (allocate_vector_block): Remove redundant
5723 calls to mallopt if DOUG_LEA_MALLOC is defined.
5724 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5725 avoid calls to mallopt if zero_vector is returned.
5726
5727 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5728
5729 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5730 is enabled, avoid dereferencing NULL current_sblock if
5731 running undumped.
5732
5733 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5734
5735 Cleanup basic buffer management.
5736 * buffer.h (struct buffer): Change layout to use generic vector
5737 marking code. Fix some comments. Change type of 'clip_changed'
5738 to bitfield. Remove unused #ifndef old.
5739 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5740 (GET_OVERLAYS_AT): Fix indentation.
5741 (for_each_per_buffer_object_at): New macro.
5742 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5743 (Fbuffer_local_variables): Use it.
5744 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5745 * alloc.c (allocate_buffer): Adjust to match new layout of
5746 struct buffer. Fix comment.
5747 (mark_overlay): New function.
5748 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5749 Lisp area of struct buffer.
5750 (mark_object): Use it. Adjust marking of misc objects
5751 and related comments.
5752
5753 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5754
5755 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5756 wrapper that is not needed because the wrapped code is a no-op (zero
5757 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5758 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5759
5760 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5761
5762 * alloc.c (mark_buffer): Simplify. Remove prototype.
5763 (mark_object): Add comment. Reorganize marking of vector-like
5764 objects. Use CHECK_LIVE for all vector-like objects except buffers
5765 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5766 Avoid redundant calls to mark_vectorlike for bool vectors.
5767
5768 2012-06-30 Glenn Morris <rgm@gnu.org>
5769
5770 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5771
5772 * epaths.in (PATH_SITELOADSEARCH): New.
5773 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5774 This is rather than relying on --enable-locallisppath elements
5775 having "site-lisp" in their names. (Bug#10208#25, 11658)
5776
5777 2012-06-30 Eli Zaretskii <eliz@gnu.org>
5778
5779 * w32proc.c (sys_select): Accept and ignore one more argument.
5780
5781 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5782
5783 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5784 (pselect) [!MS_DOS]: Redirect to sys_select.
5785
5786 * sysdep.c: Don't include dos.h and dosfns.h.
5787
5788 * process.c (sys_select):
5789 * msdos.c (sys_select): Accept one more argument and ignore it.
5790
5791 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5792 adapt data types and code to that.
5793
5794 * dosfns.c:
5795 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5796 which clashes with the gnulib function of the same name.
5797
5798 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5799
5800 * font.c (font_style_to_value, font_style_symbolic)
5801 (font_prop_validate_style): Add type checks for values in
5802 font_style_table.
5803
5804 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5805 argument.
5806 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5807 uses.
5808
5809 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5810
5811 * xdisp.c (try_window_id): Undo last change.
5812
5813 * w32.c (getwd): Adjust commentary about startup_dir.
5814 (init_environment): Always call sys_access, even in non-MSVC
5815 builds. Don't chdir to the directory of the Emacs executable.
5816 This undoes code from 1997 which was justified by the need to
5817 "avoid conflicts when removing and renaming directories". But its
5818 downside was that every relative file name was being interpreted
5819 relative to the directory of the Emacs executable, which can never
5820 be TRT. In particular, it broke sys_access when called with
5821 relative file names.
5822 (sys_access): Map GetLastError to errno.
5823
5824 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5825
5826 * window.h (struct window): Change type of 'fringes_outside_margins'
5827 to bitfield. Fix comment. Adjust users accordingly.
5828 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5829 Adjust comment.
5830 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5831 to ptrdiff_t.
5832
5833 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5834
5835 * gnutls.c (emacs_gnutls_handshake):
5836 Add QUIT to make the loop interruptible.
5837
5838 2012-06-29 Glenn Morris <rgm@gnu.org>
5839
5840 * charset.c (init_charset): Make lack of etc/charsets fatal.
5841
5842 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5843
5844 * editfns.c (region_limit): Fix type mismatch.
5845
5846 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5847
5848 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5849 undefined. Convert from xassert to eassert.
5850 * nsmenu.m: Convert from xassert to eassert.
5851 * nsterm.m: Likewise.
5852
5853 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5854
5855 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5856
5857 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5858
5859 Avoid integer overflow on scroll-left and scroll-right.
5860 * window.c (HSCROLL_MAX): New macro.
5861 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5862 overflow when requested scroll falls outside ptrdiff_t range.
5863
5864 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5865
5866 * window.h (struct window): Change type of 'hscroll',
5867 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5868 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5869 Adjust users accordingly.
5870 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5871 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5872 from EMACS_INT to ptrdiff_t.
5873 (make_window): Omit redundant initialization.
5874
5875 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5876
5877 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5878
5879 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5880
5881 * window.h (struct window): Change type of 'use_time' and
5882 'sequence_number' from Lisp_Object to int.
5883 * frame.c (make_frame): Adjust users accordingly.
5884 * print.c (print_object): Likewise.
5885 * window.c (select_window, Fwindow_use_time, make_parent_window)
5886 (make_window): Likewise.
5887
5888 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5889
5890 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5891 enabled with --enable-checking=[all,glyphs] configure option.
5892 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5893 adjust comments accordingly.
5894 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5895 undefined, adjust comments accordingly.
5896 * image.c: Likewise.
5897 * scroll.c: Likewise.
5898 * w32fns.c: Likewise.
5899 * w32term.c: Likewise.
5900 * xdisp.c: Likewise.
5901 * xfaces.c: Likewise.
5902 * xfns.c: Likewise.
5903 * xterm.c: Likewise.
5904
5905 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5906
5907 Generalize run-time debugging checks.
5908 * dispextern.h (XASSERTS): Remove.
5909 * fontset.c (xassert): Remove.
5910 Convert from xassert to eassert.
5911 * alloc.c: Convert from xassert to eassert.
5912 * bidi.c: Likewise.
5913 * dispnew.c: Likewise.
5914 * fns.c: Likewise.
5915 * fringe.c: Likewise.
5916 * ftfont.c: Likewise.
5917 * gtkutil.c: Likewise.
5918 * image.c: Likewise.
5919 * keyboard.c: Likewise.
5920 * menu.c: Likewise.
5921 * process.c: Likewise.
5922 * scroll.c: Likewise.
5923 * sound.c: Likewise.
5924 * term.c: Likewise.
5925 * w32console.c: Likewise.
5926 * w32fns.c: Likewise.
5927 * w32term.c: Likewise.
5928 * window.c: Likewise.
5929 * xdisp.c: Likewise.
5930 * xfaces.c: Likewise.
5931 * xfns.c: Likewise.
5932 * xselect.c: Likewise.
5933 * xterm.c: Likewise.
5934
5935 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5936
5937 * fns.c (maybe_resize_hash_table): Output message when growing the
5938 purify-hashtable.
5939
5940 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5941
5942 * alloc.c (allocate_string_data): Remove dead code.
5943 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5944 avoid GCC warning about unused macro.
5945
5946 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5947
5948 * alloc.c (allocate_string): Omit intervals initialization.
5949 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5950 as in make_pure_string and make_pure_c_string.
5951
5952 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5953
5954 * alloc.c (allocate_string): Fix last change.
5955
5956 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5957
5958 * alloc.c (allocate_string): Remove two redundant calls
5959 to memset, add explicit initialization where appropriate.
5960
5961 2012-06-27 Glenn Morris <rgm@gnu.org>
5962
5963 * lisp.mk (lisp): Remove paths.elc.
5964
5965 2012-06-27 Chong Yidong <cyd@gnu.org>
5966
5967 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5968
5969 2012-06-26 John Wiegley <johnw@newartisans.com>
5970
5971 * unexmacosx.c (copy_data_segment): Add two section names used
5972 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5973
5974 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5975 when building with Clang.
5976
5977 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5978
5979 * eval.c (Fapply): Allow calling it with a single argument.
5980
5981 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5982
5983 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5984 _stricmp and _strnicmp.
5985 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5986
5987 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5988
5989 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5990 allocated window.
5991 (allocate_process): Likewise for new process.
5992 (allocate_terminal): Change to use offsetof.
5993 (allocate_frame): Likewise.
5994 * frame.c (make_frame): Omit redundant initialization.
5995 * window.c (make_parent_window): Use memset.
5996 (make_window): Omit redundant initialization.
5997 * process.c (make_process): Omit redundant initialization.
5998 * terminal.c (create_terminal): Likewise.
5999
6000 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6001
6002 * term.c (delete_tty): Remove redundant call to memset.
6003
6004 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6005
6006 * alloc.c: Remove build_string.
6007 * lisp.h: Define build_string as static inline. This provides
6008 a better opportunity to optimize away calls to strlen when the
6009 function is called with compile-time constant argument.
6010 * image.c (imagemagick_error): Convert to build_string.
6011 * w32proc.c (sys_spawnve): Likewise.
6012 * xterm.c (x_term_init): Likewise.
6013
6014 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6015
6016 Use sprintf return value instead of invoking strlen on result.
6017 In the old days this wasn't portable, since some sprintf
6018 implementations returned char *. But they died out years ago and
6019 Emacs already assumes sprintf returns int.
6020 Similarly for float_to_string.
6021 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6022 * ccl.c (ccl_driver):
6023 * character.c (string_escape_byte8):
6024 * data.c (Fnumber_to_string):
6025 * doprnt.c (doprnt):
6026 * print.c (print_object):
6027 * xdisp.c (message_dolog):
6028 * xfns.c (syms_of_xfns):
6029 Use sprintf or float_to_string result to avoid need to call strlen.
6030 * data.c (Fnumber_to_string):
6031 Use make_unibyte_string, since the string must be ASCII.
6032 * lisp.h, print.c (float_to_string): Now returns int length.
6033 * term.c (produce_glyphless_glyph):
6034 Use sprintf result rather than recomputing it.
6035
6036 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6037 * Makefile.in (ALL_CFLAGS):
6038 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6039 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6040
6041 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6042
6043 * dispextern.h (xstrcasecmp): Define to library function
6044 strcasecmp if available.
6045 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6046
6047 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6048
6049 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6050 Avoid comma operator.
6051 * menu.c (push_submenu_start, push_submenu_end)
6052 (push_left_right_boundary, push_menu_pane): Likewise.
6053 * msdos.c (dos_rawgetc): Likewise.
6054
6055 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6056
6057 * xfns.c (xic_create_fontsetname): Remove redundant calls
6058 to memset.
6059
6060 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6061
6062 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6063 sprintf already null-terminates its output.
6064
6065 * xfns.c (x_window): Remove redundant cast.
6066
6067 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6068
6069 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6070 `const char *' to `char *' to avoid compiler warning.
6071
6072 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6073
6074 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6075 instead of truncating it to 63 (admittedly a generous limit).
6076
6077 * process.c: Fix spelling and caps in comments.
6078
6079 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6080
6081 * emacs.c (setpgrp): Remove definition, unused.
6082 * sysdep.c (setpgrp): Remove definition, not used in this file.
6083
6084 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
6085
6086 * makefile.w32-in: Update dependencies.
6087
6088 2012-06-24 Eli Zaretskii <eliz@gnu.org>
6089
6090 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6091 (SYSTIME_H): Add nt/inc/sys/time.h.
6092
6093 * systime.h [WINDOWSNT]: Include sys/time.h.
6094
6095 * s/ms-w32.h (struct timespec): Definition moved from
6096 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6097
6098 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6099
6100 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6101 * buffer.h (buffer_slot_type_mismatch):
6102 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6103 * eval.c (unwind_to_catch):
6104 * image.c (my_png_error, my_error_exit):
6105 * keyboard.c (quit_throw_to_read_char, user_error)
6106 (Fexit_recursive_edit, Fabort_recursive_edit):
6107 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6108 (wrong_type_argument, buffer_overflow, __executable_start)
6109 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6110 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6111 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6112 (fatal):
6113 (child_setup) [!DOS_NT]:
6114 * lread.c (end_of_file_error, invalid_syntax):
6115 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6116 * puresize.h (pure_write_error):
6117 * search.c (matcher_overflow):
6118 * sound.c (sound_perror, alsa_sound_perror):
6119 * sysdep.c, syssignal.h (croak):
6120 * term.c (maybe_fatal, vfatal):
6121 * textprop.c (text_read_only):
6122 * undo.c (user_error):
6123 * unexmacosx.c (unexec_error):
6124 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6125 Use _Noreturn rather than NO_RETURN.
6126 No need for separate decl merely because of _Noreturn.
6127 * sound.c (sound_warning, parse_sound):
6128 Remove unnecessary forward decls.
6129
6130 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6131
6132 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6133 * lisp.h (WAIT_READING_MAX): New macro.
6134 * dispnew.c (Fsleep_for, sit_for):
6135 * keyboard.c (kbd_buffer_get_event):
6136 * process.c (Faccept_process_output):
6137 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6138 This improves on the previous patch, which introduced a bug
6139 when time_t is unsigned and as wide as intmax_t.
6140 See <http://bugs.gnu.org/9000#51>.
6141
6142 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6143
6144 * dispnew.c (sit_for, Fsleep_for):
6145 * keyboard.c (kbd_buffer_get_event):
6146 * process.c (Faccept_process_output): Avoid compiler warnings when
6147 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6148
6149 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
6150
6151 * makefile.w32-in: Update dependencies.
6152
6153 * w32.c (ltime): Add return type and declare static.
6154 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6155
6156 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6157
6158 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6159 Privately reported by Herbert J. Skuhra.
6160 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6161 All uses changed.
6162 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6163 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6164
6165 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6166
6167 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6168 last argument of make_unibyte_string.
6169
6170 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6171 language ID in the event parameters.
6172
6173 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6174 event.code, not the obscure "character set ID".
6175
6176 2012-06-23 Chong Yidong <cyd@gnu.org>
6177
6178 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6179
6180 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6181
6182 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6183 * w32.c (fdutimens): New function.
6184
6185 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6186
6187 * s/ms-w32.h (pselect): Redirect to sys_select.
6188
6189 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6190
6191 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6192 in the logic of incrementing and decrementing the value of
6193 use_relocatable_buffers.
6194
6195 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6196
6197 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6198 Privately reported by Herbert J. Skuhra.
6199 [__FreeBSD__]: Remove "*/" typo after "#include".
6200 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6201 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6202 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6203 Don't assume EMACS_TIME and struct timeval are the same type.
6204
6205 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6206
6207 Support higher-resolution time stamps (Bug#9000).
6208 The time stamps are only nanosecond-resolution at the C level,
6209 since that's the best that any real-world system supports now.
6210 But they are picosecond-resolution at the Lisp level, as that's
6211 easy, and leaves room for future OS improvements.
6212
6213 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6214 (LIBES): Use it.
6215
6216 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6217 Don't get current time unless it's needed.
6218
6219 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6220 now provides it if it's absent.
6221 (start_atimer): Port to higher-res time stamps.
6222 Check for time stamp overflow. Don't get current time more
6223 often than is needed.
6224
6225 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6226 Include systime.h, not time.h.
6227 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6228
6229 * dired.c: Include stat-time.h.
6230 (Ffile-attributes): File times now have higher resolution.
6231
6232 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6233 (struct image): Timestamp now has higher resolution.
6234
6235 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6236 has at least microseconds now. All uses removed.
6237 (update_frame, update_single_window, update_window, update_frame_1)
6238 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
6239 (duration_to_sec_usec): Remove; no longer needed.
6240
6241 * editfns.c (time_overflow): Now extern.
6242 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6243 (float-time, Fformat_time_string, Fcurrent_time_string)
6244 (Fcurrent_time_zone): Accept and generate higher-resolution
6245 time stamps.
6246 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6247 (decode_time_components, lisp_seconds_argument): New functions.
6248 (make_time): Now static.
6249 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6250 Report an error if the time is invalid, rather than having the caller
6251 do that.
6252
6253 * fileio.c: Include <stat-time.h>
6254 (Fcopy_file): Copy higher-resolution time stamps.
6255 Prefer to set the time stamp via a file descriptor if that works.
6256 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6257 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6258 (Fvisited_file_modtime, Fset_visited_file_modtime):
6259 Support higher-resolution time stamps.
6260
6261 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6262
6263 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6264
6265 * image.c (prepare_image_for_display, clear_image_cache)
6266 (lookup_image): Port to higer-resolution time stamps.
6267
6268 * keyboard.c (start_polling, bind_polling_period):
6269 Check for time stamp overflow.
6270 (read_char, kbd_buffer_get_event, timer_start_idle)
6271 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6272 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6273 Port to higher-resolution time stamps. Do not assume time_t is signed.
6274 (decode_timer): New function. Timers are now vectors of length 9,
6275 not 8, to accommodate the picosecond component.
6276 (timer_check_2): Use it.
6277
6278 * nsterm.m (select_timeout, timeval_subtract): Remove.
6279 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6280 as they're a bit more accurate and handle overflow better.
6281 (ns_select): Change prototype to be compatible with pselect.
6282 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6283 * nsterm.h (ns_select): Adjust prototype.
6284
6285 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6286 us-resolution time stamps.
6287 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6288
6289 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6290
6291 * lisp.h (time_overflow): New decl.
6292 (wait_reading_process_output): First arg is now intmax_t, not int,
6293 to accommodate larger waits.
6294
6295 * process.h (struct Lisp_Process.read_output_delay):
6296 Now counts nanoseconds, not microseconds.
6297 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6298 EMACS_HAS_USECS.
6299 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6300 (wait_reading_process_output):
6301 Port to ns-resolution time stamps.
6302 (Faccept_process_output, wait_reading_process_output):
6303 Check for time stamp overflow. Do not assume time_t is signed.
6304 (select_wrapper): Remove; we now use pselect.
6305 (Fprocess_attributes): Now generates ns-resolution time stamps.
6306
6307 * sysdep.c: Include utimens.h. Don't include utime.h
6308 or worry about struct utimbuf; gnulib does that for us now.
6309 (gettimeofday): Remove; gnulib provides a substitute.
6310 (make_timeval): New function.
6311 (set_file_times): Now sets ns-resolution time stamps.
6312 New arg FD; all uses changed.
6313 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6314 (system_process_attributes):
6315 Now returns ns-resolution time stamp. All uses changed.
6316 Check for time stamp overflow.
6317
6318 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6319 provides a substitute now.
6320
6321 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6322 since it guarantees struct timespec.
6323 (EMACS_TIME): Now struct timespec, so that we can support
6324 ns-resolution time stamps.
6325 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6326 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6327 (EMACS_USECS): Remove.
6328 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6329 so multiply the arg by 1000 before storing it.
6330 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6331 New macros.
6332 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6333 Port to ns-resolution time stamps.
6334 (EMACS_TIME_NEG_P): Remove; replaced by....
6335 (EMACS_TIME_SIGN): New macro.
6336 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6337 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6338 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6339 (make_timeval, make_lisp_time, decode_time_components): New decls.
6340 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6341 that it mishandled time_t overflow. You can't compare by subtracting!
6342 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6343 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6344
6345 * term.c: Include <sys/time.h>.
6346 (timeval_to_Time): New function, for proper overflow wraparound.
6347 (term_mouse_position, term_mouse_click): Use it.
6348
6349 * undo.c (record_first_change): Support higher-resolution time stamps
6350 in the undo buffer.
6351 (Fprimitive_undo): Use them when restoring time stamps.
6352
6353 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6354 (w32_get_internal_run_time):
6355 Port to higher-resolution Emacs time stamps.
6356 (ltime): Now accepts single 64-bit integer, as that's more convenient
6357 for callers.
6358
6359 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6360
6361 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6362 for compatibility with pselect. Support ns-resolution time stamps.
6363
6364 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6365
6366 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6367 Check for time stamp overflow, and support ns-resolution time stamps.
6368
6369 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6370 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6371 (timeval_subtract): Remove; no longer needed.
6372 (XTflash, XTring_bell, x_wait_for_event):
6373 Port to ns-resolution time stamps. Don't assume time_t is signed.
6374
6375 2012-06-22 Chong Yidong <cyd@gnu.org>
6376
6377 * xdisp.c (x_consider_frame_title): Revert last change.
6378
6379 2012-06-22 Eli Zaretskii <eliz@gnu.org>
6380
6381 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6382 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6383 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6384 staticidx goes up to 1597 out of 1600 = 0x640.)
6385
6386 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6387
6388 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6389 Otherwise, the umask might be mistakenly 0 while handling input signals.
6390
6391 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6392
6393 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6394
6395 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6396
6397 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6398 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6399 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6400 access to `contents' member of Lisp_Vector objects with AREF and ASET
6401 where appropriate.
6402
6403 2012-06-19 Chong Yidong <cyd@gnu.org>
6404
6405 * frame.c (delete_frame): When selecting a frame on a different
6406 text terminal, do not alter the terminal's top-frame.
6407
6408 * xdisp.c (format_mode_line_unwind_data): Record the target
6409 frame's selected window and its terminal's top-frame.
6410 (unwind_format_mode_line): Restore them.
6411 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6412 Callers changed.
6413 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6414 since tty frames can be explicitly named.
6415 (prepare_menu_bars): Likewise.
6416
6417 * term.c (Ftty_top_frame): New function.
6418
6419 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6420
6421 Port byte-code-meter to modern targets.
6422 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6423 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6424 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6425 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6426 (METER_1, METER_2): Simplify.
6427
6428 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6429
6430 * data.c (Fdefalias): Return `symbol' (bug#11686).
6431
6432 2012-06-18 Martin Rudalics <rudalics@gmx.at>
6433
6434 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6435 gets killed during executing of this function (Bug#11665).
6436 Try to always return Qt when the buffer has been actually killed.
6437 (Vkill_buffer_query_functions): In doc-string say that functions
6438 run by this hook should not change the current buffer.
6439
6440 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6441
6442 Fix recently-introduced process.c problems found by static checking.
6443 * process.c (write_queue_push, write_queue_pop, send_process):
6444 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6445 (write_queue_pop): Fix pointer signedness problem.
6446 (send_process): Remove unused local.
6447
6448 2012-06-17 Chong Yidong <cyd@gnu.org>
6449
6450 * xdisp.c (redisplay_internal): No need to redisplay terminal
6451 frames that are not on top.
6452
6453 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
6454
6455 * process.c (make_process): Initialize write_queue.
6456 (write_queue_push, write_queue_pop): New functions.
6457 (send_process): Use them to maintain correct ordering of process
6458 writes (Bug#10815).
6459
6460 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6461
6462 * lisp.h (eassert): Assume C89 or later.
6463 This removes the need for CHECK.
6464 (CHECK): Remove. Its comments about always evaluating its
6465 argument were confusing, as 'eassert' typically does not evaluate
6466 its argument.
6467
6468 * coding.c (produce_chars): Use ptrdiff_t, not int.
6469
6470 * xterm.c (x_draw_underwave): Check for integer overflow.
6471 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6472
6473 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
6474
6475 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6476 referenced (Bug#11583).
6477
6478 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6479
6480 Implement wave-style variant of underlining.
6481 * dispextern.h (face_underline_type): New enum.
6482 (face): Add field for underline type.
6483 * nsterm.m (ns_draw_underwave): New function.
6484 (ns_draw_text_decoration): Use it.
6485 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6486 New functions.
6487 (x_draw_glyph_string): Use them.
6488 * xfaces.c (Qline, Qwave): New Lisp objects.
6489 (check_lface_attrs, merge_face_ref)
6490 (Finternal_set_lisp_face_attribute, realize_x_face):
6491 Handle wave-style underline face attributes.
6492 * xterm.c (x_draw_underwave): New function.
6493 (x_draw_glyph_string): Use it.
6494
6495 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
6496
6497 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6498 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6499 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6500 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6501 ($(BLD)/w32select.$(O)): Update dependencies.
6502
6503 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6504
6505 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6506 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6507 * character.c (_fetch_multibyte_char_p): Remove.
6508 * alloc.c: Include "character.h" before "buffer.h".
6509 * bidi.c: Likewise.
6510 * buffer.c: Likewise.
6511 * bytecode.c: Likewise.
6512 * callint.c: Likewise.
6513 * callproc.c: Likewise.
6514 * casefiddle.c: Likewise.
6515 * casetab.c: Likewise.
6516 * category.c: Likewise.
6517 * cmds.c: Likewise.
6518 * coding.c: Likewise.
6519 * composite.c: Likewise.
6520 * dired.c: Likewise.
6521 * dispnew.c: Likewise.
6522 * doc.c: Likewise.
6523 * dosfns.c: Likewise.
6524 * editfns.c: Likewise.
6525 * emacs.c: Likewise.
6526 * fileio.c: Likewise.
6527 * filelock.c: Likewise.
6528 * font.c: Likewise.
6529 * fontset.c: Likewise.
6530 * fringe.c: Likewise.
6531 * indent.c: Likewise.
6532 * insdel.c: Likewise.
6533 * intervals.c: Likewise.
6534 * keyboard.c: Likewise.
6535 * keymap.c: Likewise.
6536 * lread.c: Likewise.
6537 * macros.c: Likewise.
6538 * marker.c: Likewise.
6539 * minibuf.c: Likewise.
6540 * nsfns.m: Likewise.
6541 * nsmenu.m: Likewise.
6542 * print.c: Likewise.
6543 * process.c: Likewise.
6544 * regex.c: Likewise.
6545 * region-cache.c: Likewise.
6546 * search.c: Likewise.
6547 * syntax.c: Likewise.
6548 * term.c: Likewise.
6549 * textprop.c: Likewise.
6550 * undo.c: Likewise.
6551 * unexsol.c: Likewise.
6552 * w16select.c: Likewise.
6553 * w32fns.c: Likewise.
6554 * w32menu.c: Likewise.
6555 * window.c: Likewise.
6556 * xdisp.c: Likewise.
6557 * xfns.c: Likewise.
6558 * xmenu.c: Likewise.
6559 * xml.c: Likewise.
6560 * xselect.c: Likewise.
6561
6562 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6563
6564 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6565 If all the glyphs of the glyph row came from strings, and we have no
6566 cursor positioning clues, put the cursor on the first glyph of the
6567 row.
6568 (handle_face_prop): Use chunk-relative overlay string index when
6569 indexing into it->string_overlays array. (Bug#11653)
6570 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6571 the rightmost. (Bug#11720)
6572
6573 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6574
6575 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6576 (CATEGORY_MEMBER): Enforce 1/0 value.
6577 * category.c (_temp_category_set): Remove.
6578
6579 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6580
6581 * window.c (Fdelete_other_windows_internal)
6582 (Fdelete_window_internal): Don't access frame's mouse highlight
6583 info of the initial frame. (Bug#11677)
6584
6585 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6586
6587 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6588 Assume USE_2_TAGS_FOR_INTS.
6589 (xreload): Adjust $tagmask width to match recent lisp.h change.
6590
6591 Simplify lisp.h in minor ways that should not affect code.
6592 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6593 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6594 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6595 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6596 (INTTYPEBITS): New macro, for clarity.
6597 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6598 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6599 Simplify now that USE_LSB_TAG is always defined.
6600 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6601 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6602
6603 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
6604
6605 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6606
6607 2012-06-13 Glenn Morris <rgm@gnu.org>
6608
6609 * s/bsd-common.h (BSD4_3):
6610 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6611
6612 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6613
6614 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6615 instead of union.
6616 (XLI, XIL): Define.
6617 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6618 Use them.
6619 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6620 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6621 * alloc.c (widen_to_Lisp_Object): Remove.
6622 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6623 * frame.c (delete_frame): Remove outdated comment.
6624 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6625 USE_LISP_UNION_TYPE.
6626 (Fw32_unregister_hot_key): Likewise.
6627 (Fw32_toggle_lock_key): Likewise.
6628 * w32menu.c (add_menu_item): Likewise.
6629 (w32_menu_display_help): Use XIL instead of checking
6630 USE_LISP_UNION_TYPE.
6631 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6632 (init_heap): Likewise.
6633 * w32term.c (w32_read_socket): Update comment.
6634
6635 2012-06-13 Glenn Morris <rgm@gnu.org>
6636
6637 * s/usg5-4-common.h, src/s/unixware.h:
6638 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6639
6640 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6641
6642 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6643
6644 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6645 * alloc.c (make_number) [!defined make_number]:
6646 Remove, as lisp.h always defines this now.
6647 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6648 (roundup_size): Verify that it is a power of 2.
6649 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6650 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6651 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6652 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6653 USE_LSB_TAG now is always defined to be either 0 or 1.
6654 All uses changed.
6655 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6656 code works fine either way, and efficiency is not a concern here,
6657 as the union type is for debugging, not for production.
6658 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6659 Use an inline function on all platforms when using the union type,
6660 since this is simpler and 'static inline' can be used portably
6661 within Emacs now.
6662 (LISP_INITIALLY_ZERO): New macro.
6663 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6664 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6665
6666 2012-06-12 Glenn Morris <rgm@gnu.org>
6667
6668 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6669
6670 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6671
6672 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6673 Move BROKEN_SIGIO to configure.
6674
6675 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6676 Move NO_TERMIO to configure.
6677
6678 2012-06-12 Chong Yidong <cyd@gnu.org>
6679
6680 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6681 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6682 MagickExportImagePixels is undefined.
6683
6684 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6685
6686 * image.c (imagemagick_load_image): Remove unused label.
6687
6688 2012-06-11 Glenn Morris <rgm@gnu.org>
6689
6690 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6691 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6692 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6693 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6694
6695 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6696
6697 * alloc.c (make_byte_code): New function.
6698 (Fmake_byte_code): Use it. Don't purify here.
6699 * lread.c (read1): Use it as well to avoid extra allocation.
6700
6701 2012-06-11 Chong Yidong <cyd@gnu.org>
6702
6703 * image.c (imagemagick_load_image): Implement transparency.
6704
6705 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6706
6707 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6708 account for preceding backslashes. (Bug#11663)
6709
6710 2012-06-09 Chong Yidong <cyd@gnu.org>
6711
6712 * term.c: Support italics in capable terminals (Bug#9652).
6713 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6714 (turn_on_face): Output using TS_enter_italic_mode if available.
6715 Don't handle unused blinking and alt-charset cases.
6716 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6717 and tty_alt_charset_p cases.
6718 (tty_capable_p, init_tty): Support italics.
6719
6720 * termchar.h (struct tty_display_info): Add field for italics.
6721 Remove unused blink field.
6722
6723 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6724 Handle slant.
6725
6726 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6727 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6728 tty_alt_charset_p. Add tty_italic_p.
6729
6730 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
6731
6732 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6733 dbus_type_is_basic if available.
6734 (xd_extract_signed, xd_extract_unsigned): Rename from
6735 extract_signed and extract_unsigned, respectively. Adapt callers.
6736
6737 2012-06-09 Chong Yidong <cyd@gnu.org>
6738
6739 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6740
6741 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6742 case (Bug#9752).
6743
6744 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6745
6746 * xdisp.c (vmessage): Treat frame message as multibyte.
6747 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6748 would generate the diagnostic "Making \302\247 buffer-local while
6749 let-bound!".
6750
6751 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6752
6753 * dispnew.c (showing_window_margins_p): Undo last change, which
6754 was done due to an inadvertent commit.
6755 (adjust_frame_glyphs_for_frame_redisplay): Do call
6756 showing_window_margins_p.
6757
6758 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6759
6760 * eval.c (Fmake_var_non_special): New primitive.
6761 (syms_of_eval): Defsubr it.
6762 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6763
6764 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
6765
6766 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6767 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6768
6769 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6770
6771 * alloc.c (allocate_vectorlike): Fix last change.
6772
6773 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6774
6775 Block-based vector allocation of small vectors.
6776 * lisp.h (struct vectorlike_header): New field `nbytes',
6777 adjust comment accordingly.
6778 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6779 to denote vector blocks. Adjust users (live_vector_p,
6780 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6781 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6782 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6783 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6784 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6785 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6786 (roundup_size): New constant.
6787 (struct vector_block): New data type.
6788 (vector_blocks, vector_free_lists, zero_vector): New variables.
6789 (all_vectors): Rename to `large_vectors'.
6790 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6791 (sweep_vectors): New functions.
6792 (allocate_vectorlike): Return `zero_vector' as the only vector of
6793 0 items. Allocate new vector from block if vector size is less than
6794 or equal to VBLOCK_BYTES_MAX.
6795 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6796 (init_alloc_once): Add call to init_vectors.
6797
6798 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6799
6800 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6801
6802 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6803
6804 * doprnt.c (doprnt): Truncate multibyte char correctly.
6805 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6806 would mishandle a string argument "Xc" if X was a multibyte
6807 character of length 2: it would truncate after X's first byte
6808 rather than including all of X.
6809
6810 2012-06-06 Chong Yidong <cyd@gnu.org>
6811
6812 * buffer.c (word_wrap): Doc fix.
6813
6814 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6815
6816 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6817
6818 2012-06-03 Glenn Morris <rgm@gnu.org>
6819
6820 * xdisp.c (tool-bar-style): Doc fix.
6821
6822 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6823
6824 * Makefile.in (PAXCTL): Define.
6825 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6826 binary via PaX flags if the paxctl utility is available.
6827 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6828 Restore PaX flags to their default. (Bug#11398)
6829
6830 2012-06-03 Chong Yidong <cyd@gnu.org>
6831
6832 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6833 buffer (Bug#11226).
6834
6835 2012-06-03 Chong Yidong <cyd@gnu.org>
6836
6837 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6838 (note_mode_line_or_margin_highlight): If there is no help echo,
6839 use mode-line-default-help-echo. Handle the case where the mouse
6840 position is past the end of the mode line string.
6841
6842 * buffer.c (buffer_local_value_1): New function, split from
6843 Fbuffer_local_value; can return Qunbound.
6844 (Fbuffer_local_value): Use it.
6845 (Vmode_line_format): Docstring tweaks.
6846
6847 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6848
6849 * sysdep.c (system_process_attributes): Improve comment.
6850
6851 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6852
6853 * keyboard.c: Export real-this-command to Elisp.
6854 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6855 and DEFVAR it. Update all users.
6856
6857 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6858
6859 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6860
6861 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6862 Convert pctcpu and pctmem to Lisp float properly.
6863 Let the compiler fold better, as 100.0/0x8000 is exact.
6864
6865 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6866
6867 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6868 cons_block.
6869
6870 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6871
6872 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6873
6874 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6875
6876 For a 'struct window', replace some Lisp_Object fields to
6877 bitfields where appropriate, remove unused fields.
6878 * window.h (struct window): Remove unused 'last_mark_x' and
6879 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6880 change it's type from Lisp_Object to bitfield.
6881 Change type of 'force_start', 'optional_new_start',
6882 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6883 fields from Lisp_Object to bitfield. Adjust users accordingly.
6884
6885 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6886
6887 Pacify gcc -Wdouble-precision when using Xaw.
6888 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6889 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6890 Use 'float' consistently, rather than 'float' in most places
6891 and 'double' in a couple of places.
6892
6893 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6894
6895 * xdisp.c (handle_stop): Detect whether we have overlay strings
6896 loaded by testing it->current.overlay_string_index to be
6897 non-negative, instead of checking whether n_overlay_strings is
6898 positive. (Bug#11587)
6899
6900 2012-05-31 Chong Yidong <cyd@gnu.org>
6901
6902 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6903
6904 * doc.c (Fsubstitute_command_keys): Doc fix.
6905
6906 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6907
6908 * search.c (search_buffer): Remove calls to
6909 r_alloc_inhibit_buffer_relocation, as it is now called by
6910 maybe_unify_char, which was the cause of relocation of buffer text
6911 in bug#11519.
6912
6913 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6914
6915 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6916 for the duration of call to load_charset, to avoid problems with
6917 callers of maybe_unify_char that access buffer text through C
6918 pointers.
6919
6920 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6921 decrement the inhibition flag, instead of just setting or
6922 resetting it.
6923
6924 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6925
6926 Remove obsolete '#define static' cruft.
6927 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6928 This #undef was "temporary" in 2000; it is no longer needed
6929 now that '#define static' has gone away.
6930 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6931 (gray_bitmap_bits): Remove; no longer needed.
6932 All uses replaced with definiens.
6933 * xterm.c: Include "bitmaps/gray.xbm".
6934
6935 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6936
6937 Clean up __executable_start, monstartup when --enable-profiling.
6938 The following changes affect the code only when profiling.
6939 * dispnew.c (__executable_start): Rename from safe_bcopy.
6940 Define only on platforms that need it.
6941 * emacs.c: Include <sys/gmon.h> when profiling.
6942 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6943 (__executable_start): Remove decl, since lisp.h does it now.
6944 (safe_bcopy): Remove decl; no longer has that name.
6945 (main): Coalesce #if into single bit of code, for simplicity.
6946 Cast pointers to uintptr_t, since standard libraries want integers
6947 and not pointers.
6948 * lisp.h (__executable_start): New decl.
6949
6950 2012-05-31 Glenn Morris <rgm@gnu.org>
6951
6952 * image.c (Fimagemagick_types): Doc fix.
6953
6954 2012-05-30 Jim Meyering <meyering@redhat.com>
6955
6956 * callproc.c (Fcall_process_region): Include directory component
6957 in mkstemp error message (Bug#11586).
6958
6959 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6960
6961 * alloc.c, lisp.h (make_pure_vector): Now static.
6962
6963 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6964
6965 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6966 Move to byte-run.el.
6967 (Fautoload): Do the hash-doc more carefully.
6968 * data.c (Fdefalias): Purify definition, except for keymaps.
6969 (Qdefun): Move from eval.c.
6970 * lisp.h (Qdefun): Remove.
6971 * lread.c (read1): Tiny simplification.
6972
6973 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6974
6975 Do not create empty overlays with the evaporate property (Bug#9642).
6976 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6977 Bug#9642, but explicitly check that the buffer the overlay would
6978 be moved to is live and rearrange lines to make sure that errors
6979 will not put the overlay in an inconsistent state.
6980 (Fdelete_overlay): Cosmetics.
6981
6982 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6983
6984 * w32term.c (my_bring_window_to_top): New function.
6985 (x_raise_frame): Use handle returned by DeferWindowPos, which
6986 could be different from the original one.
6987 Call my_bring_window_to_top instead of my_set_foreground_window.
6988 (Bug#11513)
6989
6990 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6991 by calling BringWindowToTop.
6992
6993 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6994 (WM_EMACS_END): Increase by one.
6995
6996 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6997
6998 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6999 This avoids undefined behavior that might cause the eassert
7000 to not catch an out-of-range value.
7001
7002 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
7003
7004 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7005 Update dependencies.
7006
7007 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7008
7009 * bidi.c (bidi_mirror_char): Fix last change.
7010
7011 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7012
7013 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7014 when referring to sectname field in printf format.
7015
7016 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7017
7018 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7019 Only r_alloc_inhibit_buffer_relocation needed to be added;
7020 the others were already declared.
7021
7022 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7023 before checking whether it's out of range. Put the check inside
7024 eassert. See
7025 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7026
7027 2012-05-27 Ken Brown <kbrown@cornell.edu>
7028
7029 * callproc.c (Fcall_process): Restore a line that was accidentally
7030 commented out in the 2011-02-13 change (bug#11547).
7031
7032 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7033
7034 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7035 defined on ralloc.c.
7036
7037 * buffer.c [REL_ALLOC]: Remove prototypes of
7038 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7039 they are now on lisp.h.
7040
7041 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7042
7043 * search.c (search_buffer): Use it to inhibit relocation of buffer
7044 text while re_search_2 is doing its job, because re_search_2 is
7045 passed C pointers to buffer text. (Bug#11519)
7046
7047 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7048 Update value to 24.
7049
7050 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7051 state after an additional call to move_it_in_display_line_to, keep
7052 the values of it->max_ascent and it->max_descent found for the
7053 entire line.
7054 (pos_visible_p): Revert the comparison against bottom_y to what it
7055 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7056 (Bug#11464)
7057
7058 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7059
7060 Fix coding-related core dumps with gcc -ftrapv.
7061 The code was computing A - B, where A and B are pointers, and B is
7062 random garbage. This can lead to core dumps on platforms that
7063 have special pointer registers, and it also leads to core dumps on
7064 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7065 A - B only when B is initialized properly.
7066 * coding.c (coding_set_source, coding_set_destination): Return void.
7067 (coding_change_source, coding_change_destinations): New functions,
7068 with the old behaviors of coding_set_source and coding_set_destination.
7069 All callers that need an offset changed to use these new functions.
7070
7071 2012-05-26 Glenn Morris <rgm@gnu.org>
7072
7073 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7074
7075 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7076
7077 Extend mouse support on W32 text-mode console.
7078 * xdisp.c (draw_row_with_mouse_face):
7079 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7080
7081 * w32console.c: Include window.h.
7082 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7083 New functions.
7084 (initialize_w32_display): Initialize mouse-highlight data.
7085
7086 * w32inevt.c: Include termchar.h and window.h.
7087 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7088 moves, call note_mouse_highlight. If help_echo changed, call
7089 gen_help_event to produce help-echo message in the echo area.
7090 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7091 highlight info.
7092
7093 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7094
7095 * lread.c (read1): Simplify slightly to avoid an overflow warning
7096 with GCC 4.7.0 on x86-64.
7097
7098 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7099
7100 * bidi.c (bidi_mirror_char): Revert last change: an int is
7101 definitely wide enough here.
7102
7103 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
7104
7105 Fix integer width and related bugs (Bug#9874).
7106 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7107 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7108 (string_bytes, check_sblock, allocate_string_data):
7109 (compact_small_strings, Fmake_bool_vector, make_string)
7110 (make_unibyte_string, make_multibyte_string)
7111 (make_string_from_bytes, make_specified_string)
7112 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7113 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7114 (mark_vectorlike):
7115 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7116 (allocate_pseudovector):
7117 Use int, not EMACS_INT, where int is wide enough.
7118 (inhibit_garbage_collection, Fgarbage_collect):
7119 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7120 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7121 int might not be wide enough.
7122 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7123 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7124 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7125 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7126 (bidi_level_of_next_char, bidi_move_to_visually_next):
7127 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7128 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7129 (Fkill_buffer, Fset_buffer_major_mode)
7130 (advance_to_char_boundary, Fbuffer_swap_text)
7131 (Fset_buffer_multibyte, overlays_at, overlays_in)
7132 (overlay_touches_p, struct sortvec, record_overlay_string)
7133 (overlay_strings, recenter_overlay_lists)
7134 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7135 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7136 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7137 (Foverlay_recenter, last_overlay_modification_hooks_used)
7138 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7139 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7140 (validate_region): Omit unnecessary test for b <= e,
7141 since that's guaranteed by the previous test.
7142 (adjust_overlays_for_delete): Avoid pos + length overflow.
7143 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7144 (report_overlay_modification):
7145 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7146 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7147 Omit pointer cast, which isn't needed anyway, and doesn't work
7148 after the EMACS_INT -> ptrdiff_t change.
7149 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7150 * buffer.h: Adjust decls to match defn changes elsewhere.
7151 (struct buffer_text, struct buffer):
7152 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7153 Use EMACS_INT, not int, where int might not be wide enough.
7154 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7155 not int, to avoid needless 32-bit limit on 64-bit hosts.
7156 (exec_byte_code): Use tighter memory-full test, one that checks
7157 for alloca overflow. Don't compute the address of the object just
7158 before an array, as that's not portable. Use EMACS_INT, not
7159 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7160 * callint.c (Fcall_interactively):
7161 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7162 * callproc.c (call_process_kill, Fcall_process):
7163 Don't assume pid_t fits into an Emacs fixnum.
7164 (call_process_cleanup, Fcall_process, child_setup):
7165 Don't assume pid_t fits into int.
7166 (call_process_cleanup, Fcall_process, delete_temp_file)
7167 (Fcall_process_region):
7168 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7169 (Fcall_process): Simplify handling of volatile integers.
7170 Use int, not EMACS_INT, where int will do.
7171 * casefiddle.c (casify_object, casify_region, operate_on_word)
7172 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7173 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7174 (casify_object): Avoid integer overflow when overallocating buffer.
7175 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7176 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
7177 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7178 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7179 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7180 integers are now checked earlier. All uses replaced with XINT.
7181 (ccl_driver):
7182 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7183 For CCL_MapSingle, check that content and value are in int range.
7184 (ccl_driver, Fregister_code_conversion_map):
7185 Check that Vcode_version_map_vector is a vector.
7186 (resolve_symbol_ccl_program): Check that vector header is in range.
7187 Always copy the vector, so that we can check its contents reliably
7188 now rather than having to recheck each instruction as it's being
7189 executed. Check that vector words fit in 'int'.
7190 (ccl_get_compiled_code, Fregister_ccl_program)
7191 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7192 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7193 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7194 contents are in range.
7195 (Fccl_execute_on_string): Check that status is in range.
7196 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7197 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7198 Accept and return EMACS_INT, not int, because callers can pass values
7199 out of 'int' range.
7200 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7201 (multibyte_chars_in_text, parse_str_as_multibyte)
7202 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7203 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7204 (string_escape_byte8, Fget_byte):
7205 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7206 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7207 avoid mishandling large integers.
7208 * character.h: Adjust decls to match defn changes elsewhere.
7209 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7210 (Ffind_charset_region):
7211 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7212 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7213 (load_charset_map_from_vector, Fdefine_charset_internal):
7214 Don't assume fixnum fits in int.
7215 (load_charset_map_from_vector, Fmap_charset_chars):
7216 Remove now-unnecessary CHECK_NATNUMs.
7217 (Fdefine_charset_internal): Check ranges here, more carefully.
7218 Don't rely on undefined behavior with signed left shift overflow.
7219 Don't assume unsigned int fits into fixnum, or that fixnum fits
7220 into unsigned int. Don't require max_code to be a valid fixnum;
7221 that's not true for gb10830 4-byte on a 32-bit host. Allow
7222 invalid_code to be a cons, for the same reason. Require code_offset
7223 to be a character. Avoid int overflow if max_char is close
7224 to INT_MAX.
7225 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7226 this is intended anyway and avoids some undefined behavior.
7227 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7228 INDEX_TO_CODE_POINT, as that's what it expects.
7229 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
7230 * charset.h (DECODE_CHAR): Return int, not unsigned;
7231 this is what was intended anyway, and it avoids undefined behavior.
7232 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7233 integer-overflow issues.
7234 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7235 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7236 where the argument is EMACS_INT, and this behavior is not intended.
7237 * chartab.c (Fmake_char_table, Fset_char_table_range)
7238 (uniprop_get_decoder, uniprop_get_encoder):
7239 Don't assume fixnum fits in int.
7240 * cmds.c (move_point): New function, that does the gist of
7241 Fforward_char and Fbackward_char, but does so while checking
7242 for integer overflow more accurately.
7243 (Fforward_char, Fbackward_char): Use it.
7244 (Fforward_line, Fend_of_line, internal_self_insert)
7245 (internal_self_insert):
7246 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7247 Fix a FIXME, by checking for integer overflow when calculating
7248 target_clm and actual_clm.
7249 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
7250 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
7251 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7252 (coding_alloc_by_making_gap, alloc_destination)
7253 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7254 (encode_coding_utf_16, detect_coding_emacs_mule)
7255 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7256 (detect_coding_iso_2022, decode_coding_iso_2022)
7257 (encode_invocation_designation, encode_designation_at_bol)
7258 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7259 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7260 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7261 (encode_coding_ccl, encode_coding_raw_text)
7262 (detect_coding_charset, decode_coding_charset)
7263 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7264 (produce_composition, produce_charset, produce_annotation)
7265 (decode_coding, handle_composition_annotation)
7266 (handle_charset_annotation, consume_chars, decode_coding_gap)
7267 (decode_coding_object, encode_coding_object, detect_coding_system)
7268 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7269 (code_convert_region, code_convert_string)
7270 (Fdefine_coding_system_internal)
7271 (coding_set_source, coding_set_destination):
7272 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7273 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7274 (Fdefine_coding_system_internal):
7275 Don't assume fixnums fit in int.
7276 (decode_coding_gap, decode_coding_object, encode_coding_object)
7277 (Fread_coding_system, Fdetect_coding_region)
7278 (Funencodable_char_position, Fcheck_coding_systems_region)
7279 (get_translation, handle_composition_annotation, consume_chars):
7280 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7281 (consume_chars): Rewrite to not calculate an address outside buffer.
7282 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7283 Don't access memory outside of the args array.
7284 (Fdefine_coding_system_internal): Check for charset-id overflow.
7285 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7286 result of ENCODE_CHAR.
7287 * coding.h: Adjust decls to match defn changes elsewhere.
7288 (struct coding_system):
7289 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7290 * composite.c (get_composition_id, find_composition)
7291 (run_composition_function, update_compositions)
7292 (compose_text, composition_gstring_put_cache)
7293 (composition_gstring_p, composition_gstring_width)
7294 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7295 (composition_compute_stop_pos, composition_reseat_it)
7296 (composition_update_it, struct position_record)
7297 (find_automatic_composition, composition_adjust_point)
7298 (Fcomposition_get_gstring, Ffind_composition_internal):
7299 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7300 (update_compositions):
7301 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7302 * composite.h: Adjust decls to match defn changes elsewhere.
7303 (struct composition):
7304 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7305 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7306 Do not attempt to compute the address of the object just before a
7307 buffer; this is not portable.
7308 (Faref, Faset):
7309 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7310 (Faset): Use int, not EMACS_INT, where int is wide enough.
7311 (Fstring_to_number): Don't assume fixnums fit in int.
7312 (Frem): Don't assume arg is nonnegative.
7313 * dbusbind.c (xd_append_arg): Check for integers out of range.
7314 (Fdbus_call_method): Don't overflow the timeout int.
7315 (extract_signed, extract_unsigned): New functions.
7316 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7317 (xd_get_connection_references): Return ptrdiff_t, not int.
7318 All uses changed.
7319 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7320 (xd_read_message_1):
7321 Use int, not unsigned, where the dbus API uses int.
7322 (Fdbus_message_internal): Don't overflow mtype.
7323 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7324 * dired.c (directory_files_internal, file_name_completion, scmp)
7325 (file_name_completion_stat):
7326 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7327 (file_name_completion): Don't overflow matchcount.
7328 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7329 * dispextern.h: Adjust decls to match defn changes elsewhere.
7330 (struct text_pos, struct glyph, struct bidi_saved_info)
7331 (struct bidi_string_data, struct bidi_it, struct composition_it)
7332 (struct it):
7333 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7334 (struct display_pos, struct composition_it, struct it):
7335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7336 * dispnew.c (increment_matrix_positions)
7337 (increment_row_positions, mode_line_string)
7338 (marginal_area_string):
7339 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7340 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7341 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7342 (duration_to_sec_usec): New function, to check for overflow better.
7343 (Fsleep_for, sit_for): Use it.
7344 * doc.c (get_doc_string, store_function_docstring):
7345 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7346 (get_doc_string, Fsnarf_documentation):
7347 Use int, not EMACS_INT, where int is wide enough.
7348 (get_doc_string):
7349 Use SAFE_ALLOCA, not alloca.
7350 Check for overflow when converting EMACS_INT to off_t.
7351 * doprnt.c (doprnt):
7352 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7353 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7354 Don't assume uid_t fits into fixnum.
7355 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7356 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7357 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7358 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7359 (general_insert_function)
7360 (Finsert_char, make_buffer_string, make_buffer_string_both)
7361 (update_buffer_properties, Fbuffer_substring)
7362 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7363 (Fsubst_char_in_region, check_translation)
7364 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7365 (transpose_markers, Ftranspose_regions):
7366 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7367 (clip_to_bounds): Move to lisp.h as an inline function).
7368 (Fconstrain_to_field): Don't assume integers are nonnegative.
7369 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7370 (Fsubst_char_in_region, Fsave_restriction):
7371 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7372 (Femacs_pid): Don't assume pid_t fits into fixnum.
7373 (lo_time): Use int, not EMACS_INT, when int suffices.
7374 (lisp_time_argument): Check for usec out of range.
7375 (Fencode_time): Don't assume fixnum fits in int.
7376 (Fuser_login_name, Fuser_full_name): Signal an error
7377 if a uid argument is out of range, rather than relying on
7378 undefined behavior.
7379 (Fformat_time_string): Remove now-unnecessary check.
7380 lisp_time_argument checks for out-of-range usec now.
7381 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7382 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7383 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7384 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7385 (init_cmdargs, Fdump_emacs):
7386 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7387 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7388 the bottom (typically) 32 bits of the fixnum.
7389 * eval.c (specpdl_size, call_debugger):
7390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7391 (when_entered_debugger, Fbacktrace_debug):
7392 Don't assume fixnum can fit in int.
7393 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7394 the object just before a buffer; this is not portable.
7395 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7396 (grow_specpdl, unbind_to):
7397 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7398 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7399 (grow_specpdl): Simplify allocation by using xpalloc.
7400 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7401 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7402 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7403 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7404 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7405 (a_write, e_write):
7406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7407 (Fcopy_file, non_regular_nbytes, read_non_regular)
7408 (Finsert_file_contents):
7409 Use int, not EMACS_INT, where int is wide enough.
7410 (READ_BUF_SIZE): Verify that it fits in int.
7411 (Finsert_file_contents): Check that counts are in proper range,
7412 rather than assuming fixnums fit into ptrdiff_t etc.
7413 Don't assume fixnums fit into int.
7414 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7415 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7416 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7417 (string_char_to_byte, string_byte_to_char)
7418 (string_make_multibyte, string_to_multibyte)
7419 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7420 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7421 (substring_both, Fdelete, internal_equal, Ffillarray)
7422 (Fclear_string, mapcar1)
7423 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7424 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7425 (larger_vector, make_hash_table, maybe_resize_hash_table)
7426 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7427 (Fmaphash, secure_hash):
7428 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7429 (concat): Check for string index and length overflow.
7430 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7431 (Frequire):
7432 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7433 (larger_vector): New API (vec, incr_min, size_max) replaces old
7434 one (vec, new_size, init). This catches size overflow.
7435 INIT was removed because it was always Qnil.
7436 All callers changed.
7437 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7438 the upper bound on a hash table index size.
7439 (make_hash_table, maybe_resize_hash_table): Use it.
7440 (secure_hash): Computer start_byte and end_byte only after
7441 they're known to be in ptrdiff_t range.
7442 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7443 (Ffont_get_glyphs, Ffont_at):
7444 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7445 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7446 (Flist_fonts, Fopen_font):
7447 Don't assume fixnum can fit in int.
7448 (check_gstring): Don't assume index can fit in int.
7449 (font_match_p): Check that fixnum is a character, not a nonnegative
7450 fixnum, since the later code needs to stuff it into an int.
7451 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7452 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7453 conversion overflow issues.
7454 (Fopen_font): Check for integer out of range.
7455 (Ffont_get_glyphs): Don't assume index can fit in int.
7456 * font.h: Adjust decls to match defn changes elsewhere.
7457 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7458 integer overflow.
7459 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7460 printmax_t, where ptrdiff_t is wide enough.
7461 (Finternal_char_font):
7462 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7463 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7464 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7465 (Fset_frame_position, x_set_frame_parameters)
7466 (x_set_line_spacing, x_set_border_width)
7467 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7468 Check that fixnums are in proper range for system types.
7469 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7470 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7471 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7472 Use SAFE_ALLOCA_LISP, not alloca.
7473 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7474 intptr_t is wide enough.
7475 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7476 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7477 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7478 Check for fixnum out of range.
7479 * ftfont.c (ftfont_list): Don't assume index fits in int.
7480 Check that fixnums are in proper range for system types.
7481 (ftfont_shape_by_flt):
7482 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7483 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7484 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7485 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7486 Check that fixnums are in proper range for system types.
7487 * gnutls.h: Adjust decls to match defn changes elsewhere.
7488 * gtkutil.c (xg_dialog_run):
7489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7490 (update_frame_tool_bar):
7491 Check that fixnums are in proper range for system types.
7492 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7493 (lookup_image): Check that fixnums are in range for system types.
7494 * indent.c (last_known_column, last_known_column_point):
7495 (current_column_bol_cache):
7496 (skip_invisible, current_column, check_display_width):
7497 (check_display_width, scan_for_column, current_column_1)
7498 (Findent_to, Fcurrent_indentation, position_indentation)
7499 (indented_beyond_p, Fmove_to_column, compute_motion):
7500 (Fcompute_motion, Fvertical_motion):
7501 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7502 (last_known_column_modified): Use EMACS_INT, not int.
7503 (check_display_width):
7504 (Fcompute_motion):
7505 Check that fixnums and floats are in proper range for system types.
7506 (compute_motion): Don't assume index or fixnum fits in int.
7507 (compute_motion, Fcompute_motion):
7508 Use int, not EMACS_INT, when it is wide enough.
7509 (vmotion): Omit local var start_hpos that is always 0; that way
7510 we don't need to worry about overflow in expressions involving it.
7511 * indent.h: Adjust decls to match defn changes elsewhere.
7512 (struct position):
7513 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7514 Use int, not EMACS_INT, where int is wide enough.
7515 Remove unused members ovstring_chars_done and tab_offset;
7516 all uses removed.
7517 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7518 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7519 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7520 (make_gap, copy_text, insert, insert_and_inherit)
7521 (insert_before_markers, insert_before_markers_and_inherit)
7522 (insert_1, count_combining_before, count_combining_after)
7523 (insert_1_both, insert_from_string)
7524 (insert_from_string_before_markers, insert_from_string_1)
7525 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7526 (adjust_after_replace, adjust_after_insert, replace_range)
7527 (replace_range_2, del_range, del_range_1, del_range_byte)
7528 (del_range_both, del_range_2, modify_region)
7529 (prepare_to_modify_buffer, signal_before_change)
7530 (signal_after_change, Fcombine_after_change_execute):
7531 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7532 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7533 (balance_an_interval, split_interval_right, split_interval_left)
7534 (find_interval, next_interval, update_interval)
7535 (adjust_intervals_for_insertion, delete_node, delete_interval)
7536 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7537 (static_offset_intervals, offset_intervals)
7538 (merge_interval_right, merge_interval_left, make_new_interval)
7539 (graft_intervals_into_buffer, temp_set_point_both)
7540 (temp_set_point, set_point, adjust_for_invis_intang)
7541 (set_point_both, move_if_not_intangible, get_property_and_range)
7542 (get_local_map, copy_intervals, copy_intervals_to_string)
7543 (compare_string_intervals, set_intervals_multibyte_1):
7544 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7545 * intervals.h: Adjust decls to match defn changes elsewhere.
7546 (struct interval):
7547 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7548 * keyboard.c (this_command_key_count, this_single_command_key_start)
7549 (before_command_key_count, before_command_echo_length, echo_now)
7550 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7551 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7552 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7553 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7554 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7555 (last_non_minibuf_size, last_point_position, echo_truncate)
7556 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7557 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7558 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7559 (stuff_buffered_input):
7560 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7561 (last_auto_save, command_loop_1, read_char):
7562 Use EMACS_INT, not int, to avoid integer overflow.
7563 (record_char): Avoid overflow in total_keys computation.
7564 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7565 * keyboard.h: Adjust decls to match defn changes elsewhere.
7566 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7567 (Fkey_description, Fdescribe_vector, Flookup_key):
7568 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7569 (click_position): New function, to check that positions are in range.
7570 (Fcurrent_active_maps):
7571 (describe_command):
7572 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7573 (Faccessible_keymaps, Fkey_description):
7574 (preferred_sequence_p):
7575 Don't assume fixnum can fit into int.
7576 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7577 Check for integer overflow in size calculations.
7578 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7579 avoid mishandling large integers.
7580 * lisp.h: Adjust decls to match defn changes elsewhere.
7581 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7582 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7583 (struct Lisp_Marker):
7584 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7585 (clip_to_bounds): Now an inline function, moved here from editfns.c.
7586 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7587 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7588 All callers changed.
7589 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7590 Assume the arg has valid form, since it always does.
7591 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7592 unsigned integer system type.
7593 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7594 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7595 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7596 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7597 (duration_to_sec_usec): New decl.
7598 * lread.c (read_from_string_index, read_from_string_index_byte)
7599 (read_from_string_limit, readchar, unreadchar, openp)
7600 (read_internal_start, read1, oblookup):
7601 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7602 (Fload, readevalloop, Feval_buffer, Feval_region):
7603 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7604 (openp): Check for out-of-range argument to 'access'.
7605 (read1): Use int, not EMACS_INT, where int is wide enough.
7606 Don't assume fixnum fits into int.
7607 Fix off-by-one error that can read outside a buffer.
7608 (read_filtered_event): Use duration_to_sec_usec
7609 to do proper overflow checking on durations.
7610 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7611 in size calculation.
7612 (Fexecute_kbd_macro):
7613 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7614 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7615 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7616 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7617 (set_marker_both, set_marker_restricted_both, marker_position)
7618 (marker_byte_position, Fbuffer_has_markers_at):
7619 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7620 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7621 * menu.c (ensure_menu_items): Rename from grow_menu_items.
7622 It now merely ensures that the menu is large enough, without
7623 necessarily growing it, as this avoids some integer overflow issues.
7624 All callers changed.
7625 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7626 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7627 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7628 Use SAFE_ALLOCA_LISP, not alloca.
7629 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7630 to EMACS_INT. Check that fixnums are in proper range for system types.
7631 * minibuf.c (minibuf_prompt_width, string_to_object)
7632 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7633 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7634 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7635 (get_minibuffer, read_minibuf_unwind):
7636 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7637 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7638 this simplifies overflow checking. All callers changed.
7639 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7640 (Ftest_completion):
7641 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7642 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7643 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7644 Check that fixnums are in proper range for system types.
7645 (Fx_create_frame, Fx_show_tip):
7646 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7647 * nsfont.m (ns_findfonts, nsfont_list_family):
7648 Don't assume fixnum fits in long.
7649 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7650 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7651 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7652 wide enough.
7653 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7654 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7655 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7656 (PRINTDECLARE, PRINTPREPARE):
7657 (strout, print_string):
7658 (print, print_preprocess, print_check_string_charset_prop)
7659 (print_object):
7660 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7661 (PRINTDECLARE):
7662 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7663 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7664 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7665 (printchar, strout): Use xpalloc to catch size calculation overflow.
7666 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7667 (print_error_message): Use SAFE_ALLOCA, not alloca.
7668 (print_object): Use int, not EMACS_INT, where int is wide enough.
7669 (print_depth, new_backquote_output, print_number_index):
7670 Use ptrdiff_t, not int, where int might not be wide enough.
7671 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7672 (Fset_process_window_size, Fformat_network_address)
7673 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7674 (sigchld_handler):
7675 Check that fixnums are in proper range for system types.
7676 (Fsignal_process): Simplify by avoiding a goto.
7677 Check for process-ids out of pid_t range rather than relying on
7678 undefined behavior.
7679 (process_tick, update_tick): Use EMACS_INT, not int.
7680 (Fformat_network_address, read_process_output, send_process)
7681 (Fprocess_send_region, status_notify):
7682 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7683 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7684 (wait_reading_process_output, read_process_output, exec_sentinel):
7685 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7686 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7687 (Faccept_process_output): Use duration_to_sec_usec to do proper
7688 overflow checking on durations.
7689 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7690 Don't assume pid_t fits in int.
7691 * process.h (struct Lisp_Process): Members tick and update_tick
7692 are now of type EMACS_INT, not int.
7693 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7694 configured --with-wide-int.
7695 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7696 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7697 * search.c (looking_at_1, string_match_1):
7698 (fast_string_match, fast_c_string_match_ignore_case)
7699 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7700 (scan_newline, find_before_next_newline, search_command)
7701 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7702 (set_search_regs, wordify):
7703 (Freplace_match):
7704 (Fmatch_data):
7705 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7706 (string_match_1, search_buffer, set_search_regs):
7707 (Fmatch_data):
7708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7709 (wordify): Check for overflow in size calculation.
7710 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7711 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7712 Check that fixnums are in proper range for system types.
7713 * sound.c (struct sound_device)
7714 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7715 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7716 (Fplay_sound_internal):
7717 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7718 * syntax.c (struct lisp_parse_state, find_start_modiff)
7719 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7720 (Fparse_partial_sexp):
7721 Don't assume fixnums can fit in int.
7722 (struct lisp_parse_state, find_start_pos, find_start_value)
7723 (find_start_value_byte, find_start_begv)
7724 (update_syntax_table, char_quoted, dec_bytepos)
7725 (find_defun_start, prev_char_comend_first, back_comment):
7726 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7727 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7728 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7729 (Finternal_describe_syntax_value): Check that match_lisp is a
7730 character, not an integer, since the code stuffs it into int.
7731 (scan_words, scan_sexps_forward):
7732 Check that fixnums are in proper range for system types.
7733 (Fforward_word):
7734 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7735 (scan_sexps_forward):
7736 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7737 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7738 * syntax.h: Adjust decls to match defn changes elsewhere.
7739 (struct gl_state_s):
7740 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7741 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7742 MOST_POSITIVE_FIXNUM.
7743 * sysdep.c (wait_for_termination_1, wait_for_termination)
7744 (interruptible_wait_for_termination, mkdir):
7745 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7746 (emacs_read, emacs_write):
7747 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7748 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7749 and double all fit in int.
7750 * term.c (set_tty_color_mode):
7751 Check that fixnums are in proper range for system types.
7752 * termhooks.h (struct input_event):
7753 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7754 * textprop.c (validate_interval_range, interval_of)
7755 (Fadd_text_properties, set_text_properties_1)
7756 (Fremove_text_properties, Fremove_list_of_text_properties)
7757 (Ftext_property_any, Ftext_property_not_all)
7758 (copy_text_properties, text_property_list, extend_property_ranges)
7759 (verify_interval_modification):
7760 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7761 (Fnext_single_char_property_change)
7762 (Fprevious_single_char_property_change):
7763 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7764 (copy_text_properties):
7765 Check for integer overflow in index calculation.
7766 * undo.c (last_boundary_position, record_point, record_insert)
7767 (record_delete, record_marker_adjustment, record_change)
7768 (record_property_change):
7769 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7770 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7771 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7772 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7773 (Fx_hide_tip, Fx_file_dialog):
7774 * w32menu.c (set_frame_menubar):
7775 Use ptrdiff_t, not int, for consistency with rest of code.
7776 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7777 (select_window, Fdelete_other_windows_internal)
7778 (window_scroll_pixel_based, window_scroll_line_based)
7779 (Frecenter, Fset_window_configuration):
7780 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7781 (Fset_window_hscroll, run_window_configuration_change_hook)
7782 (set_window_buffer, temp_output_buffer_show, scroll_command)
7783 (Fscroll_other_window, Frecenter):
7784 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7785 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7786 Don't assume fixnum fits in int.
7787 (Fset_window_scroll_bars):
7788 Check that fixnums are in proper range for system types.
7789 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7790 (string_pos, c_string_pos, number_of_chars, init_iterator)
7791 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7792 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7793 (compute_display_string_end, handle_face_prop)
7794 (face_before_or_after_it_pos, handle_invisible_prop)
7795 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7796 (display_prop_intangible_p, string_buffer_position_lim)
7797 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7798 (get_overlay_strings_1, get_overlay_strings)
7799 (iterate_out_of_display_property, forward_to_next_line_start)
7800 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7801 (get_next_display_element, set_iterator_to_next)
7802 (get_visually_first_element, compute_stop_pos_backwards)
7803 (handle_stop_backwards, next_element_from_buffer)
7804 (move_it_in_display_line_to, move_it_in_display_line)
7805 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7806 (add_to_log, message_dolog, message_log_check_duplicate)
7807 (message2, message2_nolog, message3, message3_nolog
7808 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7809 (current_message_1, truncate_echo_area, truncate_message_1)
7810 (set_message, set_message_1, store_mode_line_noprop)
7811 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7812 (text_outside_line_unchanged_p, check_point_in_composition)
7813 (reconsider_clip_changes)
7814 (redisplay_internal, set_cursor_from_row, try_scrolling)
7815 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7816 (redisplay_window, find_last_unchanged_at_beg_row)
7817 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7818 (trailing_whitespace_p, find_row_edges, display_line)
7819 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7820 (display_mode_element, store_mode_line_string)
7821 (pint2str, pint2hrstr, decode_mode_spec)
7822 (display_count_lines, display_string, draw_glyphs)
7823 (x_produce_glyphs, x_insert_glyphs)
7824 (rows_from_pos_range, mouse_face_from_buffer_pos)
7825 (fast_find_string_pos, mouse_face_from_string_pos)
7826 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7827 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7828 (safe_call, init_from_display_pos, handle_fontified_prop)
7829 (handle_single_display_spec, load_overlay_strings)
7830 (with_echo_area_buffer, setup_echo_area_for_printing)
7831 (display_echo_area, echo_area_display)
7832 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7833 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7834 (redisplay_window, dump_glyph_row, display_mode_line)
7835 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7836 (handle_display_spec, display_prop_string_p):
7837 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7838 (handle_single_display_spec, build_desired_tool_bar_string)
7839 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7840 (get_specified_cursor_type):
7841 Check that fixnums are in proper range for system types.
7842 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7843 (Flookup_image_map):
7844 Don't assume fixnums fit in int.
7845 (compare_overlay_entries):
7846 Avoid mishandling comparisons due to subtraction overflow.
7847 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7848 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7849 (handle_tool_bar_click):
7850 Use int, not unsigned, since we prefer signed and the signedness
7851 doesn't matter here.
7852 (get_next_display_element, next_element_from_display_vector):
7853 Use int, not EMACS_INT, when int is wide enough.
7854 (start_hourglass): Use duration_to_sec_usec to do proper
7855 overflow checking on durations.
7856 * xfaces.c (Fbitmap_spec_p):
7857 Check that fixnums are in proper range for system types.
7858 (compare_fonts_by_sort_order):
7859 Avoid mishandling comparisons due to subtraction overflow.
7860 (Fx_family_fonts, realize_basic_faces):
7861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7862 (Fx_family_fonts):
7863 Don't assume fixnum fits in int.
7864 Use SAFE_ALLOCA_LISP, not alloca.
7865 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7866 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7867 (face_at_buffer_position, face_for_overlay_string)
7868 (face_at_string_position):
7869 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7870 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7871 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7872 (Fx_show_tip):
7873 Check that fixnums are in proper range for system types.
7874 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7875 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7876 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7877 (Fx_change_window_property): Don't assume fixnums fit in int.
7878 * xfont.c (xfont_chars_supported):
7879 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7880 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7881 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7882 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7883 * xml.c (parse_region):
7884 * xrdb.c (magic_file_p):
7885 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7886 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7887 (x_get_local_selection, x_reply_selection_request)
7888 (x_handle_selection_request, wait_for_property_change):
7889 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7890 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7891 short is wide enough.
7892 (x_send_client_event): Don't assume fixnum fits in int.
7893 * xterm.c (x_x_to_emacs_modifiers):
7894 Don't assume EMACS_INT overflows nicely into int.
7895 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7896 may come from Lisp.
7897 (handle_one_xevent): NATNUMP can eval its arg twice.
7898 (x_connection_closed):
7899 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7900 * xterm.h: Adjust decls to match defn changes elsewhere.
7901 (struct scroll_bar): Use struct vectorlike_header
7902 rather than rolling our own approximation.
7903 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7904
7905 2012-05-25 Glenn Morris <rgm@gnu.org>
7906
7907 * lisp.mk (lisp): Update for more files being compiled now.
7908
7909 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7910
7911 * lread.c: Remove `read_pure' which makes no difference.
7912 (read_pure): Remove var.
7913 (unreadpure): Remove function.
7914 (readevalloop): Don't call read_list with -1 flag.
7915 (read1, read_vector): Don't test read_pure any more.
7916 (read_list): Simplify.
7917
7918 * fileio.c, character.h: Minor style tweaks.
7919
7920 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7921
7922 * window.h (clip_changed): Remove useless declaration.
7923
7924 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7925
7926 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7927 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7928
7929 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7930
7931 Remove src/m/*.
7932 This directory predates autoconf and is no longer needed nowadays.
7933 Move its few remaining bits of functionality to where they're needed.
7934 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7935 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7936 * m/template.h: Remove.
7937 * Makefile.in (M_FILE): Remove. All uses removed.
7938 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7939 * lisp.h (USE_LSB_TAG):
7940 * mem-limits.h (EXCEEDS_LISP_PTR):
7941 Use VAL_MAX, not VALBITS, in #if.
7942 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7943 (EMACS_UINT): Define unconditionally now.
7944 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7945 (BITS_PER_EMACS_INT): New constants, replacing
7946 what used to be in config.h, but not useful in #if.
7947 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7948 define them any more.
7949 (VAL_MAX): New macro.
7950 (VALMASK): Use it.
7951 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7952 BITS_PER_EMACS_INT, in #if.
7953 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7954 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7955 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7956 * s/ms-w32.h (DATA_START):
7957 Move here from removed file m/intel386.h.
7958 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7959 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7960
7961 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7962
7963 Assume C89 or later.
7964 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7965 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7966 (xrealloc):
7967 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7968 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7969 * textprop.c, tparam.c (NULL): Remove.
7970 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7971 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7972 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7973 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7974 * xterm.c (input_signal_count): Assume volatile works.
7975
7976 2012-05-21 Ken Brown <kbrown@cornell.edu>
7977
7978 * xgselect.c (xg_select): Fix first argument in call to 'select'
7979 (bug#11508).
7980
7981 2012-05-20 Ken Brown <kbrown@cornell.edu>
7982
7983 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7984 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7985
7986 2012-05-19 Ken Brown <kbrown@cornell.edu>
7987
7988 * xfns.c (x_in_use): Remove `static' qualifier.
7989 * xterm.h (x_in_use): Declare.
7990 * xgselect.c: Include xterm.h.
7991 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7992 and `display_arg' (bug#9754).
7993
7994 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7995
7996 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7997
7998 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7999 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8000
8001 2012-05-18 Eli Zaretskii <eliz@gnu.org>
8002
8003 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8004
8005 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8006 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8007
8008 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8009 reference to image_cache->refcount.
8010 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8011
8012 2012-05-17 Juri Linkov <juri@jurta.org>
8013
8014 * search.c (Fword_search_regexp, Fword_search_backward)
8015 (Fword_search_forward, Fword_search_backward_lax)
8016 (Fword_search_forward_lax): Move functions to isearch.el
8017 (bug#10145, bug#11381).
8018
8019 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8020
8021 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8022
8023 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8024
8025 * lread.c (init_obarray): Declare Qt and Qnil as special.
8026
8027 2012-05-14 Glenn Morris <rgm@gnu.org>
8028
8029 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8030 Put "libexec" before "bin", for the sake of init_callproc_1.
8031
8032 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8033
8034 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8035
8036 * unexaix.c: Port to more-recent AIX compilers.
8037 (report_error, report_error_1, make_hdr, copy_sym)
8038 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8039 Make arguments const char *, not char *, to avoid violations of C
8040 standard and to fix some AIX warnings reported by Gilles Pion.
8041
8042 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8043
8044 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8045 already have overlays loaded.
8046 (handle_single_display_spec): Before returning without displaying
8047 fringe bitmap, synchronize the bidi iterator with the main display
8048 iterator, by calling iterate_out_of_display_property.
8049 (iterate_out_of_display_property): Detect buffer iteration by
8050 testing that it->string is a Lisp string.
8051 (get_next_display_element): When the current object is exhausted,
8052 and there's something on it->stack, call set_iterator_to_next to
8053 proceed with what's on the stack, instead of returning zero.
8054 (set_iterator_to_next): If called at the end of a Lisp string,
8055 proceed to consider_string_end without incrementing string
8056 position. Don't increment display vector index past the end of
8057 the display vector. (Bug#11417)
8058 (pos_visible_p): Don't report a position visible when move_it_to
8059 stopped at the last line of window, which happens to be scanned
8060 backwards by the bidi iteration. (Bug#11464)
8061
8062 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8063
8064 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8065 and right-margin display specs even if the spec is invalid or we
8066 are on a TTY, and thus unable to display on the fringes.
8067 That's because the text with the property will not be displayed anyway,
8068 so we need to signal to the caller that this is a "replacing"
8069 display spec. This fixes display when the spec is invalid or we
8070 are on a TTY.
8071
8072 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8073
8074 * unexaix.c (make_hdr): Fix typo in prototype.
8075 This bug broke the build on AIX. Problem reported by Gilles Pion.
8076
8077 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
8078
8079 * keyboard.c (kbd_buffer_get_event): Read special events also in
8080 batch mode. (Bug#11415)
8081
8082 2012-05-12 Glenn Morris <rgm@gnu.org>
8083
8084 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8085
8086 2012-05-12 Eli Zaretskii <eliz@gnu.org>
8087
8088 * lisp.mk (lisp): Add newcomment.elc.
8089
8090 2012-05-12 Glenn Morris <rgm@gnu.org>
8091
8092 * Makefile.in (MKDIR_P): New, set by configure.
8093 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8094
8095 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8096
8097 Remove unused function hourglass_started.
8098 * dispextern.h (hourglass_started):
8099 * w32fns.c (hourglass_started):
8100 * xdisp.c (hourglass_started): Remove.
8101
8102 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
8103
8104 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8105 Update dependencies.
8106
8107 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8108
8109 * xgselect.c (xg_select): Put maxfds+1 into a var.
8110 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8111
8112 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8113
8114 2012-05-10 Dave Abrahams <dave@boostpro.com>
8115
8116 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8117 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8118
8119 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
8120
8121 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8122 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8123 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8124 Initialize xd_registered_buses.
8125
8126 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8127
8128 Untag more efficiently if USE_LSB_TAG.
8129 This is based on a proposal by YAMAMOTO Mitsuharu in
8130 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8131 For an admittedly artificial (nth 8000 longlist) benchmark on
8132 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8133 Emacs's overall text size by 1%.
8134 * lisp.h (XUNTAG): New macro.
8135 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8136 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8137 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8138 * eval.c (Fautoload):
8139 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8140 * frame.h (XFRAME): Use XUNTAG.
8141
8142 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8143 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8144 Remove unportable assumptions about print widths of types like
8145 dbus_uint32_t.
8146 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8147 intptr_t when converting between pointer and integer, to avoid GCC
8148 warnings about wrong width.
8149
8150 2012-05-09 Eli Zaretskii <eliz@gnu.org>
8151
8152 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8153 stack for each reader_thread, instead of defaulting to 8MB
8154 determined by the linker. This avoids failures in creating
8155 subprocesses on Windows 7, see the discussion in this thread:
8156 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8157
8158 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8159
8160 Fix up display of the *Minibuf-0* buffer in the mini window.
8161 * keyboard.c (read_char): Don't clear the echo area if there's no
8162 message to clear.
8163 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8164 contents of *Minibuf-0*) if there's no message displayed in its stead.
8165
8166 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
8167
8168 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8169 batch mode.
8170
8171 2012-05-06 Chong Yidong <cyd@gnu.org>
8172
8173 * lisp.mk (lisp): Update.
8174
8175 2012-05-05 Jim Meyering <meyering@redhat.com>
8176
8177 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8178
8179 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8180
8181 * data.c (PUT_ERROR): New macro.
8182 (syms_of_data): Use it. Add new error type `user-error'.
8183 * undo.c (user_error): New function.
8184 (Fprimitive_undo): Use it.
8185 * print.c (print_error_message): Adjust print style for `user-error'.
8186 * keyboard.c (user_error): New function.
8187 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8188
8189 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8190
8191 Do not limit current-time-string to years 1000..9999.
8192 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8193 (Fcurrent_time_string): Support any year that is supported by the
8194 underlying localtime representation. Don't use asctime, as it
8195 has undefined behavior for years outside the range -999..9999.
8196
8197 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8198
8199 Fix race conditions involving setenv, gmtime, localtime, asctime.
8200 Without this fix, interrupts could mess up code that uses these
8201 nonreentrant functions, since setting TZ invalidates existing
8202 tm_zone or tzname values, and since most of these functions return
8203 pointers to static storage.
8204 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8205 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8206 Grow the critical sections to include not just invoking
8207 localtime/gmtime, but also accessing these functions' results
8208 including their tm_zone values if any, and any related TZ setting.
8209 (format_time_string): Last arg is now struct tm *, not struct tm **,
8210 so that the struct tm is saved in the critical section.
8211 All callers changed. Simplify allocation of initial buffer, partly
8212 motivated by the fact that memory allocation needs to be outside
8213 the critical section.
8214
8215 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8216
8217 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8218 with RESET_INTERVAL.
8219
8220 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8221 Remove duplicated buffer name initialization.
8222
8223 2012-05-02 Jim Meyering <jim@meyering.net>
8224
8225 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8226
8227 * xfns.c (x_window): Use xstrdup (Bug#11375).
8228
8229 2012-05-02 Eli Zaretskii <eliz@gnu.org>
8230
8231 * xdisp.c (pos_visible_p): If already at a newline from the
8232 display string before the 'while' loop, don't walk back the glyphs
8233 from it3.glyph_row. Solves assertion violation when the display
8234 string begins with a newline (egg.el). (Bug#11367)
8235
8236 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8237
8238 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8239 Move to simple.el.
8240
8241 2012-05-01 Glenn Morris <rgm@gnu.org>
8242
8243 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8244 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8245 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8246 All were removed before 23.1.
8247
8248 * dispnew.c: Remove HAVE_LIBNCURSES test;
8249 it is always true on relevant platforms.
8250
8251 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8252 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8253
8254 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8255
8256 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8257
8258 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8259 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8260 Remove.
8261
8262 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8263
8264 Do not avoid creating empty evaporating overlays (Bug#9642).
8265 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8266 That is, do not delete an evaporating overlay if it becomes
8267 empty after its bounds are adjusted to fit within its buffer.
8268 This fix caused other problems, and I'm reverting it until we get
8269 to the bottom of them.
8270
8271 2012-04-27 Chong Yidong <cyd@gnu.org>
8272
8273 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8274
8275 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8276
8277 * xdisp.c (pos_visible_p): If the window start position is beyond
8278 ZV, start the display from buffer beginning. Prevents assertion
8279 violation in init_iterator when the minibuffer window is scrolled
8280 via the scroll bar.
8281
8282 * window.c (window_scroll_pixel_based): Likewise.
8283
8284 2012-04-27 Chong Yidong <cyd@gnu.org>
8285
8286 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8287
8288 2012-04-27 Glenn Morris <rgm@gnu.org>
8289
8290 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8291 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8292
8293 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8294
8295 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8296 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
8297
8298 2012-04-26 Eli Zaretskii <eliz@gnu.org>
8299
8300 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8301 display element, check also the underlying string or buffer
8302 character. (Bug#11341)
8303
8304 * w32menu.c: Include w32heap.h.
8305 (add_menu_item): If the call to AppendMenuW (via
8306 unicode_append_menu) fails, disable Unicode menus only if we are
8307 running on Windows 9X/Me.
8308
8309 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8310
8311 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8312 (xgetint): Add missing shift for LSB tags.
8313
8314 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8315
8316 * keyboard.c (read_char): Don't wipe echo area for select window
8317 events: These might get delayed via `mouse-autoselect-window'
8318 (Bug#11304).
8319
8320 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8321
8322 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8323 manipulation of :loaded-from data.
8324
8325 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8326
8327 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8328 now a cons (bug#11311).
8329
8330 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8331
8332 Do not create empty overlays with the evaporate property (Bug#9642).
8333 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8334 if it becomes empty after its bounds are adjusted to fit within
8335 its buffer. Without this fix, in a nonempty buffer (let ((o
8336 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8337 yields an empty overlay that has the evaporate property, which is
8338 not supposed to happen.
8339
8340 Fix minor GTK3 problems found by static checking.
8341 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8342 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8343 (struct _EmacsFixedClass, emacs_fixed_get_type):
8344 Move decls here from emacsgtkfixed.h, since they needn't be public.
8345 (emacs_fixed_get_type): Now static.
8346 (emacs_fixed_class_init): Omit unused local.
8347 (emacs_fixed_child_type): Remove; unused.
8348 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8349 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8350 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8351 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8352 (EMACS_FIXED_GET_CLASS): Remove; unused.
8353 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8354
8355 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8356 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8357
8358 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8359
8360 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8361 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8362 (__malloc_size_t, __malloc_ptrdiff_t):
8363 Remove. All uses removed, replaced by the definiens if needed,
8364 since we can assume C89 or better now.
8365 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8366 (protect_malloc_state, align, get_contiguous_space)
8367 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8368 (malloc_atfork_handler_child, malloc_enable_thread)
8369 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8370 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8371 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8372 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8373 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8374 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8375 Define using prototypes, not old style.
8376 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8377 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8378 (align): Don't assume that signed integer overflow wraps around.
8379 Omit unused local var.
8380 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8381 (_free_internal_nolock, memalign, mallochook, reallochook):
8382 Omit no-longer-needed casts.
8383 (valloc): Use getpagesize, not __getpagesize.
8384 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8385 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8386
8387 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8388
8389 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
8390
8391 Move functions from C to Lisp. Make non-blocking method calls
8392 the default. Implement further D-Bus standard interfaces.
8393
8394 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8395 (QCdbus_request_name_allow_replacement)
8396 (QCdbus_request_name_replace_existing)
8397 (QCdbus_request_name_do_not_queue)
8398 (QCdbus_request_name_reply_primary_owner)
8399 (QCdbus_request_name_reply_in_queue)
8400 (QCdbus_request_name_reply_exists)
8401 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8402 (QCdbus_registered_serial, QCdbus_registered_method)
8403 (QCdbus_registered_signal): New Lisp objects.
8404 (XD_DEBUG_MESSAGE): Use sizeof.
8405 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8406 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8407 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8408 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8409 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8410 (xd_signature, xd_append_arg): Allow float for integer types.
8411 (xd_get_connection_references): New function.
8412 (xd_get_connection_address): Rename from xd_initialize.
8413 Return cached address.
8414 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8415 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8416 level.
8417 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8418 Return number of refcounts.
8419 (Fdbus_get_unique_name): Make stronger parameter check.
8420 (Fdbus_message_internal): New defun.
8421 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8422 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8423 (Fdbus_send_signal, Fdbus_register_service)
8424 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8425 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8426 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8427 (Vdbus_compiled_version, Vdbus_runtime_version)
8428 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8429 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8430 (Vdbus_message_type_signal): New defvars.
8431 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8432 Adapt docstring.
8433
8434 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8435
8436 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8437 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8438 Do not assume ptrdiff_t is the same width as 'int'.
8439
8440 * alloc.c: Handle unusual debugging option combinations.
8441 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8442 since the two debugging options are incompatible.
8443 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8444 is defined.
8445 (mem_init, mem_insert, mem_insert_fixup):
8446 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8447 (NEED_MEM_INSERT): Remove; no longer needed.
8448
8449 2012-04-22 Leo Liu <sdl.web@gmail.com>
8450
8451 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8452
8453 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8454
8455 * sysdep.c [__FreeBSD__]: Minor cleanups.
8456 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8457 Use Emacs indenting style more consistently. Avoid some casts.
8458 Use 'double' consistently rather than mixing 'float' and 'double'.
8459
8460 2012-04-21 Eduard Wiebe <usenet@pusto.de>
8461
8462 * sysdep.c (list_system_processes, system_process_attributes):
8463 Add implementation for FreeBSD (Bug#5243).
8464
8465 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8466
8467 * lisp.mk (lisp): Update.
8468
8469 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8470
8471 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8472 It is never used otherwise.
8473
8474 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8475
8476 * print.c (print_preprocess): Only check print_depth if print-circle
8477 is nil.
8478 (print_object): Check for cycles even when print-circle is nil and
8479 print-gensym is t, but only check print_depth if print-circle is nil.
8480
8481 2012-04-20 Chong Yidong <cyd@gnu.org>
8482
8483 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8484 set the status to "failed" and ensure that sentinel is run.
8485
8486 2012-04-20 Glenn Morris <rgm@gnu.org>
8487
8488 * process.c (Fset_process_inherit_coding_system_flag)
8489 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8490 (Fmake_network_process, Fmake_serial_process): Doc fix.
8491
8492 2012-04-20 Eli Zaretskii <eliz@gnu.org>
8493
8494 * xdisp.c (string_buffer_position_lim): Limit starting position to
8495 BEGV.
8496 (set_cursor_from_row): If called for a mode-line or header-line
8497 row, return zero immediately.
8498 (try_cursor_movement): If inside continuation line, don't back up
8499 farther than the first row after the header line, if any.
8500 Don't consider the header-line row as "partially visible", even if
8501 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8502
8503 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8504
8505 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8506 (bug#11238).
8507
8508 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
8509 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
8510
8511 configure: new option --enable-gcc-warnings (Bug#11207)
8512 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8513 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8514 (ALL_CFLAGS): Use new macros rather than old.
8515 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8516 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8517 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8518 -Wunused-result, -Wunused-variable. This should go away once
8519 the Emacs and Gnulib regex code is merged.
8520 (xmalloc, xrealloc): Now static.
8521
8522 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8523
8524 * dired.c (Fsystem_groups): Remove unused local.
8525
8526 2012-04-17 Glenn Morris <rgm@gnu.org>
8527
8528 * dired.c (Fsystem_users): Doc fix.
8529
8530 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8531
8532 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8533 (syms_of_dired): Add them.
8534
8535 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8536
8537 Fix minor alloc.c problems found by static checking.
8538 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8539 New extern decls, to avoid calling undeclared functions.
8540 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8541 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8542 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8543 (NEED_MEM_INSERT): New macro.
8544 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8545 Remove one incorrect comment and fix another.
8546
8547 Fix minor ralloc.c problems found by static checking.
8548 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8549 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8550 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8551 (r_alloc_sbrk): Now static.
8552
8553 Improve ralloc.c interface checking.
8554 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8555 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8556 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8557 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8558 [REL_ALLOC]: ... to here, to check interface.
8559 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8560 Remove decls. This fixes an "It stinks!".
8561
8562 * alloc.c (which_symbols): Fix alignment issue / type clash.
8563
8564 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8565
8566 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8567 (struct Lisp_Misc_Any): Likewise.
8568 (struct Lisp_Free): Likewise.
8569 * alloc.c (union aligned_Lisp_Symbol): Define.
8570 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8571 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8572 (union aligned_Lisp_Misc): Define.
8573 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8574 aligned_Lisp_Misc instead of union Lisp_Misc.
8575 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8576
8577 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8578
8579 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8580 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8581 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8582 * s/netbsd.h, s/sol2-6.h:
8583 Remove definition of GC_MARK_STACK, since the default now works.
8584 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8585 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8586 no longer the default.
8587 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8588
8589 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8590
8591 * lread.c (lisp_file_lexically_bound_p):
8592 Fix hang at ";-*-\n" (bug#11238).
8593
8594 2012-04-14 Eli Zaretskii <eliz@gnu.org>
8595
8596 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8597 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8598
8599 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8600
8601 * nsterm.m (constrainFrameRect): Always constrain when there is only
8602 one screen (Bug#10962).
8603
8604 2012-04-13 Ken Brown <kbrown@cornell.edu>
8605
8606 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8607
8608 2012-04-13 Reuben Thomas <rrt@sc3d.org>
8609
8610 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8611
8612 2012-04-11 Daniel Colascione <dancol@dancol.org>
8613
8614 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8615 against is gone. It's better to use vfork now so that when Cygwin
8616 gains a new, working vfork, we use it automatically (bug#10398).
8617
8618 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8619
8620 * window.c (save_window_save): Obey window-point-insertion-type.
8621
8622 2012-04-11 Glenn Morris <rgm@gnu.org>
8623
8624 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8625
8626 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8627
8628 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8629
8630 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
8631
8632 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8633 (force_quit_count): New var.
8634 (handle_interrupt): Use it.
8635
8636 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
8637
8638 * w32.c (w32_delayed_load): Record the full path of the library
8639 being loaded (bug#10424).
8640
8641 2012-04-09 Glenn Morris <rgm@gnu.org>
8642
8643 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8644 not just in the obarray, before snarfing them. (Bug#11036)
8645
8646 * Makefile.in ($(leimdir)/leim-list.el):
8647 Pass EMACS rather than BUILT_EMACS.
8648
8649 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8650
8651 * process.c (make_process):
8652 * process.h: Add integer `gnutls_handshakes_tried' member to
8653 process struct.
8654
8655 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8656 Add convenience `GNUTLS_LOG2i' macro.
8657
8658 * gnutls.c (gnutls_log_function2i): Convenience log function.
8659 (emacs_gnutls_read): Use new log functions,
8660 `gnutls_handshakes_tried' process member, and
8661 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8662 attempts per process (connection).
8663
8664 2012-04-09 Chong Yidong <cyd@gnu.org>
8665
8666 * eval.c (Fuser_variable_p, user_variable_p_eh)
8667 (lisp_indirect_variable): Functions deleted.
8668 (Fdefvar): Caller changed.
8669
8670 * callint.c (Finteractive, Fcall_interactively):
8671 * minibuf.c (Fread_variable): Callers changed.
8672
8673 2012-04-09 Eli Zaretskii <eliz@gnu.org>
8674
8675 * xdisp.c (set_cursor_from_row): If the display string appears in
8676 the buffer at position that is closer to point than the position
8677 after the display string, display the cursor on the first glyph of
8678 the display string. Fixes cursor display when a 'display' text
8679 property immediately follows invisible text. (Bug#11094)
8680
8681 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8682
8683 composite.c: use 'double' consistently
8684 * composite.c (get_composition_id): Use 'double' consistently
8685 instead of converting 'float' to 'double' and vice versa; this is
8686 easier to understand and avoids a GCC warning.
8687
8688 2012-04-09 Glenn Morris <rgm@gnu.org>
8689
8690 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8691 preparation for dumping it with emacs. (Bug#4789)
8692 (leimdir): New variable.
8693 ($(leimdir)/leim-list.el): New rule.
8694 (emacs$(EXEEXT)): Depend on leim-list.el.
8695
8696 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8697 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8698 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8699
8700 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8701
8702 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8703 proper alignment.
8704
8705 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
8706
8707 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8708 Remove unused local variable.
8709
8710 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8711
8712 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8713 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8714 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8715 objects, as mark_maybe_pointer will catch them otherwise.
8716 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8717 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8718
8719 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8720
8721 Fix typo that broke non-Windows builds.
8722 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8723
8724 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8725
8726 Support building on MS-Windows with libxml2.
8727
8728 * makefile.w32-in (OBJ2): Add xml.$(O).
8729 (GLOBAL_SOURCES): Add xml.c.
8730 ($(BLD)/xml.$(O)): New dependency list.
8731
8732 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8733 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8734 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8735 [!WINDOWSNT]: New macros.
8736 (init_libxml2_functions, libxml2_loaded_p): New functions.
8737 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8738 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8739 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8740 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8741 linked in).
8742 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8743 Call init_libxml2_functions before calling libxml2 functions.
8744 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8745
8746 * emacs.c: Don't include libxml/parser.h.
8747 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8748 xmlCleanupParser directly.
8749
8750 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8751
8752 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8753
8754 * indent.c (Fvertical_motion): If there is a display string at
8755 point, use it.vpos to compute how many lines to backtrack after
8756 move_it_to point. (Bug#11133)
8757
8758 2012-04-06 Eli Zaretskii <eliz@gnu.org>
8759
8760 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8761 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8762 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8763 macros related to unification of CJK characters. For the details,
8764 see the discussion following the message here:
8765 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8766
8767 2012-04-04 Chong Yidong <cyd@gnu.org>
8768
8769 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8770
8771 2012-04-01 Eli Zaretskii <eliz@gnu.org>
8772
8773 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8774 instead of alloca. (Bug#11138)
8775
8776 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8777
8778 * w32menu.c (is_simple_dialog): Properly check lisp types.
8779 (Bug#11141)
8780
8781 2012-03-31 Eli Zaretskii <eliz@gnu.org>
8782
8783 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8784 position we get to after a call to move_it_to fails the
8785 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8786 only if we wind up in a string from display property. (Bug#11063)
8787
8788 * window.c (Fdelete_other_windows_internal): Invalidate the row
8789 and column information about mouse highlight, so that redisplay
8790 restores it after reallocating the glyph matrices. (Bug#7464)
8791
8792 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8793 string comes from a `display' text property, use the buffer
8794 position of that property as if we actually saw that position in
8795 the row's glyphs.
8796 (move_it_by_lines): Remove the assertion that
8797 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8798 violated when there's a before-string at the beginning of a line.
8799 (Bug#11063)
8800
8801 2012-03-30 Eli Zaretskii <eliz@gnu.org>
8802
8803 * xdisp.c (append_space_for_newline): If the default face was
8804 remapped, use the remapped face for the appended newline.
8805 (extend_face_to_end_of_line): Use the remapped default face for
8806 extending the face to the end of the line.
8807 (display_line): Call extend_face_to_end_of_line when the default
8808 face was remapped. (Bug#11068)
8809
8810 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8811
8812 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8813
8814 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8815
8816 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8817
8818 2012-03-27 Glenn Morris <rgm@gnu.org>
8819
8820 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8821 Doc fixes.
8822
8823 2012-03-26 Kenichi Handa <handa@m17n.org>
8824
8825 * dispextern.h (struct glyph): Fix previous change. Change the
8826 bit length of glyphless.ch to 25 (Bug#11082).
8827
8828 2012-03-26 Chong Yidong <cyd@gnu.org>
8829
8830 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8831 (command_loop_1): Use it; inhibit selection update for
8832 handle-select-window too (Bug#8996).
8833
8834 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8835
8836 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8837
8838 2012-03-25 Kenichi Handa <handa@m17n.org>
8839
8840 * dispextern.h (struct glyph): Change the bit length of
8841 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8842
8843 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8844
8845 * s/ms-w32.h (tzname): Include time.h before redirecting to
8846 _tzname. Fixes the MSVC build. (Bug#9960)
8847
8848 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8849
8850 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8851 characters.
8852
8853 * xterm.c (XTread_socket): Only modify handling_signal if
8854 !SYNC_INPUT. (Bug#11080)
8855
8856 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8857
8858 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8859 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8860 when fetching a multibyte character consumes more bytes than
8861 CHAR_BYTES returns, due to unification of CJK characters in
8862 string_char. (Bug#11073)
8863
8864 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8865
8866 * process.c (wait_reading_process_output): Handle pty disconnect
8867 by refraining from sending oneself a SIGCHLD (bug#10933).
8868
8869 2012-03-22 Chong Yidong <cyd@gnu.org>
8870
8871 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8872
8873 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8874 Mark string as coming from a prefix property.
8875 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8876 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8877
8878 2012-03-21 Chong Yidong <cyd@gnu.org>
8879
8880 * xfaces.c (Vface_remapping_alist): Doc fix.
8881
8882 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8883
8884 * w32proc.c (Fw32_set_console_codepage)
8885 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8886 Doc fixes.
8887
8888 2012-03-20 Chong Yidong <cyd@gnu.org>
8889
8890 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8891 to reflect default non-nil value of redisplay-dont-pause.
8892
8893 2012-03-19 Kenichi Handa <handa@m17n.org>
8894
8895 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8896 it fit in a valid range (Bug#11003).
8897
8898 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8899
8900 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8901 that is not from display property, accept the row as a "cursor
8902 row" if one of the string's character has a non-nil `cursor'
8903 property. Fixes cursor positioning when there are newlines in
8904 overlay strings, e.g. in icomplete.el. (Bug#11035)
8905
8906 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8907
8908 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8909
8910 2012-03-12 Chong Yidong <cyd@gnu.org>
8911
8912 * eval.c (inhibit_lisp_code): Rename from
8913 inhibit_window_configuration_change_hook; move from window.c.
8914
8915 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8916 * window.c (run_window_configuration_change_hook)
8917 (syms_of_window): Callers changed.
8918
8919 2012-03-11 Chong Yidong <cyd@gnu.org>
8920
8921 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8922
8923 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8924
8925 2012-03-10 Chong Yidong <cyd@gnu.org>
8926
8927 * frame.c (other_visible_frames): Don't assume the selected frame
8928 is visible (Bug#10955).
8929
8930 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8931
8932 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8933
8934 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8935
8936 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8937 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8938 zero (Bug#10954).
8939
8940 2012-03-03 Glenn Morris <rgm@gnu.org>
8941
8942 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8943
8944 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8945
8946 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8947 position past the first glyph_row that ends at ZV. (Bug#10902)
8948 (redisplay_window, next_element_from_string): Fix typos in
8949 comments.
8950 (redisplay_window): Pass to move_it_vertically the margin in
8951 pixels, not in screen lines.
8952
8953 2012-03-02 Glenn Morris <rgm@gnu.org>
8954
8955 * buffer.c (buffer-list-update-hook): Doc fix.
8956
8957 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8958
8959 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8960 push_it before setting up the iterator for the first overlay
8961 string, even if we have an empty string loaded.
8962 (next_overlay_string): If there's an empty string on the iterator
8963 stack, pop the stack. (Bug#10903)
8964
8965 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8966
8967 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8968 Suggested by Stefan Monnier in
8969 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8970 * alloc.c (widen_to_Lisp_Object): New static function.
8971 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8972 and widening them to Lisp_Objects. This would work even if
8973 USE_LSB_TAG is defined and wide integers are used, which might
8974 happen in a future version of Emacs.
8975
8976 2012-02-25 Chong Yidong <cyd@gnu.org>
8977
8978 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8979 Doc fix.
8980
8981 * xselect.c (Fx_selection_exists_p): Doc fix.
8982 (x_clipboard_manager_save_all): Print an informative message
8983 before saving to clipboard manager.
8984
8985 2012-02-24 Chong Yidong <cyd@gnu.org>
8986
8987 * keyboard.c (process_special_events): Handle all X selection
8988 requests in kbd_buffer, not just the next one (Bug#8869).
8989
8990 2012-02-23 Chong Yidong <cyd@gnu.org>
8991
8992 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8993 call when setting menu-bar-lines and tool-bar-lines parameters.
8994 (unwind_create_frame_1): New helper function.
8995
8996 * window.c (inhibit_window_configuration_change_hook): New var.
8997 (run_window_configuration_change_hook): Obey it.
8998 (syms_of_window): Initialize it.
8999
9000 2012-02-22 Chong Yidong <cyd@gnu.org>
9001
9002 * xterm.c (x_draw_image_relief): Add missing type check for
9003 Vtool_bar_button_margin (Bug#10743).
9004
9005 2012-02-21 Chong Yidong <cyd@gnu.org>
9006
9007 * fileio.c (Vfile_name_handler_alist): Doc fix.
9008
9009 * buffer.c (Fget_file_buffer): Protect against invalid file
9010 handler return value.
9011
9012 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9013
9014 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9015 when computing $valmask.
9016
9017 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9018 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9019 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9020 It's useless in that case, and it can cause problems on hosts
9021 that allocate halves of EMACS_INT values separately.
9022 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9023 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9024 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9025 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9026 it avoids undefined behavior on hosts where shifting right by more
9027 than the word width has undefined behavior.
9028
9029 2012-02-19 Chong Yidong <cyd@gnu.org>
9030
9031 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9032 (Funhandled_file_name_directory, Ffile_name_as_directory)
9033 (Fdirectory_file_name, Fexpand_file_name)
9034 (Fsubstitute_in_file_name): Protect against invalid file handler
9035 return values (Bug#10845).
9036
9037 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9038
9039 * .gdbinit (pitx): Fix incorrect references to fields of the
9040 iterator stack.
9041
9042 2012-02-17 Chong Yidong <cyd@gnu.org>
9043
9044 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9045
9046 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9047
9048 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9049 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9050
9051 2012-02-15 Chong Yidong <cyd@gnu.org>
9052
9053 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9054 marked as special. Also, starting docstrings with * is obsolete.
9055
9056 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9057
9058 * gnutls.c (emacs_gnutls_write): Fix last change.
9059
9060 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9061
9062 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9063 send_process.
9064
9065 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9066
9067 * keymap.c (Fsingle_key_description): Handle char ranges.
9068
9069 2012-02-12 Chong Yidong <cyd@gnu.org>
9070
9071 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9072 as that creates a dangerous corner case.
9073
9074 * window.c (Fdelete_window_internal): Invalidate the mouse
9075 highlight (Bug#9904).
9076
9077 2012-02-12 Glenn Morris <rgm@gnu.org>
9078
9079 * xselect.c (Fx_own_selection_internal)
9080 (Fx_get_selection_internal, Fx_disown_selection_internal)
9081 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9082 * nsselect.m (Fx_own_selection_internal)
9083 (Fx_disown_selection_internal, Fx_selection_exists_p)
9084 (Fx_selection_owner_p, Fx_get_selection_internal):
9085 Sync docs and argument specs with the xselect.c versions.
9086
9087 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9088
9089 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9090
9091 2012-02-11 Eli Zaretskii <eliz@gnu.org>
9092
9093 * w32select.c (Fx_selection_exists_p): Sync doc string and
9094 argument list with xselect.c. (Bug#10783)
9095
9096 * w16select.c (Fx_selection_exists_p): Sync doc string and
9097 argument list with xselect.c. (Bug#10783)
9098
9099 2012-02-10 Glenn Morris <rgm@gnu.org>
9100
9101 * fns.c (Fsecure_hash): Doc fix.
9102
9103 2012-02-09 Kenichi Handa <handa@m17n.org>
9104
9105 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9106
9107 2012-02-07 Chong Yidong <cyd@gnu.org>
9108
9109 * buffer.c (Fbuffer_local_variables)
9110 (buffer_lisp_local_variables): Handle unbound vars correctly;
9111 don't let Qunbound leak into Lisp.
9112
9113 2012-02-07 Glenn Morris <rgm@gnu.org>
9114
9115 * image.c (Fimagemagick_types): Doc fix.
9116
9117 * image.c (imagemagick-render-type): Change it from a lisp object
9118 to an integer. Move the doc here from the lisp manual.
9119 Treat all values not equal to 0 the same.
9120
9121 2012-02-06 Chong Yidong <cyd@gnu.org>
9122
9123 * doc.c (store_function_docstring): Avoid applying docstring of
9124 alias to base function (Bug#2603).
9125
9126 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9127
9128 * .gdbinit (pp1, pv1): Remove redundant defines.
9129 (pr): Use pp.
9130
9131 2012-02-04 Chong Yidong <cyd@gnu.org>
9132
9133 * nsterm.m: Declare a global (Bug#10694).
9134
9135 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9136
9137 * w32.c (get_emacs_configuration_options):
9138 Include --enable-checking, if specified, in the return value.
9139
9140 2012-02-04 Martin Rudalics <rudalics@gmx.at>
9141
9142 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9143 after rounding frame sizes. (Bug#9723)
9144
9145 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9146
9147 * keyboard.c (adjust_point_for_property): Don't position point
9148 before BEGV. (Bug#10696)
9149
9150 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9151
9152 Handle overflow when computing char display width (Bug#9496).
9153 * character.c (char_width): Return EMACS_INT, not int.
9154 (char_width, c_string_width): Check for overflow when
9155 computing the width; this is possible now that individual
9156 characters can have unbounded width. Problem introduced
9157 by merge from Emacs 23 on 2012-01-19.
9158
9159 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
9160
9161 * dbusbind.c (Fdbus_register_method): Mention the return value
9162 :ignore in the docstring.
9163
9164 2012-02-02 Glenn Morris <rgm@gnu.org>
9165
9166 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9167
9168 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9169 Unconditionally set to t. (Bug#10673)
9170 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9171 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9172 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9173
9174 2012-02-02 Kenichi Handa <handa@m17n.org>
9175
9176 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9177 0, do not call append_composite_glyph.
9178
9179 2012-02-02 Kenichi Handa <handa@m17n.org>
9180
9181 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9182 NULL (Bug#6988).
9183 (x_produce_glyphs): If the component of a composition is a null
9184 string, set it->pixel_width to 1 to avoid zero-width glyph.
9185
9186 2012-02-01 Eli Zaretskii <eliz@gnu.org>
9187
9188 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9189 first 2 arguments are identical. This makes inserting large
9190 output from a subprocess an order of magnitude faster on
9191 MS-Windows, where all sbrk'ed memory is always contiguous.
9192
9193 2012-01-31 Glenn Morris <rgm@gnu.org>
9194
9195 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9196 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9197 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9198
9199 2012-01-29 Glenn Morris <rgm@gnu.org>
9200
9201 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9202
9203 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9204
9205 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9206
9207 2012-01-28 Chong Yidong <cyd@gnu.org>
9208
9209 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9210
9211 2012-01-26 Chong Yidong <cyd@gnu.org>
9212
9213 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9214
9215 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9216 repeat counts (Bug#10507).
9217
9218 2012-01-26 Glenn Morris <rgm@gnu.org>
9219
9220 * lread.c (syms_of_lread): Doc fix.
9221
9222 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9223
9224 * coding.c (encode_designation_at_bol): Change return value to
9225 EMACS_INT.
9226
9227 2012-01-25 Chong Yidong <cyd@gnu.org>
9228
9229 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9230
9231 2012-01-21 Chong Yidong <cyd@gnu.org>
9232
9233 * floatfns.c (Fcopysign): Make the second argument non-optional,
9234 since nil is not allowed anyway.
9235
9236 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9237
9238 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9239 (send_process): Likewise.
9240
9241 2012-01-19 Martin Rudalics <rudalics@gmx.at>
9242
9243 * window.c (save_window_save, Fcurrent_window_configuration)
9244 (Vwindow_persistent_parameters): Do not use Qstate.
9245 Rewrite doc-strings.
9246
9247 2012-01-19 Kenichi Handa <handa@m17n.org>
9248
9249 * character.c (char_width): New function.
9250 (Fchar_width, c_string_width, lisp_string_width):
9251 Use char_width (Bug#9496).
9252
9253 2012-01-16 Martin Rudalics <rudalics@gmx.at>
9254
9255 * window.c (Vwindow_persistent_parameters): New variable.
9256 (Fset_window_configuration, save_window_save): Handle persistent
9257 window parameters.
9258
9259 2012-01-14 Eli Zaretskii <eliz@gnu.org>
9260
9261 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9262 thrashing the stack of the thread. (Bug#9087)
9263
9264 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9265
9266 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9267
9268 2012-01-11 Eli Zaretskii <eliz@gnu.org>
9269
9270 * xdisp.c (rows_from_pos_range): Handle the case where the
9271 highlight ends on a newline. (Bug#10464)
9272 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9273 he end column for display of highlight that ends on a newline
9274 before a R2L line.
9275
9276 2012-01-11 Glenn Morris <rgm@gnu.org>
9277
9278 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9279 from load-path also when installation-directory is nil. (Bug#10208)
9280
9281 2012-01-10 Glenn Morris <rgm@gnu.org>
9282
9283 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9284
9285 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9286 Update template values to be closer to their typical values these days.
9287
9288 2012-01-09 Eli Zaretskii <eliz@gnu.org>
9289
9290 * xdisp.c (rows_from_pos_range): Accept additional argument
9291 DISP_STRING, and accept any glyph in a row whose object is that
9292 string as eligible for mouse highlight. Fixes mouse highlight of
9293 display strings from overlays. (Bug#10464)
9294
9295 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
9296
9297 emacs: fix an auto-save permissions race condition (Bug#10400)
9298 * fileio.c (auto_saving_dir_umask): New static var.
9299 (Fmake_directory_internal): Use it.
9300 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9301 creating the directory. The old code temporarily assigns
9302 too-generous permissions to the directory.
9303 (do_auto_save_eh): Clear it.
9304 (Fdo_auto_save): Catch all errors, not just file errors, so
9305 that the var is always cleared.
9306
9307 2012-01-07 Eli Zaretskii <eliz@gnu.org>
9308
9309 * search.c (scan_buffer): Pass character positions to
9310 know_region_cache, not byte positions. (Bug#6540)
9311
9312 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
9313
9314 * w32.c (sys_rename): Report EXDEV when rename of a directory
9315 fails because the target is on another logical disk. (Bug#10284)
9316
9317 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9318
9319 * xterm.c (x_embed_request_focus): New function.
9320
9321 * xterm.h: Add prototype.
9322
9323 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9324
9325 2012-01-05 Glenn Morris <rgm@gnu.org>
9326
9327 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9328
9329 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9330
9331 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9332 Load gnutls_transport_set_lowat only if GnuTLS version is below
9333 2.11.1.
9334 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9335 GnuTLS versions below 2.11.1.
9336
9337 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9338
9339 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9340 to the doc string advising against its use for altering the way
9341 windows are scrolled.
9342
9343 2011-12-28 Kenichi Handa <handa@m17n.org>
9344
9345 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9346 coding-system ASCII compatible only when it does not produce BOM
9347 on encoding (Bug#10383).
9348
9349 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9350
9351 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9352 can scroll.
9353 (create_and_show_popup_menu): Always use menu_position_func for
9354 Gtk3 (Bug#10361).
9355
9356 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9357
9358 * callint.c (Fcall_interactively): Don't truncate prompt string.
9359
9360 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9361
9362 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9363 property that ends at ZV, so that the bidi iteration could be
9364 resumed from there (after widening). (Bug#10360)
9365
9366 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9367
9368 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9369
9370 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9371
9372 * nsterm.m (x_free_frame_resources):
9373 Release f->output_data.ns->miniimage.
9374 (ns_index_color): Fix indentation. Do not retain
9375 color_table->colors[i].
9376
9377 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9378 before returning.
9379
9380 * nsfns.m (x_set_background_color): Assign return value from
9381 ns_index_color to face-background instead of NSColor*.
9382 (ns_implicitly_set_icon_type): Fix indentation.
9383 Change assignment in for loop to comparison.
9384
9385 * emacs.c (ns_pool): New variable.
9386 (main): Assign ns_pool.
9387 (Fkill_emacs): Call ns_release_autorelease_pool.
9388
9389 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9390 autorelease fdesc, release fdAttrs and tdict.
9391 (ns_get_covering_families): Release charset.
9392 (ns_findfonts): Release NSFontDescriptor created with new.
9393 (ns_uni_to_glyphs): Fix indentation.
9394 (setString): Release attrStr before assigning new value.
9395
9396 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9397
9398 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9399 and NS_IMPL_COCOA.
9400 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9401 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9402
9403 2011-12-18 David Reitter <reitter@cmu.edu>
9404
9405 * nsterm.m (ns_term_init): Subscribe for notifications
9406 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9407 to method trackingNotification in EmacsMenu.
9408
9409 * nsmenu.m (trackingMenu): New variable.
9410 (trackingNotification): New method (from Aquamacs).
9411 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9412 from Aquamacs (Bug#7030).
9413
9414 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9415
9416 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9417 (symbol_to_nsstring): Fix indentation.
9418 (ns_symbol_to_pb): New function.
9419 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9420 (Fns_rotate_cut_buffers_internal): Remove.
9421 (Fns_store_selection_internal): Rename from
9422 Fns_store_cut_buffer_internal.
9423 (ns_get_foreign_selection, Fx_own_selection_internal)
9424 (Fx_disown_selection_internal, Fx_selection_exists_p)
9425 (Fns_get_selection_internal, Fns_store_selection_internal):
9426 Use ns_symbol_to_pb and check if return value is nil.
9427 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9428 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9429 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9430 renamed to Sns_store_selection_internal.
9431 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9432 and remove this function.
9433 (ns_handle_selection_clear): Remove, never used.
9434 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9435 here.
9436
9437 2011-12-17 Ken Brown <kbrown@cornell.edu>
9438
9439 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9440 GID is unknown (Bug#10257).
9441
9442 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9443
9444 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9445 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9446 which caused a build failure on GNU/Linux IA-64. This problem was
9447 introduced by my 2011-10-07 patch.
9448
9449 2011-12-15 Juri Linkov <juri@jurta.org>
9450
9451 * image.c (imagemagick_error): New function. (Bug#10112)
9452 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9453 Use `imagemagick_error' where ImageMagick functions return
9454 `MagickFalse'.
9455 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9456 proper order.
9457
9458 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9459
9460 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9461 fill background (Bug#8992).
9462
9463 2011-12-13 Martin Rudalics <rudalics@gmx.at>
9464
9465 * window.c (Vwindow_combination_resize)
9466 (Vwindow_combination_limit): Use t instead of non-nil in
9467 doc-strings.
9468 (Vrecenter_redisplay): Add first sentence of doc-string on
9469 separate line.
9470 (Frecenter): Fix doc-string typo.
9471
9472 2011-12-11 Kenichi Handa <handa@m17n.org>
9473
9474 * coding.c (Funencodable_char_position): Pay attention to the
9475 buffer text relocation (Bug#9389).
9476
9477 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9478
9479 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9480 gtk_init (Bug#10100).
9481
9482 2011-12-10 Eli Zaretskii <eliz@gnu.org>
9483
9484 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9485 IT->string is nil. (Bug#10263)
9486
9487 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9488
9489 * nsterm.h (x_free_frame_resources): Declare.
9490
9491 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9492 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9493
9494 * nsterm.h (ns_get_defaults_value): Declare.
9495
9496 * nsterm.m (ns_default): Call ns_get_defaults_value.
9497
9498 2011-12-09 Eli Zaretskii <eliz@gnu.org>
9499
9500 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9501 (Bug#10170)
9502
9503 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9504
9505 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9506 that where the value of an _OBJC_* symbol points to is in the .bss
9507 section (Bug#10240).
9508
9509 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9510
9511 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9512 after the loop to call ccl_driver at least once (Bug#8619).
9513
9514 2011-12-08 Kenichi Handa <handa@m17n.org>
9515
9516 * ftfont.c (get_adstyle_property): Fix previous change
9517 (Bug#10233).
9518
9519 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
9520
9521 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9522 dirs from the default value of EMACSLOADPATH (bug#10208).
9523
9524 2011-12-07 Glenn Morris <rgm@gnu.org>
9525
9526 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9527 installation and source directories as well. (Bug#10208)
9528
9529 2011-12-06 Chong Yidong <cyd@gnu.org>
9530
9531 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9532
9533 2011-12-06 Glenn Morris <rgm@gnu.org>
9534
9535 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9536 as an error, not just -1. (Bug#10217)
9537
9538 2011-12-05 Chong Yidong <cyd@gnu.org>
9539
9540 * keyboard.c (process_special_events): New function.
9541 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9542
9543 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9544
9545 * coding.c (encode_designation_at_bol): Don't use uninitialized
9546 local variable (Bug#9318).
9547
9548 2011-12-05 Kenichi Handa <handa@m17n.org>
9549
9550 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9551 return Qnil (Bug#8046, Bug#10193).
9552
9553 2011-12-05 Kenichi Handa <handa@m17n.org>
9554
9555 * coding.c (encode_designation_at_bol): New args charbuf_end and
9556 dst. Return the number of produced bytes. Callers changed.
9557 (coding_set_source): Return how many bytes coding->source was
9558 relocated.
9559 (coding_set_destination): Return how many bytes
9560 coding->destination was relocated.
9561 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9562 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9563
9564 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9565
9566 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9567 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9568 macro (Bug#9318).
9569
9570 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9571
9572 The following changes are to fix Bug#9318.
9573
9574 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9575 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9576 (encode_coding_iso_2022, encode_coding_sjis)
9577 (encode_coding_big5, encode_coding_charset): Use the above macros.
9578
9579 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
9580
9581 * lisp.h (process_quit_flag): Fix external declaration.
9582
9583 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9584
9585 Don't macro-inline non-performance-critical code.
9586 * eval.c (process_quit_flag): New function.
9587 * lisp.h (QUIT): Use it.
9588
9589 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9590
9591 * nsfns.m (get_geometry_from_preferences): New function.
9592 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9593
9594 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9595
9596 * emacs.c (Qkill_emacs): Define.
9597 (syms_of_emacs): Initialize it.
9598 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9599 Qquit_flag to `kill-emacs' instead.
9600 (quit_throw_to_read_char): Add parameter `from_signal'.
9601 All callers changed. Call Fkill_emacs if requested and safe.
9602 * lisp.h (QUIT): Call Fkill_emacs if requested.
9603
9604 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9605
9606 * widget.c (update_wm_hints): Return if wmshell is null.
9607 (widget_update_wm_size_hints): New function.
9608
9609 * widget.h (widget_update_wm_size_hints): Declare.
9610
9611 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9612 widget_update_wm_size_hints (Bug#10104).
9613
9614 2011-12-03 Eli Zaretskii <eliz@gnu.org>
9615
9616 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9617 before a newline, prepare the bidi iterator for consuming the
9618 newline, and keep the current paragraph direction. (Bug#10183)
9619 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9620
9621 2011-12-02 Juri Linkov <juri@jurta.org>
9622
9623 * search.c (Fword_search_regexp): New Lisp function created from
9624 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9625 (Fword_search_backward, Fword_search_forward)
9626 (Fword_search_backward_lax, Fword_search_forward_lax):
9627 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9628 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9629
9630 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9631
9632 * fileio.c (Finsert_file_contents): Move after-change-function call
9633 to before the "handled:" label, since all "goto handled" appear in
9634 cases where the *-change-functions have already been properly called
9635 (bug#10117).
9636
9637 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9638
9639 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9640 waiting for input. (Bug#10169)
9641
9642 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9643
9644 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9645 verifies glyph row's hash code--we have just reallocated the
9646 glyphs, so their contents can be complete garbage. (Bug#10164)
9647
9648 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
9649
9650 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9651
9652 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9653
9654 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9655 attributes are tested _before_ calling verify_row_hash, to protect
9656 against GCC re-ordering of the tests. (Bug#10164)
9657
9658 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9659
9660 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9661
9662 * xterm.c (handle_one_xevent): Only set async_visible and friends
9663 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9664 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9665 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9666
9667 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9668
9669 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9670 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9671 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9672 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9673 All uses changed to use GCPRO1 etc.
9674 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9675 Revert to old implementation (i.e., before 2011-03-11).
9676
9677 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9678
9679 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9680 of scroll runs so as to avoid assigning disabled bogus rows and
9681 unnecessary graphics copy operations.
9682
9683 2011-11-27 Eli Zaretskii <eliz@gnu.org>
9684
9685 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9686 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9687 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9688 (malloc, free, realloc, calloc): Redirect to e_* only when
9689 compiling Emacs.
9690
9691 * lisp.h (GCTYPEBITS): Move before first use.
9692 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9693 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9694 this macro definition.
9695
9696 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9697 _MSC_VER.
9698
9699 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9700
9701 * gtkutil.c (xg_create_frame_widgets):
9702 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9703 present with Gtk+ 2.0.
9704
9705 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9706
9707 * fileio.c (Finsert_file_contents): Undo previous change; see
9708 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9709
9710 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9711
9712 Rename locals to avoid shadowing.
9713 * fileio.c (Finsert_file_contents):
9714 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9715 * process.c (wait_reading_process_output):
9716 Rename inner 'proc' to 'p' to avoid shadowing.
9717 Indent for consistency with usual Emacs style.
9718
9719 2011-11-25 Eli Zaretskii <eliz@gnu.org>
9720
9721 * xdisp.c (redisplay_window): If cursor row is not fully visible
9722 after recentering, and scroll-conservatively is set to a large
9723 number, scroll window by a few more lines to make the cursor fully
9724 visible and out of scroll-margin. (Bug#10105)
9725 (start_display): Don't move to the next line if the display should
9726 start at a newline that is part of a display vector or an overlay
9727 string. (Bug#10119)
9728
9729 2011-11-24 Juri Linkov <juri@jurta.org>
9730
9731 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9732 after the `MagickPingImage' call. (Bug#10112)
9733
9734 2011-11-23 Chong Yidong <cyd@gnu.org>
9735
9736 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9737
9738 2011-11-23 Martin Rudalics <rudalics@gmx.at>
9739
9740 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9741 making another buffer current. (Bug#10114)
9742
9743 2011-11-23 Glenn Morris <rgm@gnu.org>
9744
9745 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9746
9747 2011-11-23 Chong Yidong <cyd@gnu.org>
9748
9749 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9750 using it (Bug#5984).
9751
9752 2011-11-22 Eli Zaretskii <eliz@gnu.org>
9753
9754 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9755 and header-lines, as they don't have one computed for them.
9756 (Bug#10098)
9757
9758 * .gdbinit (prow): Make displayed values more self-explaining.
9759 Add row's hash code.
9760
9761 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9762
9763 * process.c (wait_reading_process_output): Fix asynchrounous
9764 GnuTLS socket handling on some versions of the GnuTLS library.
9765 (wait_reading_process_output): Add comment and URL.
9766
9767 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9768
9769 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9770
9771 2011-11-21 Chong Yidong <cyd@gnu.org>
9772
9773 * window.c (Fnext_window, Fprevious_window): Doc fix.
9774
9775 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9776
9777 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9778
9779 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9780
9781 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9782
9783 2011-11-20 Martin Rudalics <rudalics@gmx.at>
9784
9785 * window.c (Fset_window_combination_limit): Rename argument
9786 STATUS to LIMIT.
9787 (Vwindow_combination_limit): Remove "status" from doc-string.
9788
9789 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9790
9791 * m/ibms390.h: Remove.
9792 * m/ibms390x.h: Don't include "ibms390.h".
9793
9794 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9795
9796 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9797 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9798
9799 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9800
9801 * casetab.c (Fset_case_table):
9802 * charset.c (Fcharset_after): Fix typos.
9803
9804 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9805
9806 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9807 Otherwise, valgrind does not work on some platforms.
9808 Problem reported by Andreas Schwab in
9809 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9810 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9811 is set, removing the need for VIRT_ADDRESS_VARIES.
9812 (PURE_P): Use a more-efficient implementation that needs just one
9813 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9814 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9815 to 4 (xorl, subq, cmpq, setbe).
9816 * alloc.c (pure): Always extern now, since that's the
9817 VIRT_ADDR_VARIES behavior.
9818 (PURE_POINTER_P): Use a single comparison, not two, for
9819 consistency with the new puresize.h.
9820 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9821 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9822 Remove VIRT_ADDR_VARIES no longer needed.
9823
9824 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9825
9826 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9827 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9828 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9829 behave as if the cursor position were at the window margin.
9830
9831 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9832 and the cursor position is out of bounds, behave as if the cursor
9833 position were at the window margin. (Bug#10075)
9834
9835 2011-11-18 Chong Yidong <cyd@gnu.org>
9836
9837 * window.c (Fwindow_combination_limit): Make first argument
9838 non-optional, since it is meaningless for live windows like the
9839 selected window.
9840
9841 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9842
9843 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9844
9845 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9846
9847 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9848 (graft_intervals_into_buffer): Simplify.
9849
9850 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9851
9852 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9853 hash values of the two rows.
9854 (copy_row_except_pointers): Preserve the used[] arrays and the
9855 hash values of the two rows. (Bug#10035)
9856 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9857
9858 * xdisp.c (row_hash): New function, body extracted from
9859 compute_line_metrics.
9860 (compute_line_metrics): Call row_hash, instead of computing the
9861 hash code inline.
9862
9863 * dispnew.c (verify_row_hash): Call row_hash for computing the
9864 hash code of a row, instead of duplicating code from xdisp.c.
9865
9866 * dispextern.h (row_hash): Add prototype.
9867
9868 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9869
9870 * frame.c (delete_frame): Don't delete the terminal when the last
9871 X frame is closed if emacs is built with GTK toolkit.
9872
9873 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9874
9875 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9876
9877 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9878
9879 * window.c (Vwindow_splits): Rename to
9880 Vwindow_combination_resize. Suggested by Juri Linkov.
9881 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9882 of Vwindow_splits.
9883
9884 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9885
9886 * nsfns.m (Fns_font_name):
9887 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9888
9889 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9890
9891 * window.h (window): Rename slot "nest" to "combination_limit".
9892 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9893 (Fset_window_nest): Rename to Fset_window_combination_limit.
9894 (Vwindow_nest): Rename to Vwindow_combination_limit.
9895 (recombine_windows, make_parent_window, make_window)
9896 (Fsplit_window_internal, saved_window)
9897 (Fset_window_configuration, save_window_save): Rename all
9898 occurrences of window_nest to window_combination_limit.
9899
9900 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9901
9902 * image.c (imagemagick_load_image): Fix typo.
9903
9904 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9905
9906 * xdisp.c (display_line): Move the call to
9907 highlight_trailing_whitespace before the call to
9908 compute_line_metrics, since the latter needs to see the final
9909 faces of all the glyphs to compute ROW's hash value.
9910 Fixes assertion violations in row_equal_p. (Bug#10035)
9911
9912 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9913
9914 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9915 just return (bug#10044).
9916
9917 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9918
9919 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9920 with user-defined heap size. Bump the default size of the temacs
9921 heap to 27MB, to avoid memory warning when running temacs.
9922 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9923
9924 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9925 current_matrix and desired_matrix. (Bug#9990)
9926 (verify_row_hash) [XASSERTS]: New function.
9927 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9928 that the hash value of glyph rows is correct.
9929
9930 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9931
9932 * window.h (window): Remove splits slot.
9933 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9934 (Fdelete_other_windows_internal, make_parent_window)
9935 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9936 (Fset_window_configuration, save_window_save): Don't deal with
9937 split status of windows.
9938 (saved_window): Remove splits slot.
9939 (Vwindow_splits): Rewrite doc-string.
9940
9941 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9942
9943 * xfns.c (unwind_create_frame):
9944 * nsfns.m (unwind_create_frame):
9945 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9946 Vframe_list (Bug#9999).
9947
9948 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9949
9950 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9951
9952 2011-11-11 Kenichi Handa <handa@m17n.org>
9953
9954 * callproc.c (Fcall_process): Set the member dst_multibyte of
9955 process_coding.
9956
9957 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9958
9959 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9960 avoid a crash (bug#9496).
9961
9962 2011-11-09 Chong Yidong <cyd@gnu.org>
9963
9964 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9965 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9966
9967 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9968
9969 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9970
9971 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9972
9973 Avoid some portability problems by eschewing 'extern inline' functions.
9974 The trivial performance wins aren't worth the portability hassles; see
9975 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9976 et seq.
9977 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9978 (window_box_width, window_box_left, window_box_left_offset)
9979 (window_box_right, window_box_right_offset): Undo previous change,
9980 by removing the "extern"s.
9981 * intervals.c (adjust_intervals_for_insertion)
9982 (adjust_intervals_for_deletion): Undo previous change,
9983 making these static again.
9984 (offset_intervals, temp_set_point_both, temp_set_point)
9985 (copy_intervals_to_string): No longer inline.
9986 * xdisp.c (window_text_bottom_y, window_box_width)
9987 (window_box_height, window_box_left_offset)
9988 (window_box_right_offset, window_box_left, window_box_right)
9989 (window_box): No longer inline.
9990
9991 2011-11-08 Chong Yidong <cyd@gnu.org>
9992
9993 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9994 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9995 Signal an error if not a live window.
9996 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9997 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9998
9999 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
10000
10001 * lisp.h (syms_of_abbrev): Remove declaration.
10002 Reported by CHENG Gao <chenggao@royau.me>.
10003
10004 2011-11-07 Eli Zaretskii <eliz@gnu.org>
10005
10006 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10007 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10008 of temacs in GUI mode.
10009
10010 2011-11-07 Martin Rudalics <rudalics@gmx.at>
10011
10012 * window.h: Declare delete_all_child_windows instead of
10013 delete_all_subwindows.
10014 * window.c (Fwindow_nest, Fset_window_nest)
10015 (Fset_window_new_total, Fset_window_new_normal)
10016 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10017 (delete_all_subwindows): Rename to delete_all_child_windows.
10018 (Fdelete_other_windows_internal, Fset_window_configuration):
10019 Call delete_all_child_windows instead of delete_all_subwindows.
10020 * frame.c (delete_frame): Call delete_all_child_windows instead
10021 of delete_all_subwindows.
10022
10023 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10024
10025 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10026 This is also needed for porting to any host where GC_MARK_STACK is
10027 not GC_MAKE_GCPROS_NOOPS.
10028 (which_symbols): Use it.
10029
10030 2011-11-07 Kenichi Handa <handa@m17n.org>
10031
10032 * coding.c (coding_set_destination): Check coding->src_pos only
10033 when coding->src_object is a buffer (bug#9910).
10034
10035 * process.c (send_process): Set the member src_multibyte of coding
10036 to 0 (bug#9911) when sending a unibyte text.
10037
10038 * callproc.c (Fcall_process): Set the member src_multibyte of
10039 process_coding to 0 (bug#9912).
10040
10041 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10042
10043 * xmenu.c (cleanup_widget_value_tree): New function.
10044 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10045 calling free_menubar_widget_value_tree directly (Bug#9830).
10046
10047 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10048
10049 Fix some portability problems with 'inline'.
10050 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10051 (window_box_width, window_box_left, window_box_left_offset)
10052 (window_box_right, window_box_right_offset): Declare extern.
10053 Otherwise, these inline functions do not conform to C99 and
10054 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10055 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10056 * intervals.c (adjust_intervals_for_insertion)
10057 (adjust_intervals_for_deletion): Now extern, because otherwise the
10058 extern inline functions 'offset_intervals' couldn't refer to it.
10059 (static_offset_intervals): Remove.
10060 (offset_intervals): Rewrite using the old contents of
10061 static_offset_intervals. The old version didn't conform to C99
10062 because an extern inline function contained a reference to an
10063 identifier with static linkage.
10064
10065 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10066
10067 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10068 GC.
10069
10070 2011-11-06 Eli Zaretskii <eliz@gnu.org>
10071
10072 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10073 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10074 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10075 return Qleft_to_right.
10076
10077 2011-11-06 Chong Yidong <cyd@gnu.org>
10078
10079 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10080 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10081 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10082 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10083 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10084 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10085 (Fwindow_vscroll): Doc fix.
10086 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10087 argument, since it makes no sense to pass a live window and for
10088 consistency with window-child.
10089
10090 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10091
10092 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10093 support MSVC.
10094
10095 2011-11-05 Jason Rumney <jasonr@gnu.org>
10096
10097 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10098 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10099 fonts (Bug#6029).
10100 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10101 bitwise arithmetic preventing use of unicode-sip and non-truetype
10102 opentype fonts.
10103
10104 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10105
10106 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10107 "emacs"-only part.
10108
10109 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10110 initialization code to keep similarity to xfns.c after changes
10111 from 2011-11-05.
10112
10113 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10114
10115 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10116 (unwind_create_frame): New function (Bug#9943).
10117 (Fx_create_frame): Restructure code to be more similar to the one in
10118 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10119 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10120 Move terminal->reference_count++ just before making the frame official
10121 (Bug#9943).
10122
10123 * nsterm.m (x_free_frame_resources): New function.
10124 (x_destroy_window): Move code to x_free_frame_resources.
10125
10126 * xfns.c (unwind_create_frame): Fix comment.
10127 (Fx_create_frame, x_create_tip_frame):
10128 Move terminal->reference_count++ just before making the frame
10129 official. Move initialization of image_cache_refcount and
10130 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10131
10132 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10133
10134 Support MSVC build with newer versions of Visual Studio.
10135 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10136 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10137 nt/gmake.defs.
10138
10139 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10140 which are not supported by MSVC.
10141 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10142 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10143 bitfields.
10144 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10145 types in bitfields.
10146 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10147
10148 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10149
10150 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
10151
10152 Support MSVC build with newer versions of Visual Studio.
10153 * w32.c: Don't include w32api.h for MSVC.
10154 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10155
10156 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10157 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10158 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10159 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10160 e_* cousins.
10161 (alloca) [_MSC_VER]: Define to _alloca.
10162
10163 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10164
10165 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10166
10167 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10168
10169 * xdisp.c (note_mouse_highlight): If either of
10170 previous/next-single-property-change returns nil, treat that as
10171 the beginning or the end of the buffer. (Bug#9955)
10172
10173 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10174
10175 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10176 label is not null (Bug#9951).
10177 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10178 may be NULL.
10179
10180 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10181
10182 * window.c (Fwindow_body_size): Mention in the doc string that the
10183 return value is in frame's canonical units. (Bug#9949)
10184
10185 2011-11-03 Eli Zaretskii <eliz@gnu.org>
10186
10187 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10188
10189 * w32fns.c (unwind_create_frame): If needed, free the glyph
10190 matrices of the partially constructed frame. (Bug#9943)
10191 * xfns.c (unwind_create_frame): Likewise.
10192
10193 2011-11-01 Eli Zaretskii <eliz@gnu.org>
10194
10195 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10196 Don't stop backward scan on the continuation glyph, even though
10197 its CHARPOS is positive.
10198 (mouse_face_from_buffer_pos, note_mouse_highlight):
10199 Rename cover_string to disp_string.
10200
10201 2011-11-01 Martin Rudalics <rudalics@gmx.at>
10202
10203 * window.c (temp_output_buffer_show): Don't use
10204 Vtemp_buffer_show_specifiers.
10205 (Vtemp_buffer_show_specifiers): Remove unused variable.
10206
10207 2011-10-30 Eli Zaretskii <eliz@gnu.org>
10208
10209 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10210 past the beginning of the current glyph matrix.
10211
10212 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
10213
10214 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10215 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10216 HAVE_GTK3 (Bug#9869).
10217
10218 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10219 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10220
10221 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10222
10223 * xterm.c: Declare x_handle_net_wm_state to return int.
10224 (handle_one_xevent): Check if we are iconified but don't have
10225 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10226 (get_current_wm_state): Return non-zero if not hidden,
10227 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10228 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10229 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10230 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10231
10232 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10233
10234 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10235 so that this new function doesn't get optimized away by a
10236 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10237
10238 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10239
10240 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10241
10242 2011-10-29 Eli Zaretskii <eliz@gnu.org>
10243
10244 Fix the `xbytecode' command.
10245 * .gdbinit (xprintbytestr): New command.
10246 (xwhichsymbols): Rename from `which'; all callers changed.
10247 (xbytecode): Print the byte-code string as well.
10248
10249 2011-10-29 Kim Storm <storm@cua.dk>
10250
10251 * alloc.c (which_symbols): New function.
10252
10253 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10254
10255 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10256 line. (Bug#9903)
10257
10258 2011-10-29 Glenn Morris <rgm@gnu.org>
10259
10260 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10261 Not clear what it was for, and it causes various bugs. (Bug#9839)
10262
10263 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10264
10265 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10266 possible random value that matches one of those tested as
10267 condition to clear the mouse face.
10268
10269 2011-10-28 Chong Yidong <cyd@gnu.org>
10270
10271 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10272
10273 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10274
10275 * window.c (make_window): Initialize phys_cursor_on_p.
10276
10277 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10278
10279 * lisp.h (struct Lisp_Symbol): Update comments.
10280
10281 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
10282
10283 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10284
10285 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10286
10287 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10288 <oslsachem@gmail.com> for helping to debug this.
10289
10290 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10291 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10292 (g_b_init_get_glyph_outline_w): New static variables.
10293 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10294 (GetGlyphOutlineW_Proc): New typedefs.
10295 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10296 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10297 New functions.
10298 (w32font_open_internal, compute_metrics):
10299 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10300 instead of calling the "wide" APIs directly.
10301
10302 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10303
10304 * w32.h (syms_of_w32font): Add prototype.
10305
10306 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10307
10308 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10309 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10310 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10311 (Fmove_to_window_line): Doc fix.
10312
10313 2011-10-27 Chong Yidong <cyd@gnu.org>
10314
10315 * process.c (make_process): Set gnutls_state to NULL.
10316
10317 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10318 non-NULL, regardless of GNUTLS_INITSTAGE.
10319 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10320 an error. Set process slots as soon as we allocate them.
10321
10322 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10323
10324 2011-10-27 Chong Yidong <cyd@gnu.org>
10325
10326 * gnutls.c (emacs_gnutls_deinit): New function.
10327 Deallocate credentials structures as well as calling gnutls_deinit.
10328 (Fgnutls_deinit, Fgnutls_boot): Use it.
10329
10330 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10331 (deactivate_process): Call emacs_gnutls_deinit.
10332
10333 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10334
10335 * image.c (x_create_x_image_and_pixmap):
10336 * w32.c (sys_rename, w32_delayed_load):
10337 * w32font.c (fill_in_logfont):
10338 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10339
10340 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10341
10342 * w32fns.c (w32_default_color_map): New function,
10343 extracted from Fw32_default_color_map.
10344 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10345
10346 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10347
10348 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10349
10350 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10351
10352 * keyboard.c (test_undefined): New function (bug#9751).
10353 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10354
10355 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10356
10357 * sysdep.c (init_sys_modes): Fix the check for the controlling
10358 terminal (Bug#6649).
10359
10360 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10361
10362 * dispextern.h (struct bidi_it): New member next_en_type.
10363
10364 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10365 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10366 current character, check also for next_en_type being WEAK_EN.
10367 (bidi_resolve_weak): Don't enter the expensive loop if the current
10368 position is before next_en_pos. Record the bidi type of the first
10369 non-ET, non-BN character we find, in addition to its position.
10370 (bidi_level_of_next_char): Invalidate next_en_type when
10371 next_en_pos is over-stepped.
10372
10373 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10374
10375 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10376 * editfns.c: Rewrite current-time-zone so that it invokes
10377 the equivalent of (format-time-string "%Z") to get the time zone name.
10378 This fixes a bug when the time zone name contains characters that
10379 need converting from the system time locale to Emacs internal format.
10380 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10381 that patch fixed format-time-string to do the conversion, but
10382 I forgot to fix current-time-zone.
10383 (format_time_string): New function, containing most of
10384 what Fformat_time_string used to contain.
10385 (Fformat_time_string): Rewrite in terms of format_time_string.
10386 This doesn't change this function's behavior.
10387 (current-time-zone): Rewrite to use format_time_string.
10388 This fixes the bug reported by Michael Schierl in
10389 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10390 Jason Rumney's 2007-06-07 change worked around this bug, but
10391 didn't fix it.
10392 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10393
10394 2011-10-19 Eli Zaretskii <eliz@gnu.org>
10395
10396 * xdisp.c (start_display): If the character at POS is displayed
10397 via a display vector, reset IT->current.dpvec_index to zero.
10398 (try_window_reusing_current_matrix): If a line ends in a display
10399 vector or the next line starts in a display vector, continue
10400 redrawing the window even though the character position of
10401 start_row was reached.
10402 (Bug#9771, part 2)
10403
10404 2011-10-18 Chong Yidong <cyd@gnu.org>
10405
10406 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10407 with nobreak-char-display too.
10408
10409 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10410
10411 Fix part 3 of bug#9771.
10412 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10413 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10414 non-neutral characters if the current character is a paragraph
10415 separator (a.k.a. Newline). This avoids running the same
10416 expensive loop twice, once when we consume the preceding newline
10417 and the other time when the line actually needs to be displayed.
10418 Avoid the loop when we see neutrals on the base embedding level
10419 following a character whose directionality is the same as the
10420 paragraph's. This avoids running the expensive loop when a line
10421 ends in a long sequence of neutrals, like control characters.
10422 Add assertion against STRONG_AL type. Slightly rearrange code
10423 that determines the type of a neutral given the first non-neutral
10424 that follows it.
10425 (bidi_level_of_next_char): Set next_en_pos to zero when
10426 invalidating its info.
10427
10428 2011-10-17 Eli Zaretskii <eliz@gnu.org>
10429
10430 * xdisp.c (push_display_prop): Determine whether to record string
10431 or buffer position by IT->string, not by IT->method. Allow
10432 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10433 (move_it_vertically_backward): Don't look for character position
10434 immediately after the newline when in a continuation line.
10435 (Bug#9771, part 1)
10436
10437 2011-10-15 Martin Rudalics <rudalics@gmx.at>
10438
10439 * window.c (coordinates_in_window): Rewrite and delabelize
10440 vertical border check. (Bug#5357) (Bug#9618)
10441
10442 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10443
10444 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10445 errors in XSetWindowBorder (bug#9310).
10446
10447 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10448
10449 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10450 avoid crash when xmalloc overrun checking is enabled.
10451
10452 2011-10-13 Eli Zaretskii <eliz@gnu.org>
10453
10454 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10455 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10456 cursor motion with <left> and <right> arrow keys.
10457
10458 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10459 some callers set that themselves.
10460
10461 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10462
10463 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10464 display string and the previous row comes from the same string and
10465 is empty. (Bug#9739) (Bug#9738)
10466
10467 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10468
10469 * doc.c (get_doc_string): Encode file name (bug#9735).
10470
10471 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10472
10473 * bidi.c (bidi_level_of_next_char):
10474 * xdisp.c (get_visually_first_element): Remove old incorrect
10475 comments regarding the Unicode Line Separator character.
10476
10477 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10478
10479 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10480
10481 * alloc.c (Fgc_status): Do not access beyond zombies array
10482 boundary if nzombies > MAX_ZOMBIES.
10483 * alloc.c (dump_zombies): Add missing format specifier.
10484
10485 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10486
10487 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10488 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10489
10490 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10491 Some packages use them to denote characters with modifiers.
10492
10493 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10494
10495 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10496 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10497 matching a pp-number. Rename parameter var to var1.
10498
10499 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10500
10501 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10502
10503 2011-10-08 Glenn Morris <rgm@gnu.org>
10504
10505 * callint.c (Fcall_interactively): Give a more explicit error for the
10506 'c' case with a non-character input. (Bug#8479)
10507
10508 2011-10-08 Eli Zaretskii <eliz@gnu.org>
10509
10510 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10511 lines.
10512 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10513 lines that are hscrolled on the left.
10514
10515 * dispnew.c (buffer_posn_from_coords): Account for a possible
10516 presence of header-line. (Bug#4426)
10517
10518 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10519
10520 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10521 Don't advertise functionality which we discourage or doesn't work.
10522
10523 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10524
10525 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10526 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10527 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10528 this makes Emacs dump core during garbage collection on rare
10529 occasions. sizeof is obviously inferior to offsetof here, so
10530 stick with offsetof.
10531 (GC_POINTER_ALIGNMENT): New macro.
10532 (mark_memory): Omit 3rd (offset) arg; caller changed.
10533 Don't assume EMACS_INT alignment is the same as pointer alignment.
10534
10535 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10536
10537 * keyboard.c (read_key_sequence_remapped): New var.
10538 (read_key_sequence): Compute remapping in the right buffer.
10539 (command_loop_1): Use read_key_sequence's remapping directly.
10540
10541 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10542
10543 * dired.c (file_name_completion): Don't expand file name.
10544 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10545 before checking file name handler.
10546
10547 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10548 they've been requested explicitly (bug#9591).
10549
10550 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
10551
10552 * keymap.c (Fsingle_key_description): Use make_specified_string
10553 instead of build_string to build string from push_key_description.
10554 (Bug#5193)
10555
10556 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10557
10558 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10559 This fixes a Y2038 bug on 64-bit hosts.
10560 * buffer.c (reset_buffer):
10561 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10562 (Fclear_buffer_auto_save_failure):
10563 Use 0, not -1, to represent an unset failure time, since time_t
10564 might not be signed.
10565
10566 Remove dependency on glibc malloc internals.
10567 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10568 Move back here from lisp.h, but with their new implementations.
10569 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10570 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10571 * charset.c (charset_table_init): New static var.
10572 (syms_of_charset): Use it instead of xmalloc. This removes a
10573 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10574 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10575 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10576 Move back to alloc.c.
10577 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10578 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10579
10580 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10581
10582 * nsterm.m (windowDidResize): Call x_set_window_size only when
10583 ns_in_resize is true. Otherwise set pixelwidth/height and
10584 call change_frame_size (Bug#9628).
10585
10586 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10587
10588 Port --enable-checking=all to Fedora 14 x86-64.
10589 * charset.c (syms_of_charset): Also account for glibc malloc's
10590 internal overhead when calculating the initial malloc maximum.
10591
10592 Port --enable-checking=all to Fedora 14 x86.
10593 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10594 Move to lisp.h.
10595 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10596 (overrun_check_realloc, overrun_check_free):
10597 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10598 That way, xmalloc returns a properly-aligned pointer even if
10599 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10600 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10601 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10602 into account when calculating the initial malloc maximum.
10603 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10604 Move here from alloc.c, so that charset.c can use it too.
10605 Properly align; the old code wasn't right for common 32-bit hosts
10606 when configured with --enable-checking=all.
10607 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10608 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10609
10610 2011-09-29 Eli Zaretskii <eliz@gnu.org>
10611
10612 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10613 use EDOM.
10614
10615 2011-09-28 Eli Zaretskii <eliz@gnu.org>
10616
10617 * xdisp.c (compute_display_string_end): If there's no display
10618 string at CHARPOS, return -1.
10619
10620 * bidi.c (bidi_fetch_char): When compute_display_string_end
10621 returns a negative value, treat the character as a normal
10622 character not covered by a display string. (Bug#9624)
10623
10624 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
10625
10626 * lread.c (Fread_from_string): Fix typo in docstring.
10627
10628 2011-09-27 Eli Zaretskii <eliz@gnu.org>
10629
10630 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10631 newline, reseat the iterator instead of bidi-iterating there one
10632 character at a time. (Bug#9610)
10633 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10634 TO_CHARPOS if the bidi iterator is at base embedding level.
10635
10636 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10637
10638 * lread.c (readevalloop): Use correct code for NBSP.
10639 (read1): Likewise. (Bug#9608)
10640
10641 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
10642
10643 * dbusbind.c (Fdbus_register_signal): When service is not
10644 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10645
10646 2011-09-25 Glenn Morris <rgm@gnu.org>
10647
10648 * buffer.c (truncate-lines): Doc fix.
10649
10650 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
10651
10652 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10653 (Fset_window_next_buffers): Doc fix.
10654
10655 2011-09-24 Glenn Morris <rgm@gnu.org>
10656
10657 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10658
10659 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10660
10661 Fix minor problems found by static checking.
10662 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10663 * indent.c (Fvertical_motion): Fix == vs = typo.
10664
10665 2011-09-24 Eli Zaretskii <eliz@gnu.org>
10666
10667 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10668 Default value is now t. Doc fix.
10669
10670 * indent.c (Fvertical_motion): Compute and apply the overshoot
10671 logic when moving up, not only when moving down. Fix the
10672 confusing name and values of the it_overshoot_expected variable;
10673 logic changes accordingly. (Bug#9254) (Bug#9549)
10674
10675 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10676 CHARPOS is covered by a display string which includes newlines.
10677 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10678 is covered by a display string with embedded newlines.
10679
10680 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
10681
10682 * dbusbind.c (Fdbus_register_signal): Add match rule to
10683 Vdbus_registered_objects_table. (Bug#9581)
10684 (Fdbus_register_method, Vdbus_registered_objects_table):
10685 Fix docstring.
10686
10687 2011-09-24 Jim Meyering <meyering@redhat.com>
10688
10689 do not ignore write error for any output size
10690 The previous change was incomplete.
10691 While it makes emacs --batch detect the vast majority of stdout
10692 write failures, errors were still ignored whenever the output size is
10693 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10694 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10695 && echo FAIL: ignored write error
10696 FAIL: ignored write error
10697 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10698 && echo FAIL: ignored write error
10699 FAIL: ignored write error
10700 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10701
10702 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10703
10704 * emacs.c (Fkill_emacs): In noninteractive mode exit
10705 non-successfully if a write error occurred on stdout. (Bug#9574)
10706
10707 2011-09-21 Eli Zaretskii <eliz@gnu.org>
10708
10709 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10710 the xassert test.
10711
10712 * dispextern.h (struct it): Update the comment documenting what
10713 can it->OBJECT be.
10714
10715 2011-09-20 Eli Zaretskii <eliz@gnu.org>
10716
10717 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10718 a display string, extend search for cursor position to end of row.
10719 (find_row_edges): If the row ends in a newline from a display
10720 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10721 Handle the case of a display string with multiple newlines.
10722 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10723 non-empty line. Fixes confusing cursor motion with arrow keys at
10724 the beginning of a line that starts with whitespace.
10725
10726 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10727
10728 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10729 (bug#9493).
10730
10731 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
10732
10733 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10734 boolean (Bug#9154).
10735
10736 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10737
10738 * xdisp.c (display_line): Record maximum and minimum buffer
10739 positions even if no glyphs were produced (e.g., by a zero-width
10740 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10741 buffer positions that will be removed from the glyph row because
10742 they don't fit.
10743 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10744 column is beyond frame width: don't subtract 1 "pixel" when
10745 computing width of the stretch.
10746 (reseat_at_next_visible_line_start): Undo the change made on
10747 2011-09-17 that saved paragraph information and restored it after
10748 the call to `reseat'. (Bug#9545)
10749
10750 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10751
10752 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10753 and turn window cursor on if cleared (Bug#9415).
10754
10755 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10756
10757 * search.c (boyer_moore): Take unibyte characters from pattern
10758 literally. (Bug#9458)
10759
10760 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10761
10762 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10763
10764 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10765
10766 Fix minor problem found by static checking.
10767 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10768 initialized, to pacify gcc -Wuninitialized.
10769
10770 * fileio.c: Report proper errno when syscall falls.
10771 (Finsert_file_contents): Save and restore errno,
10772 so that report_file_error outputs the correct diagnostic.
10773 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10774
10775 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10776
10777 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10778
10779 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10780
10781 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10782 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10783
10784 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10785
10786 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10787 about the current paragraph and restore it after the call to reseat.
10788
10789 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10790 (bidi_find_paragraph_start): Search back for paragraph beginning
10791 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10792 (bidi_move_to_visually_next): Only trigger paragraph-related
10793 computations when the last character is a newline or at EOB, not
10794 just any NEUTRAL_B. (Bug#9470)
10795
10796 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10797 truncated lines if point is covered by a display string. (Bug#9524)
10798
10799 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10800
10801 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10802 (cons_to_x_long): New function.
10803 (lisp_data_to_selection_data): Use it. Correct the test for
10804 short-versus-long data; it was negated. Break out of vector
10805 loop, for efficiency, when a long datum is discovered.
10806
10807 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10808
10809 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10810
10811 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10812
10813 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10814 GCC PR/17406) by declaring this function with external scope.
10815
10816 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10817
10818 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10819 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10820
10821 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10822
10823 * editfns.c (Fformat): Correctly handle text properties on "%%".
10824
10825 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10826
10827 * xterm.c (x_draw_composite_glyph_string_foreground):
10828 * w32term.c (x_draw_composite_glyph_string_foreground):
10829 * term.c (encode_terminal_code):
10830 * composite.c (composition_update_it, get_composition_id):
10831 * xdisp.c (get_next_display_element)
10832 (fill_composite_glyph_string): Add comments about special meaning
10833 of TAB characters in a composition.
10834
10835 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10836
10837 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10838 This occurs when processing a multibyte format.
10839 Problem reported by Wolfgang Jenker.
10840
10841 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10842
10843 * xdisp.c (try_cursor_movement): Only check for exact match if
10844 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10845
10846 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10847
10848 Remove unused external symbols.
10849 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10850 * xdisp.c (calc_pixel_width_or_height): Now static.
10851 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10852 * indent.c (check_display_width):
10853 * w32term.c: Fix comment to match code.
10854 * xterm.c, xterm.h (x_catching_errors): Remove.
10855
10856 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10857
10858 * xselect.c: Use signed conversions more consistently (Bug#9498).
10859 (selection_data_to_lisp_data): Assume incoming selection data are
10860 signed integers, not unsigned. This is to be consistent with
10861 outgoing selection data, which was modified to use signed integers
10862 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10863 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10864 expects long, not unsigned long.
10865
10866 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10867
10868 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10869 computation of loop end. Reported by Johan Bockgård
10870 <bojohan@gnu.org>.
10871
10872 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10873
10874 * frame.c (Fother_visible_frames_p): Function deleted.
10875
10876 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10877
10878 * indent.c (compute_motion): Process display vector front to back
10879 rather than the other way around. (Bug#2496)
10880
10881 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10882
10883 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10884
10885 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10886
10887 * minibuf.c (Fread_from_minibuffer): Doc fix.
10888
10889 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10890
10891 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10892 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10893
10894 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10895
10896 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10897 value for non-existent files.
10898
10899 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10900
10901 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10902 set its "size" to -1. This will set the modtime_size field of
10903 the corresponding buffer to -1, which is what
10904 verify-visited-file-modtime expects for files that do not exist.
10905 (Bug#9139)
10906
10907 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10908
10909 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10910 here ...
10911 * lisp.h: ... from here. push_key_description is no longer
10912 defined in keyboard.c, so its declaration should not be in
10913 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10914 logically belongs with push_key_description.
10915
10916 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10917
10918 * buffer.h: Include <sys/types.h> instead of <time.h>.
10919 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10920 Problem reported by Herbert J. Skuhra.
10921
10922 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10923
10924 * xml.c (parse_region): Make the parsing work for
10925 non-comment-starting XML files again (bug#9144).
10926
10927 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10928
10929 * image.c (gif_load): Fix calculation of bottom and right corner.
10930 (Bug#9468)
10931
10932 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10933
10934 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10935 redisplay in small windows.
10936
10937 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10938
10939 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10940
10941 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10942
10943 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10944 Operate on live windows only.
10945
10946 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10947
10948 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10949
10950 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10951
10952 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10953 only under bidi iteration.
10954
10955 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10956
10957 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10958
10959 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10960
10961 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10962 Without this fix, the command to link temacs failed due to an
10963 undefined symbol __builtin_isnan. This is because
10964 /usr/include/iso/math_c99.h #defines isnan(x) to
10965 __builtin_isnan(x), but the bundled gcc, which identifies itself
10966 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10967 a __builtin_isnan.
10968 * floatfns.c (isnan): #undef, and then #define to a clone of
10969 what's in data.c.
10970 (Fisnan): Always define, since it's always available now.
10971 (syms_of_floatfns): Always define isnan at the Lisp level.
10972
10973 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10974
10975 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10976
10977 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10978
10979 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10980 The previous code assumed that file offsets (off_t values) fit in
10981 EMACS_INT variables, which is not true on typical 32-bit hosts.
10982 The code messed up by falsely reporting buffer overflow in cases
10983 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10984 when "big" contains more than 2**29 bytes, even though this
10985 inserts just one byte and does not overflow the buffer.
10986 (Finsert_file_contents): Store file offsets as off_t
10987 values, not as EMACS_INT values. Check for overflow when
10988 converting between EMACS_INT and off_t. When checking for
10989 buffer overflow or for overlap, take the offsets into account.
10990 Don't use EMACS_INT for small values where int suffices.
10991 When checking for overlap, fix a typo: ZV was used where
10992 ZV_BYTE was intended.
10993 (Fwrite_region): Don't assume off_t fits into 'long'.
10994 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10995
10996 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10997
10998 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10999
11000 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11001
11002 sprintf-related integer and memory overflow issues (Bug#9412).
11003
11004 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11005 (esprintf, exprintf, evxprintf): New functions.
11006 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11007 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11008 (modify_event_symbol): Do not assume that the length of
11009 name_alist_or_stem is safe to alloca and fits in int.
11010 (Fexecute_extended_command): Likewise for function name and binding.
11011 (Frecursion_depth): Wrap around reliably on integer overflow.
11012 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11013 since some callers pass EMACS_INT values.
11014 (Fsingle_key_description): Don't crash if symbol name contains more
11015 than MAX_ALLOCA bytes.
11016 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11017 (get_minibuffer): Arg is now EMACS_INT, not int.
11018 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11019 (esprintf, exprintf, evxprintf): New decls.
11020 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11021
11022 * dbusbind.c (signature_cat): New function.
11023 (xd_signature, Fdbus_register_signal):
11024 Do not overrun buffer; instead, report string overflow.
11025
11026 * dispnew.c (add_window_display_history): Don't overrun buffer.
11027 Truncate instead; this is OK since it's just a log.
11028
11029 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11030 even if the time zone offset is outlandishly large.
11031 Don't mishandle offset == INT_MIN.
11032
11033 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11034 when creating daemon; the previous buffer-overflow check was incorrect.
11035
11036 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11037 which has the guts of the old verror function.
11038
11039 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11040 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11041
11042 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11043 (font_unparse_xlfd): Don't blindly alloca long strings.
11044 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11045 fits in int, when using sprintf. Use single snprintf to count
11046 length of string rather than counting it via multiple sprintfs;
11047 that's simpler and more reliable.
11048 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11049 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11050 sprintf, in case result does not fit in int.
11051
11052 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11053 (fontset_from_font): Print it.
11054
11055 * frame.c (tty_frame_count): Now printmax_t, not int.
11056 (make_terminal_frame, set_term_frame_name): Print it.
11057 (x_report_frame_params): In X, window IDs are unsigned long,
11058 not signed long, so print them as unsigned.
11059 (validate_x_resource_name): Check for implausibly long names,
11060 and don't assume name length fits in 'int'.
11061 (x_get_resource_string): Don't blindly alloca invocation name;
11062 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11063 not fit in int.
11064
11065 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11066 (xg_check_special_colors, xg_set_geometry):
11067 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11068
11069 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11070 Use esprintf, not sprintf, in case result does not fit in int.
11071
11072 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11073 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11074 it as a large positive number.
11075 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11076 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11077
11078 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11079 in case result does not fit in int.
11080
11081 * print.c (float_to_string): Detect width overflow more reliably.
11082 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11083 buffer overrun. Don't assume list length fits in 'int'. Treat
11084 print length of 0 as 0, not as infinity; to be consistent with other
11085 uses of print length in this function. Don't overflow print length
11086 index. Don't assume hash table size fits in 'long', or that
11087 vectorlike size fits in 'unsigned long'.
11088
11089 * process.c (make_process): Use printmax_t, not int, to format
11090 process-name gensyms.
11091
11092 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11093
11094 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11095 to avoid potential buffer overrun.
11096
11097 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11098 if X resource line is longer than 512 bytes.
11099
11100 * xfns.c (x_window): Make sprintf buffer a bit bigger
11101 to avoid potential buffer overrun.
11102
11103 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11104
11105 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11106
11107 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11108
11109 Integer overflow fixes for scrolling, etc.
11110 Without these, Emacs silently mishandles large integers sometimes.
11111 For example, "C-u 4294967297 M-x recenter" was treated as if
11112 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11113
11114 * xdisp.c (try_window_id): Check Emacs fixnum range before
11115 converting to 'int'.
11116
11117 * window.c (window_scroll_line_based, Frecenter):
11118 Check that an Emacs fixnum is in range before assigning it to 'int'.
11119 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11120 values converted from Emacs fixnums.
11121 (Frecenter): Don't wrap around a line count if it is out of 'int'
11122 range; instead, treat it as an extreme value.
11123 (Fset_window_configuration, compare_window_configurations):
11124 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11125
11126 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11127 that can exceed INT_MAX. Check that EMACS_INT value is in range
11128 before assigning it to the (possibly-narrower) index.
11129 (match_limit): Don't assume that a fixnum can fit in 'int'.
11130
11131 * print.c (print_object): Use ptrdiff_t, not int, for index that can
11132 exceed INT_MAX.
11133
11134 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11135 (Fvertical_motion): Don't wrap around LINES values that don't fit
11136 in 'int'. Instead, treat them as extreme values. This is good
11137 enough for windows, which can't have more than INT_MAX lines anyway.
11138
11139 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11140
11141 * Require libxml/parser.h to avoid compilation warning.
11142
11143 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11144
11145 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11146 since this reportedly can destroy thread storage.
11147
11148 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
11149
11150 * syntax.c (find_defun_start): Update all cache variables if
11151 exiting early (Bug#9401).
11152
11153 2011-08-30 Eli Zaretskii <eliz@gnu.org>
11154
11155 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11156
11157 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11158 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11159 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11160
11161 * term.c (tty_append_glyph): New function.
11162 (produce_stretch_glyph): Static function and its prototype deleted.
11163
11164 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11165 Add prototypes.
11166
11167 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11168
11169 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11170 when checking :margin (Bug#9390).
11171 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11172 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11173 so that the name doesn't mislead. All uses changed.
11174
11175 2011-08-28 Johan Bockgård <bojohan@gnu.org>
11176
11177 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11178 set_tty_hooks.
11179
11180 2011-08-27 Eli Zaretskii <eliz@gnu.org>
11181
11182 * xdisp.c (move_it_to): Don't bail out early when reaching
11183 position beyond to_charpos, if we are scanning backwards.
11184 (move_it_vertically_backward): When DY == 0, make sure we get to
11185 the first character in the line after the newline.
11186
11187 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11188
11189 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11190 (ccl_driver): Do not generate an out-of-range pointer.
11191 (Fccl_execute_on_string): Remove unnecessary check for
11192 integer overflow, noted by Stefan Monnier in
11193 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11194 Remove a FIXME that didn't need fixing.
11195 Simplify the newly-introduced buffer reallocation code.
11196
11197 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
11198
11199 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11200
11201 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
11202
11203 Integer and memory overflow issues (Bug#9196).
11204
11205 * doc.c (get_doc_string): Rework so that
11206 get_doc_string_buffer_size is the actual buffer size, rather than
11207 being 1 less than the actual buffer size; this makes xpalloc more
11208 convenient.
11209
11210 * image.c (x_allocate_bitmap_record, cache_image):
11211 * xselect.c (Fx_register_dnd_atom):
11212 Simplify previous changes by using xpalloc.
11213
11214 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11215 since either will do and ptrdiff_t is convenient with xpalloc.
11216
11217 * charset.c (charset_table_size)
11218 (struct charset_sort_data.priority): Now ptrdiff_t.
11219 (charset_compare): Don't overflow if priorities differ greatly.
11220 (Fsort_charsets): Don't assume list length fits in int.
11221 Check for size-calculation overflow when allocating sort data.
11222 (syms_of_charset): Allocate an initial charset table that is
11223 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11224
11225 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11226
11227 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11228 The actual value is always <= INT_MAX, and leaving it unsigned made
11229 overflow checking harder.
11230
11231 * dispextern.h (struct glyph_matrix.rows_allocated)
11232 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11233 with xpalloc. The values are still always <= INT_MAX.
11234
11235 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11236
11237 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11238 (SAFE_NALLOCA): New macro.
11239
11240 * region-cache.c (struct boundary.pos, find_cache_boundary)
11241 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11242 (set_cache_region, invalidate_region_cache)
11243 (revalidate_region_cache, know_region_cache, region_cache_forward)
11244 (region_cache_backward, pp_cache):
11245 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11246 so that ptrdiff_t * can be passed to xpalloc.
11247 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11248 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11249 (pp_cache): Don't assume cache_len fits in int.
11250 * region-cache.h: Adjust extern decls to match.
11251
11252 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11253 EMACS_INT, since either will do, for xpalloc.
11254
11255 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11256 (xnmalloc, xnrealloc, xpalloc): New functions.
11257
11258 * bidi.c (bidi_shelve_header_size): New constant.
11259 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11260 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11261
11262 * bidi.c (bidi_cache_shrink):
11263 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11264 (overlay_strings):
11265 Don't update size of array until after memory allocation succeeds,
11266 because xmalloc/xrealloc may not return.
11267 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11268 now that we have proper integer overflow checking.
11269 (record_overlay_string, overlay_strings): Catch overflows when
11270 calculating size of overlay_str_buf.
11271
11272 * callproc.c (Fcall_process): Check for size overflow when
11273 calculating size of args2.
11274 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11275 Normally we prefer signed values, but sticking with ptrdiff_t would
11276 require adding more-complicated checks.
11277
11278 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11279 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11280 Redo buffer-overflow calculations to avoid integer overflow.
11281 Add a FIXME comment where memory seems to be over-allocated.
11282
11283 * character.c (Fstring): Check for size-calculation overflow.
11284
11285 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11286 unnecessary integer overflow. Check for size overflow.
11287 (encode_coding_object): Don't update size until xmalloc succeeds.
11288
11289 * composite.c (get_composition_id): Check for overflow in glyph
11290 length calculations.
11291
11292 Integer and memory overflow fixes for display code.
11293 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11294 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11295 (scrolling_window): Check for overflow in size calculations.
11296 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11297 Don't assume glyph table len fits in int.
11298 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11299 (row_table_size): Now ptrdiff_t, not int.
11300 (scrolling_window): Avoid overflow in size calculations.
11301 Don't update size until allocation succeeds.
11302 * fns.c (concat): Check for overflow in size calculations.
11303 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11304 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11305 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11306
11307 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11308 (get_doc_string): Check for size calculation overflow.
11309 Don't update size until allocation succeeds.
11310 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11311 EMACS_INT, where ptrdiff_t will do.
11312 (Fsubstitute_command_keys): Check for string overflow.
11313
11314 * editfns.c (set_time_zone_rule): Don't assume environment length
11315 fits in int.
11316 (message_length): Now ptrdiff_t, not int.
11317 (Fmessage_box): Don't update size until allocation succeeds.
11318 Don't assume message length fits in int.
11319 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11320
11321 * emacs.c (main): Do not reallocate argv, since there is a null at
11322 the end that can be overwritten, and this way there's no need to
11323 worry about size-calculation overflow.
11324 (sort_args): Check for size-calculation overflow.
11325
11326 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11327 alloc succeeds.
11328 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11329
11330 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11331 (x_set_scroll_bar_width, x_figure_window_size):
11332 Check for integer overflow.
11333 (x_set_alpha): Do not assume XINT fits in int.
11334
11335 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11336 This is for the members text_lines, text_cols, total_lines, total_cols,
11337 where the system imposes an 'int' limit.
11338
11339 * fringe.c (Fdefine_fringe_bitmap):
11340 Don't update size until alloc works.
11341
11342 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11343 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11344
11345 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11346 Check for size-calculation overflow.
11347 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11348 do, as we prefer signed integers.
11349 (id_to_widget.max_size, id_to_widget.used)
11350 (xg_store_widget_in_map, xg_remove_widget_from_map)
11351 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11352 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11353 Use and return ptrdiff_t, not int.
11354 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11355 * gtkutil.h: Change prototypes to match the above.
11356
11357 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11358 are duplicate now that they've been promoted to lisp.h.
11359 (x_allocate_bitmap_record, x_alloc_image_color)
11360 (make_image_cache, cache_image, xpm_load):
11361 Don't update size until alloc is done.
11362 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11363 (x_detect_edges):
11364 Check for size calculation overflow.
11365 (ct_colors_allocated_max): New constant.
11366 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11367 overflow.
11368
11369 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11370 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11371 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11372 Use ptrdiff_t, not int, to count maps.
11373 (read_char_minibuf_menu_prompt): Check for overflow in size
11374 calculations. Don't update size until allocation succeeds.
11375 Redo calculations to avoid overflow.
11376 * keyboard.h: Change prototypes to match the above.
11377
11378 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11379 to count maps.
11380 (current_minor_maps): Check for size calculation overflow.
11381 * keymap.h: Change prototypes to match the above.
11382
11383 * lread.c (read1, init_obarray): Don't update size until alloc done.
11384
11385 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11386 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11387
11388 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11389 Now ptrdiff_t, not int.
11390 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11391 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11392
11393 * process.c (Fnetwork_interface_list): Check for overflow
11394 in size calculation.
11395
11396 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11397
11398 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11399 overflow. Don't bother calling xmalloc when xrealloc will do.
11400
11401 * search.c (Freplace_match): Check for size calculation overflow.
11402 (Fset_match_data): Don't assume list lengths fit in 'int'.
11403
11404 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11405 for command line length. Do not attempt to address one before the
11406 beginning of an array, as that's not portable.
11407
11408 * term.c (max_frame_lines): Remove; unused.
11409 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11410 not int.
11411 (encode_terminal_code, calculate_costs): Check for size
11412 calculation overflow.
11413 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11414 table lengths and related sizes. Don't update size until alloc
11415 done. Redo calculations to avoid overflow.
11416 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11417
11418 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11419 subtracting pointers.
11420 (gobble_line): Check for overflow more carefully. Don't update size
11421 until alloc done.
11422
11423 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11424 Don't update size until alloc done.
11425 Redo size calculations to avoid overflow.
11426 Check for size calculation overflow.
11427 (main) [DEBUG]: Fix typo in invoking tparam1.
11428
11429 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11430 Use ptrdiff_t, not int, for sizes.
11431 (store_mode_line_noprop_char): Don't update size until alloc done.
11432
11433 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11434 Use ptrdiff_t, not int, for sizes.
11435 (Finternal_make_lisp_face, cache_face):
11436 Check for size calculation overflow.
11437 (cache_face): Treat size calculation overflows as if they were
11438 memory exhaustion (the usual treatment), rather than aborting.
11439
11440 * xfns.c (x_encode_text, x_set_name_internal)
11441 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11442 sizes, since they can exceed INT_MAX in size. Check for size
11443 calculation overflow.
11444
11445 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11446 (xg_select): Check for size calculation overflow.
11447 Don't update size until alloc done.
11448
11449 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11450 as sprintf is limited to int lengths.
11451
11452 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11453 (X_LONG_MIN): New macros.
11454 Use them to make the following changes clearer.
11455 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11456 This change doesn't affect the value now, but it may help remind
11457 future maintainers not to raise the value too much later.
11458 (SELECTION_QUANTUM): Remove, replacing with ...
11459 (selection_quantum): ... new function, which avoids overflow.
11460 All uses changed.
11461 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11462 assumption that selection length fits in 'int'.
11463 (x_reply_selection_request, x_handle_selection_request)
11464 (x_get_window_property, receive_incremental_selection)
11465 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11466 (lisp_data_to_selection_data, clean_local_selection_data):
11467 Use ptrdiff_t, not int, to record length of selection.
11468 (x_reply_selection_request, x_get_window_property)
11469 (receive_incremental_selection, x_property_data_to_lisp):
11470 Redo calculations to avoid overflow.
11471 (x_reply_selection_request): When sending hint, ceiling it at
11472 X_LONG_MAX rather than relying on wraparound overflow to send
11473 something.
11474 (x_get_window_property, receive_incremental_selection)
11475 (lisp_data_to_selection_data, x_property_data_to_lisp):
11476 Check for size-calculation overflow.
11477 (x_get_window_property, receive_incremental_selection)
11478 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11479 Don't store size until memory allocation succeeds.
11480 (x_get_window_property): Plug memory leak on memory exhaustion.
11481 Don't double-block input; malloc is safe here. Don't assume 2**34
11482 - 4 fits in unsigned long. Add an xassert to check
11483 XGetWindowProperty overflow. Be more careful about overflow
11484 calculations, and distinguish size from memory overflow better.
11485 (receive_incremental_selection): When tracing, don't assume
11486 unsigned int is less than INT_MAX.
11487 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11488 harmful) conversions of unsigned short to int.
11489 (lisp_data_to_selection_data): Don't assume that integers
11490 in the range -65535 through -1 fit in an X unsigned short.
11491 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11492 result parameters unless successful. Rely on cons_to_unsigned
11493 to report problems with elements; the old code wasn't right anyway.
11494 (x_check_property_data): Check for int overflow; we cannot use
11495 a wider type due to X limits.
11496 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11497
11498 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11499
11500 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11501 (x_term_init): Check for size calculation overflow.
11502 (x_color_cells): Don't store size until memory allocation succeeds.
11503 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11504 Don't assume alloca size is less than MAX_ALLOCA.
11505 (x_term_init): Don't assume length fits in int (sprintf is limited
11506 to int size).
11507
11508 Use ptrdiff_t for composition IDs.
11509 * character.c (lisp_string_width):
11510 * composite.c (composition_table_size, n_compositions)
11511 (get_composition_id, composition_gstring_from_id):
11512 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11513 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11514 * window.c (Frecenter):
11515 Use ptrdiff_t, not int, for composition IDs.
11516 * composite.c (get_composition_id): Check for integer overflow.
11517 * composite.h: Adjust prototypes to match the above changes.
11518
11519 Use ptrdiff_t for hash table indexes.
11520 * category.c (hash_get_category_set):
11521 * ccl.c (ccl_driver):
11522 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11523 * coding.c (coding_system_charset_list, detect_coding_system):
11524 * coding.h (struct coding_system.id):
11525 * composite.c (get_composition_id, gstring_lookup_cache):
11526 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11527 * image.c (xpm_get_color_table_h):
11528 * lisp.h (hash_lookup, hash_put):
11529 * minibuf.c (Ftest_completion):
11530 Use ptrdiff_t for hash table indexes, not int (which is too
11531 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11532 32-bit --with-wide-int hosts).
11533
11534 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11535 Add a FIXME comment about memory leaks.
11536 (syms_of_charset): Don't assume xmalloc returns.
11537
11538 Don't assume that stated character widths fit in int.
11539 * character.c (Fchar_width, c_string_width, lisp_string_width):
11540 * character.h (CHAR_WIDTH):
11541 * indent.c (MULTIBYTE_BYTES_WIDTH):
11542 Use sanitize_char_width to avoid undefined and/or bad behavior
11543 with outlandish widths.
11544 * character.h (sanitize_tab_width): Rename from sanitize_width,
11545 now that we have two such functions. All uses changed.
11546 (sanitize_char_width): New inline function.
11547
11548 Don't assume that tab-width fits in int.
11549 * character.h (sanitize_width): New inline function.
11550 (SANE_TAB_WIDTH): New macro.
11551 (ASCII_CHAR_WIDTH): Use it.
11552 * indent.c (sane_tab_width): Remove. All uses replaced by
11553 SANE_TAB_WIDTH (current_buffer).
11554 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11555
11556 * fileio.c: Integer overflow issues with file modes.
11557 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11558
11559 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11560 Remove unreachable code.
11561 (read_hex, load_charset_map_from_file): Check for integer overflow.
11562
11563 * xterm.c: Don't go over XClientMessageEvent limit.
11564 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11565 (x_send_scroll_bar_event): Likewise. Check that the size does not
11566 exceed limits imposed by XClientMessageEvent, as well as the usual
11567 ptrdiff_t and size_t limits.
11568
11569 * keyboard.c: Overflow, signedness and related fixes.
11570 (make_lispy_movement): Use same integer type in forward decl
11571 that is used in the definition.
11572 (read_key_sequence, keyremap_step):
11573 Change bufsize argument back to int, undoing my 2011-03-30 change.
11574 We prefer signed types, and int is wide enough here.
11575 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11576 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11577 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11578 length, not size_t. Use ptrdiff_t for index, not int.
11579 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11580 possibility of integer overflow.
11581
11582 Overflow, signedness and related fixes for images.
11583
11584 * dispextern.h (struct it.stack[0].u.image.image_id)
11585 (struct_it.image_id, struct image.id, struct image_cache.size)
11586 (struct image_cache.used, struct image_cache.ref_count):
11587 * gtkutil.c (update_frame_tool_bar):
11588 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11589 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11590 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11591 * nsmenu.m (update_frame_tool_bar):
11592 * xdisp.c (calc_pixel_width_or_height):
11593 * xfns.c (image_cache_refcount):
11594 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11595 on typical 64-bit hosts.
11596
11597 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11598 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11599 Omit unnecessary casts to int.
11600 (parse_image_spec): Check that integers fall into 'int' range
11601 when the callers expect that.
11602 (image_ascent): Redo ascent calculation to avoid int overflow.
11603 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11604 (lookup_image): Remove unnecessary tests.
11605 (xbm_image_p): Locals are now of int, not EMACS_INT,
11606 since parse_image_check makes sure they fit into int.
11607 (png_load, gif_load, svg_load_image):
11608 Prefer int to unsigned where either will do.
11609 (tiff_handler): New function, combining the cores of the
11610 old tiff_error_handler and tiff_warning_handler.
11611 This function is rewritten to use vsnprintf and thereby avoid
11612 stack buffer overflows. It uses only the features of vsnprintf
11613 that are common to both POSIX and native Microsoft.
11614 (tiff_error_handler, tiff_warning_handler): Use it.
11615 (tiff_load, gif_load, imagemagick_load_image):
11616 Don't assume :index value fits in 'int'.
11617 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11618 (imagemagick_load_image): Check that crop parameters fit into
11619 the integer types that MagickCropImage accepts. Don't assume
11620 Vimagemagick_render_type has a nonnegative value. Don't assume
11621 size_t fits in 'long'.
11622 (gs_load): Use printmax_t to print the widest integers possible.
11623 Check for integer overflow when computing image height and width.
11624
11625 2011-08-26 Eli Zaretskii <eliz@gnu.org>
11626
11627 * xdisp.c (redisplay_window): Don't force window start if point
11628 will be invisible in the resulting window. (Bug#9324)
11629
11630 2011-08-25 Eli Zaretskii <eliz@gnu.org>
11631
11632 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11633 the display spec is of the form `(space ...)'.
11634 (handle_display_spec): Return the value returned by
11635 handle_single_display_spec, not just 1 or zero.
11636 (handle_single_display_spec): If the display spec is of the form
11637 `(space ...)', and specifies display in the text area, return 2
11638 rather than 1.
11639 (try_cursor_movement): Check for the need to scroll more
11640 accurately, and prefer exact match for point under bidi.
11641 Don't advance `row' beyond the last row of the window.
11642
11643 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11644 into disp_prop; all users changed.
11645
11646 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11647 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11648 for the text covered by the display property.
11649
11650 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
11651
11652 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11653 Change return value to nil.
11654 (Frecord_buffer): Delete unused function.
11655
11656 2011-08-24 Eli Zaretskii <eliz@gnu.org>
11657
11658 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11659 buffers, return left-to-right.
11660 (set_cursor_from_row): Consider candidate row a win if its glyph
11661 represents a newline and point is on that newline. Fixes cursor
11662 positioning on the newline at EOL of R2L text within L2R
11663 paragraph, and vice versa.
11664 (try_cursor_movement): Check continued rows, in addition to
11665 continuation rows. Fixes unwarranted scroll when point enters a
11666 continued line of R2L text within an L2R paragraph, or vice versa.
11667 (cursor_row_p): Consider the case of point being equal to
11668 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11669 from the end of a short line to the beginning of a continued line
11670 of R2L text within L2R paragraph.
11671 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11672 composed characters.
11673
11674 * bidi.c (bidi_check_type): Use xassert.
11675 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11676 members.
11677
11678 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11679
11680 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11681 a character.
11682
11683 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
11684
11685 * nsfont.m (ns_otf_to_script): Fix typo.
11686
11687 2011-08-22 Kenichi Handa <handa@m17n.org>
11688
11689 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11690 extra slot even if the purpose is char-code-property-table.
11691
11692 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11693
11694 * xdisp.c (redisplay_window): When computing centering_position,
11695 account for the height of the header line. (Bug#8874)
11696
11697 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11698 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11699 candidate is selected by the mouse, and that candidate has a
11700 composed character under the mouse.
11701
11702 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11703 coordinates reported by pos-visible-in-window-p for a composed
11704 character in column zero.
11705
11706 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11707
11708 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11709
11710 2011-08-22 Eli Zaretskii <eliz@gnu.org>
11711
11712 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11713 consider it a hit if to_charpos is anywhere in the range of the
11714 composed buffer positions.
11715
11716 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
11717
11718 * image.c (gif_load): Don't assume that each subimage has the same
11719 dimensions as the base image. Handle disposal method that is
11720 "undefined" by the gif spec (Bug#9335).
11721
11722 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
11723
11724 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11725 (Fcondition_case): Document `debug' symbol in error handler.
11726
11727 2011-08-19 Eli Zaretskii <eliz@gnu.org>
11728
11729 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11730 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11731 from an Org mode buffer to a Speedbar frame.
11732
11733 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11734 a composition, take its buffer position from IT->cmp_it.charpos.
11735 Fixes cursor positioning at the beginning of a line that begins
11736 with a composed character.
11737
11738 2011-08-18 Eli Zaretskii <eliz@gnu.org>
11739
11740 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11741 character bidirectional type, use STRONG_L instead. Fixes crashes
11742 in a buffer produced by `describe-categories'.
11743
11744 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11745 members before the level stack, so they would be saved and
11746 restored when copying iterator state. Fixes incorrect reordering
11747 around TABs covered by display properties.
11748
11749 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11750
11751 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11752
11753 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
11754
11755 * eval.c (internal_condition_case, internal_condition_case_1)
11756 (internal_condition_case_2, internal_condition_case_n):
11757 Remove unnecessary aborts (Bug#9081).
11758
11759 2011-08-17 Eli Zaretskii <eliz@gnu.org>
11760
11761 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11762 has no `load' handler, try opening the file locally. (Bug#9311)
11763
11764 2011-08-16 Ken Brown <kbrown@cornell.edu>
11765
11766 * gmalloc.c: Expand comment.
11767
11768 2011-08-16 Eli Zaretskii <eliz@gnu.org>
11769
11770 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11771 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11772
11773 2011-08-16 Ken Brown <kbrown@cornell.edu>
11774
11775 Fix memory allocation problems in Cygwin build (Bug#9273).
11776
11777 * unexcw.c ( __malloc_initialized): Declare external variable.
11778 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11779
11780 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11781 New variables.
11782 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11783 dumped emacs.
11784 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11785 in the static heap.
11786 [CYGWIN] (special_realloc): New function.
11787 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11788 requests to realloc storage in the static heap.
11789
11790 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11791
11792 * bidi.c (bidi_initialize): Remove unused local.
11793
11794 2011-08-15 Eli Zaretskii <eliz@gnu.org>
11795
11796 * bidimirror.h:
11797 * biditype.h: Remove file.
11798 * makefile.w32-in ($(BLD)/bidi.$(O)):
11799 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11800
11801 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11802
11803 * chartab.c: Improve commentary for the uniprop_table API.
11804
11805 * bidi.c (bidi_paragraph_init): Support zero value of
11806 bidi_ignore_explicit_marks_for_paragraph_level.
11807 (bidi_initialize): Use uniprop_table instead of including
11808 biditype.h and bidimirror.h.
11809
11810 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11811 coordinates of the iterator when restoring from ppos_it.
11812 (Bug#9296)
11813
11814 2011-08-14 Kenichi Handa <handa@m17n.org>
11815
11816 * process.c (create_process): Call setup_process_coding_systems
11817 after the pid of the process is set to -1 (Bug#8162).
11818
11819 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11820
11821 * xdisp.c (move_it_in_display_line_to): Don't invoke
11822 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11823 ppos_it. Fixes vertical cursor motion when line beginning is
11824 covered by an image. (Bug#9296)
11825
11826 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11827
11828 * nsterm.h (ns_run_ascript): Declare.
11829 (NSAPP_DATA2_RUNASSCRIPT): Define.
11830
11831 * nsfns.m (as_script, as_result, as_status): New static variables.
11832 (ns_run_ascript): New function.
11833 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11834 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11835 the event loop. Get status from as_status (Bug#7276).
11836
11837 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11838 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11839 the event loop (Bug#7276).
11840
11841 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11842
11843 * gnutls.c (QCgnutls_bootprop_priority)
11844 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11845 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11846 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11847 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11848 (QCgnutls_bootprop_verify_hostname_error)
11849 (QCgnutls_bootprop_callbacks_verify): Rename from
11850 Qgnutls_bootprop_..., all uses changed.
11851
11852 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11853 uses changed.
11854
11855 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11856
11857 * xfaces.c (Qframe_set_background_mode): Now static.
11858 * dispextern.h (Qframe_set_background_mode): Remove decl.
11859
11860 * process.c (Fnetwork_interface_info): Declare local only if needed.
11861
11862 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11863
11864 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11865 (Fnetwork_interface_list): Allocate in increments of bytes instead
11866 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11867 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11868 sockaddr.
11869 (struct ifflag_def): notrailers is smart on OSX.
11870 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11871 Get hardware address with getifaddrs if available.
11872
11873 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11874
11875 * xdisp.c (iterate_out_of_display_property): xassert that
11876 IT->position is set to within IT->object's boundaries. Break from
11877 the loop as soon as EOB is reached; avoids infloops in redisplay
11878 when IT->position is set up wrongly due to some bug.
11879 Set IT->current to match the bidi iterator unconditionally.
11880 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11881 entry. Force push_it to save on the stack the current
11882 buffer/string position, to be restored by pop_it. Fix flags in
11883 the iterator structure wrt the object coming from a display
11884 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11885 properties. (Bug#9284)
11886
11887 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11888
11889 * fontset.c (fontset_get_font_group): Add proper type checks.
11890 (Bug#9172)
11891
11892 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11893
11894 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11895 and LC_VERSION_MIN_MACOSX.
11896 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11897 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11898
11899 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11900
11901 * xdisp.c (forward_to_next_line_start): Allow to use the
11902 no-display-properties-and-no-overlays under bidi display.
11903 Set disp_pos in the bidi iterator to avoid searches for display
11904 properties and overlays.
11905
11906 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11907
11908 * editfns.c (Fset_time_zone_rule): Document relationship with the
11909 setenv function.
11910
11911 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11912 the font entity extracted from the cache (Bug#8109).
11913
11914 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11915
11916 * composite.c (autocmp_chars): Don't reset point. That is done by
11917 restore_point_unwind (Bug#5984).
11918
11919 2011-08-07 Juri Linkov <juri@jurta.org>
11920
11921 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11922 to show the arg `TIME' instead of `TIMEVAL'.
11923
11924 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11925
11926 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11927 display property strides EOL and includes a newline, as in
11928 longlines-mode. (Bug#9254)
11929 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11930 word-wrap under bidirectional display. (Bug#9224)
11931
11932 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11933 is non-zero, even if the data buffer is NULL. Fixes a crash in
11934 vertical-motion with longlines-mode. (Bug#9254)
11935
11936 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11937
11938 * bidi.c <bidi_cache_total_alloc>: Now static.
11939 (bidi_initialize): Initialize bidi_cache_total_alloc.
11940
11941 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11942 cache. (Bug#9221)
11943
11944 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11945 amount allocated this far in `bidi_cache_total_alloc'.
11946 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11947 non-zero, only free the data buffer without restoring the cache
11948 contents. All callers changed.
11949
11950 * dispextern.h (bidi_unshelve_cache): Update prototype.
11951
11952 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11953 (move_it_in_display_line, move_it_to)
11954 (move_it_vertically_backward, move_it_by_lines): Replace the call
11955 to xfree to an equivalent call to bidi_unshelve_cache.
11956 (move_it_in_display_line_to): Fix logic of returning
11957 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11958
11959 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11960
11961 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11962 came from a string character with a `cursor' property. (Bug#9229)
11963
11964 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11965
11966 * Makefile.in (LIB_PTHREAD): New variable.
11967 (LIBES): Add LIB_PTHREAD (Bug#9216).
11968
11969 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11970 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11971
11972 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11973
11974 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11975
11976 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11977
11978 * xterm.c (x_find_topmost_parent): New function.
11979 (x_set_frame_alpha): Find topmost parent window with
11980 x_find_topmost_parent and set the property there also (bug#9181).
11981 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11982
11983 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11984
11985 * callproc.c (Fcall_process): Avoid vfork clobbering
11986 the local vars buffer, coding_systems, current_dir.
11987
11988 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11989
11990 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11991
11992 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11993
11994 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11995 so that it is not optimized away.
11996
11997 * xdisp.c (compute_display_string_pos): Remove unused local.
11998
11999 2011-08-02 Eli Zaretskii <eliz@gnu.org>
12000
12001 Fix slow cursor motion and scrolling in large buffers with
12002 selective display, like Org Mode buffers. (Bug#9218)
12003
12004 * dispextern.h (struct bidi_it): New member disp_prop_p.
12005
12006 * xdisp.c: Remove one-slot cache of display string positions.
12007 (compute_display_string_pos): Accept an additional argument
12008 DISP_PROP_P; callers changed. Scan at most 5K characters forward
12009 for a display string or property. If found, set DISP_PROP_P
12010 non-zero.
12011
12012 * bidi.c (bidi_fetch_char): Accept an additional argument
12013 DISP_PROP_P, and pass it to compute_display_string_pos.
12014 Only handle text covered by a display string if DISP_PROP_P is returned
12015 non-zero. All callers of bidi_fetch_char changed.
12016
12017 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12018
12019 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12020
12021 2010-12-03 Don March <don@ohspite.net>
12022
12023 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12024 last character M-[char] is translated to ESC [char] (bug#7541).
12025
12026 2011-08-02 Kenichi Handa <handa@m17n.org>
12027
12028 * lisp.h (uniprop_table): Extern it.
12029
12030 * chartab.c (uniprop_table): Make it non-static.
12031
12032 2011-08-01 Eli Zaretskii <eliz@gnu.org>
12033
12034 * xdisp.c (forward_to_next_line_start): Accept additional argument
12035 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12036 on the newline.
12037 (reseat_at_next_visible_line_start): Use the bidi iterator state
12038 returned by forward_to_next_line_start to restore the state of
12039 it->bidi_it after backing up to previous newline. (Bug#9212)
12040
12041 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12042
12043 * regex.c (re_comp): Protoize.
12044 (re_exec): Fix return type.
12045 (regexec): Fix type of `ret'. (Bug#9203)
12046
12047 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12048
12049 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12050 This is needed if max-image-size is a floating-point number.
12051
12052 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12053
12054 * print.c (print_object): Print empty symbol as ##.
12055
12056 * lread.c (read1): Read ## as empty symbol.
12057
12058 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12059
12060 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12061 setting frame foreground color (Bug#9175).
12062 (x_set_background_color): Likewise.
12063
12064 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12065 contents (Bug#9176).
12066 (EmacsTooltip -init): Remove bezels and add shadows to
12067 tooltip windows.
12068
12069 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12070 or scroll bar (Bug#8470).
12071
12072 * nsfont.m (nsfont_open): Remove assignment to voffset and
12073 unnecessary vars hshink, expand, hd, full_height, min_height.
12074 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12075
12076 * nsterm.h (nsfont_info): Remove voffset field.
12077
12078 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12079
12080 Implement strike-through and overline on NextStep (Bug#8863).
12081
12082 * nsfont.m (nsfont_open): Use underline position provided by font,
12083 instead of hard-coded value of 2.
12084 (nsfont_draw): Call ns_draw_text_decoration instead.
12085
12086 * nsterm.h: Add declaration for ns_draw_text_decoration.
12087
12088 * nsterm.m (ns_draw_text_decoration): New function for drawing
12089 underline, overline, and strike-through.
12090 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12091 ns_draw_text_decoration. Change treatment of cursor drawing to
12092 accommodate underlining, etc.
12093
12094 2011-07-28 Eli Zaretskii <eliz@gnu.org>
12095
12096 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12097 default.
12098
12099 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12100
12101 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12102 Without this fix, if a signal arrives just after memory fills up,
12103 'malloc' might be invoked reentrantly.
12104
12105 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12106 In other words, assume that every image size is allowed, on non-X
12107 hosts. This assumption is probably wrong, but it lets Emacs compile.
12108
12109 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12110
12111 * regex.c (re_iswctype): Convert return values to boolean.
12112
12113 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12114
12115 * xdisp.c (compute_display_string_pos): Don't use cached display
12116 string position if the buffer had its restriction changed.
12117 (Bug#9184)
12118
12119 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12120
12121 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12122
12123 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12124
12125 Integer signedness and overflow and related fixes. (Bug#9079)
12126
12127 * bidi.c: Integer size and overflow fixes.
12128 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12129 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12130 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12131 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12132 (bidi_find_other_level_edge):
12133 Use ptrdiff_t instead of EMACS_INT where either will do.
12134 This works better on 32-bit hosts configured --with-wide-int.
12135 (bidi_cache_ensure_space): Check for size-calculation overflow.
12136 Use % rather than repeated addition, for better worst-case speed.
12137 Don't set bidi_cache_size until after xrealloc returns, because it
12138 might not return.
12139 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12140 (bidi_cache_ensure_space): Also check that the bidi cache size
12141 does not exceed that of the largest Lisp string or buffer. See Eli
12142 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12143
12144 * alloc.c (__malloc_size_t): Remove.
12145 All uses replaced by size_t. See Andreas Schwab's note
12146 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12147
12148 * image.c: Improve checking for integer overflow.
12149 (check_image_size): Assume that f is nonnull, since
12150 it is always nonnull in practice. This is one less thing to
12151 worry about when checking for integer overflow later.
12152 (x_check_image_size): New function, which checks for integer
12153 overflow issues inside X.
12154 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12155 This removes the need for a memory_full check.
12156 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12157 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12158 (xbm_read_bitmap_data): Change locals back to 'int', since
12159 their values must fit in 'int'.
12160 (xpm_load_image, png_load, tiff_load):
12161 Invoke x_create_x_image_and_pixmap earlier,
12162 to avoid much needless work if the image is too large.
12163 (tiff_load): Treat overly large images as if
12164 x_create_x_image_and_pixmap failed, not as malloc failures.
12165 (gs_load): Use x_check_image_size.
12166
12167 * gtkutil.c: Omit integer casts.
12168 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12169 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12170
12171 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12172
12173 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12174 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12175 would wrongly return t on a 64-bit host.
12176
12177 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12178 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12179 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12180 and therefore cause GCC to emit a bogus diagnostic in some cases.
12181
12182 * image.c: Integer signedness and overflow and related fixes.
12183 This is not an exhaustive set of fixes, but it's time to
12184 record what I've got.
12185 (lookup_pixel_color, check_image_size): Remove redundant decls.
12186 (check_image_size): Don't assume that arbitrary EMACS_INT values
12187 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12188 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12189 (tiff_load, imagemagick_load_image):
12190 Check for overflow in size calculations.
12191 (x_create_x_image_and_pixmap): Remove unnecessary test for
12192 xmalloc returning NULL; that can't happen.
12193 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12194 (xpm_color_bucket): Use better integer hashing function.
12195 (xpm_cache_color): Don't possibly over-allocate memory.
12196 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12197 (gif_memory_source):
12198 Use ptrdiff_t, not int or size_t, to record sizes.
12199 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12200 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12201 either works, as we prefer signed integers.
12202 (tiff_read_from_memory, tiff_write_from_memory):
12203 Return tsize_t, not size_t, since that's what the TIFF API wants.
12204 (tiff_read_from_memory): Don't fail simply because the read would
12205 go past EOF; instead, return a short read.
12206 (tiff_load): Omit no-longer-needed casts.
12207 (Fimagemagick_types): Don't assume size fits into 'int'.
12208
12209 Improve hashing quality when configured --with-wide-int.
12210 * fns.c (hash_string): New function, taken from sxhash_string.
12211 Do not discard information about ASCII character case; this
12212 discarding is no longer needed.
12213 (sxhash-string): Use it. Change sig to match it. Caller changed.
12214 * lisp.h: Declare it.
12215 * lread.c (hash_string): Remove, since we now use fns.c's version.
12216 The fns.c version returns a wider integer if --with-wide-int is
12217 specified, so this should help the quality of the hashing a bit.
12218
12219 * emacs.c: Integer overflow minor fix.
12220 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12221 Define only if GNU_LINUX.
12222 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12223
12224 * dispnew.c: Integer signedness and overflow fixes.
12225 Remove unnecessary forward decls, that were a maintenance hassle.
12226 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12227 All uses changed.
12228 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12229 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12230 (prepare_desired_row, line_draw_cost):
12231 Use int, not unsigned, where either works.
12232 (save_current_matrix, restore_current_matrix):
12233 Use ptrdiff_t, not size_t, where either works.
12234 (init_display): Check for overflow more accurately, and without
12235 relying on undefined behavior.
12236
12237 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12238 Remove, replacing with the new symbols in lisp.h. All uses changed.
12239 * fileio.c (make_temp_name):
12240 * filelock.c (lock_file_1, lock_file):
12241 * xdisp.c (message_dolog):
12242 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12243 Use pMd etc. instead.
12244 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12245 replacing the pWIDE etc. symbols removed from editfns.c.
12246
12247 * keyboard.h (num_input_events): Now uintmax_t.
12248 This is (very slightly) less likely to mess up due to wraparound.
12249 All uses changed.
12250
12251 * buffer.c: Integer signedness fixes.
12252 (alloc_buffer_text, enlarge_buffer_text):
12253 Use ptrdiff_t rather than size_t when either will do, as we prefer
12254 signed integers.
12255
12256 * alloc.c: Integer signedness and overflow fixes.
12257 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12258 (__malloc_size_t): Default to size_t, not to int.
12259 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12260 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12261 Prefer ptrdiff_t to size_t when either would do, as we prefer
12262 signed integers.
12263 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12264 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12265 Now const. Initialize with values that are in range even if char
12266 is signed.
12267 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12268 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12269 These functions do the right thing with sizes > 2**32.
12270 (check_depth): Now ptrdiff_t, not int.
12271 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12272 Adjust to new way of storing sizes. Check for size overflow bugs
12273 in rest of code.
12274 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12275 slightly wrong anyway, as it missed one instance of
12276 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12277 (refill_memory_reserve): Omit needless cast to size_t.
12278 (mark_object_loop_halt): Mark as externally visible.
12279
12280 * xselect.c: Integer signedness and overflow fixes.
12281 (Fx_register_dnd_atom, x_handle_dnd_message):
12282 Use ptrdiff_t, not size_t, since we prefer signed.
12283 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12284 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12285 x_dnd_atoms_size and x_dnd_atoms_length.
12286
12287 * doprnt.c: Prefer signed to unsigned when either works.
12288 * eval.c (verror):
12289 * doprnt.c (doprnt):
12290 * lisp.h (doprnt):
12291 * xdisp.c (vmessage):
12292 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12293 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12294 prefer signed arithmetic to avoid comparison confusion.
12295 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12296 but is a bit tricky.
12297
12298 Assume freestanding C89 headers, string.h, stdlib.h.
12299 * data.c, doprnt.c, floatfns.c, print.c:
12300 Include float.h unconditionally.
12301 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12302 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12303 * regex.c: Likewise for stddef.h, string.h.
12304 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12305 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12306 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12307 (STDC_HEADERS): Remove obsolete defines.
12308 * sysdep.c: Include limits.h unconditionally.
12309
12310 Assume support for memcmp, memcpy, memmove, memset.
12311 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12312 * regex.c (memcmp, memcpy):
12313 Remove; we assume C89 now.
12314
12315 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12316 (__malloc_safe_bcopy): Remove; no longer needed.
12317
12318 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12319 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12320 well either way, and we prefer signed to unsigned.
12321
12322 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12323
12324 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12325 closes the connection while we're reading (bug#9182).
12326
12327 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12328
12329 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12330 are specified (Bug#9168).
12331
12332 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12333
12334 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12335 Found by GCC static checking and --with-wide-int on a 32-bit host.
12336
12337 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12338
12339 * xdisp.c (compute_display_string_pos): Fix logic of caching
12340 previous display string position. Initialize cached_prev_pos to
12341 -1. Fixes slow-down at the beginning of a buffer.
12342
12343 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12344
12345 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12346 for attrs[LFACE_FONTSET_INDEX].
12347
12348 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12349
12350 * xml.c (parse_region): Remove unused local
12351 that was recently introduced.
12352
12353 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12354
12355 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12356 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12357
12358 * xdisp.c (move_it_in_display_line_to): Record the best matching
12359 position for TO_CHARPOS while scanning the line, and restore it on
12360 exit if none of the characters scanned was an exact match.
12361 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12362 when exact match is impossible due to invisible text, and the
12363 lines are truncated.
12364
12365 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12366
12367 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12368 for OSX >= 10.7.
12369
12370 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12371
12372 Fix a significant slow-down of cursor motion with C-n, C-p,
12373 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12374 auto-repeat under bidi redisplay in fontified buffers.
12375 * xdisp.c (compute_stop_pos_backwards): New function.
12376 (next_element_from_buffer): Call compute_stop_pos_backwards to
12377 find a suitable prev_stop when we find ourselves before
12378 base_level_stop.
12379 (reseat): Don't look for prev_stop, as that could mean a very long
12380 run.
12381 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12382 <cached_disp_overlay_modiff>: Cache for last found display string
12383 position.
12384 (compute_display_string_pos): Return the cached position if asked
12385 about the same buffer in the same area of character positions, and
12386 the buffer wasn't changed since the time the display string
12387 position was cached.
12388
12389 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12390
12391 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12392 is an integer, which is important for empty lines. (Bug#9149)
12393
12394 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
12395
12396 * frame.c (Fmodify_frame_parameters): In tty case, update the
12397 default face if necessary (Bug#4238).
12398
12399 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
12400
12401 * editfns.c (Fstring_to_char): No need to explain what a character
12402 is in the docstring (Bug#6576).
12403
12404 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12405
12406 * xml.c (parse_region): Make sure we always return a tree.
12407
12408 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12409
12410 * xml.c (parse_region): If a document contains only comments,
12411 return that, too.
12412
12413 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12414
12415 * xml.c (make_dom): Return comments, too.
12416
12417 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12418
12419 Port to OpenBSD.
12420 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12421 and the surrounding thread.
12422 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12423 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12424 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12425 timer goes off.
12426 * s/openbsd.h (BROKEN_SIGIO): Define.
12427 * unexelf.c (unexec) [__OpenBSD__]:
12428 Don't update the .mdebug section of the Alpha COFF symbol table.
12429
12430 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12431
12432 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12433 (bug#8460).
12434
12435 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12436
12437 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12438 This fixes some race conditions on the permissions of any newly
12439 created file.
12440
12441 * alloc.c (valid_pointer_p): Use pipe, not open.
12442 This fixes some permissions issues when debugging.
12443
12444 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12445 If fchown fails to set both uid and gid, try to set just gid,
12446 as that is sometimes allowed. Adjust the file's mode to eliminate
12447 setuid or setgid bits that are inappropriate if fchown fails.
12448
12449 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12450
12451 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12452 to compare Lisp_Objects.
12453 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12454 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12455 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12456
12457 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12458
12459 * lread.c (read_integer): Unread even EOF character.
12460 (read1): Likewise. Properly record start position of symbol.
12461
12462 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12463 symbol character follows.
12464
12465 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12466
12467 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12468 This works around a problem with the previous change to Fcopy_file.
12469 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12470 and without this change, GCC might complain about discarding
12471 fchown's return value.
12472
12473 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
12474
12475 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12476
12477 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12478
12479 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12480
12481 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12482
12483 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12484 it's used from the C level.
12485
12486 * process.c: Use the same condition for POLL_FOR_INPUT in both
12487 keyboard.c and process.c (bug#1858).
12488
12489 2011-07-09 Lawrence Mitchell <wence@gmx.li>
12490
12491 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12492 (Fgnutls_boot): Use it.
12493
12494 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12495
12496 * doc.c (Fsubstitute_command_keys): Revert last change.
12497
12498 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12499
12500 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12501 quotes the next character, and doesn't affect other longer
12502 sequences (bug#8935).
12503
12504 * lread.c (syms_of_lread): Clarify that is isn't only
12505 `eval-buffer' and `eval-defun' that's affected by
12506 `lexical-binding' (bug#8460).
12507
12508 2011-07-15 Eli Zaretskii <eliz@gnu.org>
12509
12510 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12511 bidi redisplay when a line includes both an image and is truncated.
12512
12513 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12514
12515 Fix minor problems found by static checking.
12516 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12517 (elsz): Now a signed constant, not a size_t var. We prefer signed
12518 types to unsigned, to avoid integer comparison confusion. Without
12519 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12520 "cannot optimize loop, the loop counter may overflow", a symptom
12521 of the confusion.
12522 * indent.c (Fvertical_motion): Mark locals as initialized.
12523 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12524
12525 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12526
12527 * search.c (Fre_search_backward): Mention `case-fold-search' in
12528 all the re_search_* functions (bug#8138).
12529
12530 * keyboard.c (Fopen_dribble_file): Document when the file is
12531 closed (bug#8056).
12532
12533 2011-07-14 Eli Zaretskii <eliz@gnu.org>
12534
12535 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12536 bidi_cache_idx.
12537
12538 Support bidi reordering of display and overlay strings.
12539 * xdisp.c (compute_display_string_pos)
12540 (compute_display_string_end): Accept additional argument STRING.
12541 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12542 (reseat_to_string): Initialize bidi_it->string.s and
12543 bidi_it->string.schars.
12544 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12545 NULL (avoids a crash in bidi_paragraph_init).
12546 Initialize itb.string.lstring.
12547 (init_iterator): Call bidi_init_it only of a valid
12548 buffer position was specified. Initialize paragraph_embedding to
12549 L2R.
12550 (reseat_to_string): Initialize the bidi iterator.
12551 (display_string): If we need to ignore text properties of
12552 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12553 original value of -1 will not work with bidi.)
12554 (compute_display_string_pos): First arg is now struct
12555 `text_pos *'; all callers changed. Support display properties on
12556 Lisp strings.
12557 (compute_display_string_end): Support display properties on Lisp
12558 strings.
12559 (init_iterator, reseat_1, reseat_to_string): Initialize the
12560 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12561 when iterating on a string not from display properties).
12562 (compute_display_string_pos, compute_display_string_end):
12563 Fix calculation of the object to scan. Fixes an error when using
12564 arrow keys.
12565 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12566 base_level_stop; instead, set base_level_stop to BEGV.
12567 Fixes crashes in vertical-motion.
12568 (next_element_from_buffer): Improve commentary for when
12569 the iterator is before prev_stop.
12570 (init_iterator): Initialize bidi_p from the default value of
12571 bidi-display-reordering, not from buffer-local value. Use the
12572 buffer-local value only if initializing for buffer iteration.
12573 (handle_invisible_prop): Support invisible properties on strings
12574 that are being bidi-reordered.
12575 (set_iterator_to_next): Support bidi reordering of C strings and
12576 Lisp strings.
12577 (next_element_from_string): Support bidi reordering of Lisp
12578 strings.
12579 (handle_stop_backwards): Support Lisp strings as well.
12580 (display_string): Support display of R2L glyph rows.
12581 Use IT_STRING_CHARPOS when displaying from a Lisp string.
12582 (init_iterator): Don't initialize it->bidi_p for strings
12583 here.
12584 (reseat_to_string): Initialize it->bidi_p for strings here.
12585 (next_element_from_string, next_element_from_c_string)
12586 (next_element_from_buffer): Add xassert's for correspondence
12587 between IT's object being iterated and it->bidi_it.string
12588 structure.
12589 (face_before_or_after_it_pos): Support bidi iteration.
12590 (next_element_from_c_string): Handle the case of the first string
12591 character that is not the first one in the visual order.
12592 (get_visually_first_element): New function, refactored from common
12593 parts of next_element_from_buffer, next_element_from_string, and
12594 next_element_from_c_string.
12595 (tool_bar_lines_needed, redisplay_tool_bar)
12596 (display_menu_bar): Force left-to-right direction. Add a FIXME
12597 comment for making that be controlled by a user option.
12598 (push_it, pop_it): Save and restore the state of the
12599 bidi iterator. Save and restore the bidi_p flag.
12600 (pop_it): Iterate out of display property for string iteration as
12601 well.
12602 (iterate_out_of_display_property): Support iteration over strings.
12603 (handle_single_display_spec): Set up it->bidi_it for iteration
12604 over a display string, and call bidi_init_it.
12605 (handle_single_display_spec, next_overlay_string)
12606 (get_overlay_strings_1, push_display_prop): Set up the bidi
12607 iterator for displaying display or overlay strings.
12608 (forward_to_next_line_start): Don't use the shortcut if
12609 bidi-iterating.
12610 (back_to_previous_visible_line_start): If handle_display_prop
12611 pushed the iterator stack, restore the internal state of the bidi
12612 iterator by calling bidi_pop_it same number of times.
12613 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12614 and we are bidi-iterating, don't decrement the iterator position;
12615 instead, set the first_elt flag in the bidi iterator, to produce
12616 the same effect.
12617 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12618 (push_display_prop): xassert that we are iterating a buffer.
12619 (push_it, pop_it): Save and restore paragraph_embedding member.
12620 (handle_single_display_spec, next_overlay_string)
12621 (get_overlay_strings_1, reseat_1, reseat_to_string)
12622 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12623 correctly. Don't assume unibyte strings are not bidi-reordered.
12624 (compute_display_string_pos)
12625 (compute_display_string_end): Fix handling the case of C string.
12626 (push_it, pop_it): Save and restore from_disp_prop_p.
12627 (handle_single_display_spec, push_display_prop): Set the
12628 from_disp_prop_p flag.
12629 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12630 (pop_it): Call iterate_out_of_display_property only if we are
12631 popping after iteration over a string that came from a display
12632 property. Fix a typo in popping stretch info. Add an assertion
12633 for verifying that the iterator position is in sync with the bidi
12634 iterator.
12635 (handle_single_display_spec, get_overlay_strings_1)
12636 (push_display_prop): Fix initialization of paragraph direction for
12637 string when that of the parent object is not yet determined.
12638 (reseat_1): Call bidi_init_it to resync the bidi
12639 iterator with IT's position. (Bug#7616)
12640 (find_row_edges): If ROW->start.pos gives position
12641 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12642 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12643 Reset the from_disp_prop_p flag.
12644 (SAVE_IT, RESTORE_IT): New macros.
12645 (pos_visible_p, face_before_or_after_it_pos)
12646 (back_to_previous_visible_line_start)
12647 (move_it_in_display_line_to, move_it_in_display_line)
12648 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12649 (try_scrolling, redisplay_window, display_line): Use them when
12650 saving a temporary copy of the iterator and restoring it back.
12651 (back_to_previous_visible_line_start, reseat_1)
12652 (init_iterator): Empty the bidi cache "stack".
12653 (move_it_in_display_line_to): If iterator ended up at
12654 EOL, but we never saw any buffer positions smaller than
12655 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12656 motion in bidi-reordered lines.
12657 (move_it_in_display_line_to): Record prev_method and prev_pos
12658 immediately before the call to set_iterator_to_next. Fixes cursor
12659 motion in bidi-reordered lines with stretch glyphs and strings
12660 displayed in margins. (Bug#8133) (Bug#8867)
12661 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12662 TO_CHARPOS.
12663 (pos_visible_p): Support positions in bidi-reordered lines.
12664 Save and restore bidi cache.
12665
12666 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12667 (bidi_paragraph_info): Delete unused struct.
12668 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12669 (bidi_cache_start): New variable.
12670 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12671 to zero.
12672 (bidi_cache_fetch_state, bidi_cache_search)
12673 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12674 (bidi_cache_find, bidi_peek_at_next_level)
12675 (bidi_level_of_next_char, bidi_find_other_level_edge)
12676 (bidi_move_to_visually_next): Compare cache index with
12677 bidi_cache_start rather than with zero.
12678 (bidi_fetch_char): Accept new argument STRING; all callers
12679 changed. Support iteration over a string. Support strings with
12680 display properties. Support unibyte strings. Fix the type of
12681 `len' according to what STRING_CHAR_AND_LENGTH expects.
12682 (bidi_paragraph_init, bidi_resolve_explicit_1)
12683 (bidi_resolve_explicit, bidi_resolve_weak)
12684 (bidi_level_of_next_char, bidi_move_to_visually_next):
12685 Support iteration over a string.
12686 (bidi_set_sor_type, bidi_resolve_explicit_1)
12687 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12688 can now be zero (for strings); special values 0 and -1 were
12689 changed to -1 and -2, respectively.
12690 (bidi_char_at_pos): New function.
12691 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12692 Call it instead of FETCH_MULTIBYTE_CHAR.
12693 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12694 initialized to valid values.
12695 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12696 values.
12697 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12698 the test for valid cached positions. Fix the logic for looking up
12699 the sentinel state in the cache. GCPRO the Lisp string we are
12700 iterating.
12701 (bidi_push_it, bidi_pop_it): New functions.
12702 (bidi_initialize): Initialize the bidi cache start stack pointer.
12703 (bidi_cache_ensure_space): New function, refactored from part of
12704 bidi_cache_iterator_state. Don't assume the required size is just
12705 one BIDI_CACHE_CHUNK away.
12706 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12707 (bidi_count_bytes, bidi_char_at_pos): New functions.
12708 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12709 always valid if bidi_cache_idx is valid.
12710 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12711 is valid if it's going to be used.
12712 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12713 (bidi_cache_fetch_state, bidi_cache_search)
12714 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12715 (bidi_cache_iterator_state, bidi_cache_find)
12716 (bidi_find_other_level_edge, bidi_cache_start_stack):
12717 All variables related to cache indices are now EMACS_INT.
12718
12719 * dispextern.h (struct bidi_string_data): New structure.
12720 (struct bidi_it): New member `string'. Make flag members be 1-bit
12721 fields, and put them last in the struct.
12722 (compute_display_string_pos, compute_display_string_end):
12723 Update prototypes.
12724 (bidi_push_it, bidi_pop_it): Add prototypes.
12725 (struct iterator_stack_entry): New members bidi_p,
12726 paragraph_embedding, and from_disp_prop_p.
12727 (struct it): Member bidi_p is now a bit field 1 bit wide.
12728 (bidi_shelve_cache, bidi_unshelve_cache):
12729 Declare prototypes.
12730
12731 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12732 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12733 and vector-like objects.
12734
12735 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12736 cache around display iteration.
12737
12738 * window.c (Fwindow_end, window_scroll_pixel_based)
12739 (displayed_window_lines, Frecenter): Save and restore the bidi
12740 cache around display iteration.
12741
12742 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12743
12744 * editfns.c (Fdelete_region): Clarify the use of the named
12745 parameters (bug#6788).
12746
12747 2011-07-14 Martin Rudalics <rudalics@gmx.at>
12748
12749 * indent.c (Fvertical_motion): Set and restore w->pointm when
12750 saving and restoring the window's buffer (Bug#9006).
12751
12752 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12753
12754 * editfns.c (Fstring_to_char): Clarify just what is returned
12755 (bug#6576). Text by Eli Zaretskii.
12756
12757 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
12758
12759 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12760
12761 2011-07-13 Eli Zaretskii <eliz@gnu.org>
12762
12763 * buffer.c (mmap_find): Fix a typo.
12764
12765 2011-07-13 Johan Bockgård <bojohan@gnu.org>
12766
12767 Fix execution of x selection hooks.
12768 * xselect.c (Qx_lost_selection_functions)
12769 (Qx_sent_selection_functions): New vars.
12770 (syms_of_xselect): DEFSYM them.
12771 (x_handle_selection_request): Pass Qx_sent_selection_functions
12772 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12773 (x_handle_selection_clear,x_clear_frame_selections):
12774 Pass Qx_lost_selection_functions rather than
12775 Vx_lost_selection_functions to Frun_hook_with_args.
12776
12777 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12778
12779 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12780 The old code sometimes used this field without initializing it.
12781
12782 * alloc.c (gc_sweep): Don't read past end of array.
12783 In theory, the old code could also have corrupted Emacs internals,
12784 though it'd be very unlikely.
12785
12786 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12787
12788 * character.c (Fcharacterp): Don't advertise optional ignored
12789 argument. (Bug#4026)
12790
12791 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12792
12793 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12794 key" (bug#4257).
12795
12796 * window.c (Fset_window_start): Doc fix (bug#4199).
12797 (Fset_window_hscroll): Ditto.
12798
12799 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12800
12801 Fix minor new problems caught by GCC 4.6.1.
12802 * term.c (init_tty): Remove unused local.
12803 * xsettings.c (store_monospaced_changed): Define this function only
12804 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12805 not used otherwise.
12806
12807 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
12808
12809 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12810
12811 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12812
12813 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12814 are the mini-buffer and the echo area (bug#3320).
12815
12816 * term.c (init_tty): Remove support for supdup, c10 and perq
12817 terminals, which are no longer supported (bug#1482).
12818
12819 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12820
12821 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12822
12823 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12824
12825 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12826 for non-popups (Bug#3642).
12827
12828 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12829
12830 * alloc.c (reset_malloc_hooks): Protoize.
12831 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12832 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12833 * cm.c (losecursor): Likewise.
12834 * data.c (fmod): Likewise.
12835 * dispnew.c (swap_glyphs_in_rows): Likewise.
12836 * emacs.c (memory_warning_signal): Likewise.
12837 * floatfns.c (float_error): Likewise.
12838 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12839 (otf_open, font_otf_capability, generate_otf_features)
12840 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12841 Likewise.
12842 * image.c (pbm_read_file): Likewise.
12843 * indent.c (string_display_width): Likewise.
12844 * intervals.c (check_for_interval, search_for_interval)
12845 (inc_interval_count, count_intervals, root_interval)
12846 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12847 * lread.c (defalias): Likewise.
12848 * ralloc.c (r_alloc_check): Likewise.
12849 * regex.c (set_image_of_range_1, set_image_of_range)
12850 (regex_grow_registers): Likewise.
12851 * sysdep.c (strerror): Likewise.
12852 * termcap.c (valid_filename_p, tprint, main): Likewise.
12853 * tparam.c (main): Likewise.
12854 * unexhp9k800.c (run_time_remap, save_data_space)
12855 (update_file_ptrs, read_header, write_header, calculate_checksum)
12856 (copy_file, copy_rest, display_header): Likewise.
12857 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12858 Likewise.
12859 * xdisp.c (check_it): Likewise.
12860 * xfaces.c (register_color, unregister_color, unregister_colors):
12861 Likewise.
12862 * xfns.c (print_fontset_result): Likewise.
12863 * xrdb.c (member, fatal, main): Likewise.
12864
12865 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12866
12867 Fix minor problems found by static checking (Bug#9031).
12868 * chartab.c (char_table_set_range, map_sub_char_table):
12869 Remove unused locals.
12870 (uniprop_table): Now static.
12871 * composite.c (_work_char): Remove unused static var.
12872
12873 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12874
12875 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12876
12877 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12878
12879 * gtkutil.c (qttip_cb): Remove code without function.
12880
12881 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12882
12883 * w32.c (pthread_sigmask): New stub.
12884
12885 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12886
12887 Use pthread_sigmask, not sigprocmask (Bug#9010).
12888 sigprocmask is portable only for single-threaded applications, and
12889 Emacs can be multi-threaded when it uses GTK.
12890 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12891 (LIBES): Use it.
12892 * callproc.c (Fcall_process):
12893 * process.c (create_process):
12894 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12895 Use pthread_sigmask, not sigprocmask.
12896
12897 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12898
12899 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12900 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12901 wrong (Bug#8591).
12902
12903 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12904
12905 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12906 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12907 (xg_hide_tooltip): Fix comment.
12908
12909 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12910 in registerServicesMenuSendTypes.
12911 (validRequestorForSendType): Don't check ns_return_types.
12912
12913 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12914 ns_return_type.
12915
12916 2011-07-08 Jason Rumney <jasonr@gnu.org>
12917
12918 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12919 SH_SHOW for hidden windows (Bug#5482).
12920
12921 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12922 frame struct members of non-existent frames (Bug#6284).
12923
12924 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12925
12926 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12927 variable firstTime not needed on OSX >= 10.6.
12928 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12929 >= 10.5. Use setKnobProportion, setDoubleValue.
12930
12931 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12932 (MAC_OS_X_VERSION_10_5): Define if not defined.
12933 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12934 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12935 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12936
12937 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12938 cString and lossyCString on OSX >= 10.4.
12939
12940 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12941 sizeToFit on OSX >= 10.2.
12942
12943 * nsimage.m (allocInitFromFile): Don't use deprecated method
12944 bestRepresentationForDevice on OSX >= 10.6.
12945
12946 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12947 to avoid warning.
12948
12949 * emacs.c: Declare unexec_init_emacs_zone.
12950
12951 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12952
12953 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12954
12955 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12956 on svcsMenu (Bug#8842).
12957
12958 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12959 ns_return_types.
12960 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12961
12962 * nsterm.m (QUTF8_STRING): Declare.
12963 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12964 (validRequestorForSendType): Return type is (id).
12965 Change indexOfObjectIdenticalTo to indexOfObject.
12966 Check if we have local selection before returning self (Bug#8842).
12967 (writeSelectionToPasteboard): Put local selection into paste board
12968 if we have a local selection (Bug#8842).
12969 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12970
12971 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12972 (ns_get_local_selection): Declare.
12973
12974 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12975
12976 * keymap.c (describe_map_tree): Don't insert a double newline at
12977 the end of the buffer (bug#1169) and return whether we inserted
12978 something.
12979
12980 * callint.c (Fcall_interactively): Change "reading args" to
12981 "providing args" to try to clarify what it does (bug#1010).
12982
12983 2011-07-07 Kenichi Handa <handa@m17n.org>
12984
12985 * composite.c (composition_compute_stop_pos): Ignore a static
12986 composition starting before CHARPOS (Bug#8915).
12987
12988 * xdisp.c (handle_composition_prop): Likewise.
12989
12990 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12991
12992 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12993 (Bug#9015)
12994
12995 2011-07-07 Kenichi Handa <handa@m17n.org>
12996
12997 * character.h (unicode_category_t): New enum type.
12998
12999 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13000 (Qchar_code_property_table): New variable.
13001 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13002 (UNIPROP_COMPRESSED_FORM_P): New macros.
13003 (char_table_ascii): Uncompress the compressed values.
13004 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13005 Uncompress the compressed values.
13006 (sub_char_table_ref_and_range): Likewise.
13007 (char_table_ref_and_range): Uncompress the compressed values.
13008 (sub_char_table_set): New arg is_uniprop. Callers changed.
13009 Uncompress the compressed values.
13010 (sub_char_table_set_range): Args changed. Callers changed.
13011 (char_table_set_range): Adjuted for the above change.
13012 (map_sub_char_table): Delete args default_val and parent. Add arg
13013 top. Give decoded values to a Lisp function.
13014 (map_char_table): Adjust for the above change. Give decoded
13015 values to a Lisp function. Gcpro more variables.
13016 (uniprop_table_uncompress)
13017 (uniprop_decode_value_run_length): New functions.
13018 (uniprop_decoder, uniprop_decoder_count): New variables.
13019 (uniprop_get_decoder, uniprop_encode_value_character)
13020 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13021 New functions.
13022 (uniprop_encoder, uniprop_encoder_count): New variables.
13023 (uniprop_get_encoder, uniprop_table)
13024 (Funicode_property_table_internal, Fget_unicode_property_internal)
13025 (Fput_unicode_property_internal): New functions.
13026 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13027 Sunicode_property_table_internal, Sget_unicode_property_internal,
13028 and Sput_unicode_property_internal. Defvar_lisp
13029 char-code-property-alist.
13030
13031 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13032 Vunicode_category_table.
13033
13034 * font.c (font_range): Adjust for the change of
13035 Vunicode_category_table.
13036
13037 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13038
13039 * m/iris4d.h: Remove file, move contents ...
13040 * s/irix6-5.h: ... here.
13041
13042 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13043
13044 Remove unportable assumption about struct layout (Bug#8884).
13045 * alloc.c (mark_buffer):
13046 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13047 (clone_per_buffer_values): Don't assume that
13048 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13049 This isn't true in general, and it's particularly not true
13050 if Emacs is configured with --with-wide-int.
13051 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13052 New macros, used in the buffer.c change.
13053
13054 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13055
13056 * xsettings.c: Use both GConf and GSettings if both are available.
13057 (store_config_changed_event): Add comment.
13058 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13059 (store_tool_bar_style_changed): New functions.
13060 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
13061 (struct xsettings): Move font inside HAVE_XFT.
13062 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13063 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13064 Move inside HAVE_XFT.
13065 (something_changed_gsettingsCB): Rename from something_changedCB.
13066 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13067 also.
13068 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13069 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
13070 (something_changed_gconfCB): Rename from something_changedCB.
13071 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13072 (parse_settings): Move check for font inside HAVE_XFT.
13073 (read_settings, apply_xft_settings): Add comment.
13074 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13075 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13076 call store_font_name_changed.
13077 (xft_settings_event): Add comment.
13078 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13079 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13080 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13081 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13082 (xsettings_initialize): Call init_gsettings last.
13083 (xsettings_get_system_font, xsettings_get_system_normal_font):
13084 Add comment.
13085
13086 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13087
13088 Random fixes. E.g., (random) never returned negative values.
13089 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13090 subseconds part to the entropy, as that's a bit more random.
13091 Prefer signed to unsigned, since the signedness doesn't matter and
13092 in general we prefer signed. When given a limit, use a
13093 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13094 latter isn't right if USE_2_TAGS_FOR_INTS.
13095 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13096 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13097
13098 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13099
13100 * textprop.c (text_property_stickiness):
13101 Obey Vtext_property_default_nonsticky.
13102 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13103 * w32fns.c (syms_of_w32fns):
13104 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13105
13106 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13107
13108 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13109 This is more efficient than Ffile_directory_p and avoids a minor race.
13110
13111 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13112
13113 * buffer.c (Foverlay_put): Say what the return value is
13114 (bug#7835).
13115
13116 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13117 is a directory before asking whether to use the file name
13118 (bug#7564).
13119 (barf_or_query_if_file_exists): Make the "File is a directory"
13120 error be more correct.
13121
13122 * fns.c (Frequire): Remove the mention of the .gz files, since
13123 that's installation-specific, but keep the mention of
13124 `get-load-suffixes'.
13125
13126 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13127
13128 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13129 Report string overflow if the output is too long.
13130
13131 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
13132
13133 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13134 (syms_of_gnutls): Remove duplicate DEFSYM for
13135 Qgnutls_bootprop_verify_hostname_error, an error for
13136 Qgnutls_bootprop_verify_error (which is no longer used).
13137
13138 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13139 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13140 Also (re)move comments that are misplaced or no longer relevant.
13141
13142 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13143
13144 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13145
13146 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
13147
13148 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13149 and background color parameters if they have been changed.
13150
13151 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13152
13153 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13154
13155 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13156
13157 * xsettings.c (SYSTEM_FONT): Define only when used.
13158 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13159
13160 * keymap.c (access_keymap_1): Now static.
13161
13162 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
13163
13164 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13165 leave any prefix arg for the up event (Bug#1586).
13166
13167 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13168
13169 * lread.c (syms_of_lread): Mention single symbols defined by
13170 `defvar' or `defconst' (bug#7154).
13171
13172 * fns.c (Frequire): Mention .el.gz files (bug#7314).
13173 (Frequire): Mention get-load-suffixes.
13174
13175 2011-07-02 Martin Rudalics <rudalics@gmx.at>
13176
13177 * window.h (window): Remove clone_number slot.
13178 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13179 Remove.
13180 (make_parent_window, make_window, saved_window)
13181 (Fset_window_configuration, save_window_save): Don't deal with
13182 clone numbers.
13183 * buffer.c (Qclone_number): Remove declaration.
13184 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13185
13186 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13187
13188 Add multiple inheritance to keymaps.
13189 * keymap.c (Fmake_composed_keymap): New function.
13190 (Fset_keymap_parent): Simplify.
13191 (fix_submap_inheritance): Remove.
13192 (access_keymap_1): New function extracted from access_keymap to handle
13193 embedded parents and handle lists of maps.
13194 (access_keymap): Use it.
13195 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13196 (Fcopy_keymap): Handle embedded parents.
13197 (Fcommand_remapping, define_as_prefix): Simplify.
13198 (Fkey_binding): Simplify.
13199 (syms_of_keymap): Move minibuffer-local-completion-map,
13200 minibuffer-local-filename-completion-map,
13201 minibuffer-local-must-match-map, and
13202 minibuffer-local-filename-must-match-map to Elisp.
13203 (syms_of_keymap): Defsubr make-composed-keymap.
13204 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13205 (parse_menu_item): Trivial simplification.
13206
13207 2011-07-01 Glenn Morris <rgm@gnu.org>
13208
13209 * Makefile.in (SETTINGS_LIBS): Fix typo.
13210
13211 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13212
13213 * coding.c (Fencode_coding_string): Record the last coding system
13214 used, as the function doc string says (bug#8738).
13215
13216 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13217
13218 * xsettings.c (store_monospaced_changed): Take new font as arg and
13219 check for change against current_mono_font.
13220 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13221 (emacs_settings_constructor, emacs_settings_get_property)
13222 (emacs_settings_set_property, emacs_settings_class_init)
13223 (emacs_settings_init, gsettings_obj): Remove.
13224 (something_changedCB): New function for HAVE_GSETTINGS.
13225 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13226 with value as argument.
13227 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13228 g_settings_new (Bug#8967). Do not create gsettings_obj.
13229 Remove calls to g_settings_bind. Connect something_changedCB to
13230 "changed".
13231
13232 * xgselect.c: Add defined (HAVE_GSETTINGS).
13233 (xgselect_initialize): Ditto.
13234
13235 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13236 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13237 xg_select.
13238
13239 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13240
13241 * eval.c (struct backtrace): Simplify and port the data structure.
13242 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13243 signed bit field, as this assumption is not portable and it makes
13244 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13245 "char debug_on_exit : 1" as this is not portable either; instead,
13246 use the portable "unsigned int debug_on_exit : 1". Remove unused
13247 member evalargs. Remove obsolete comments about cc bombing out.
13248
13249 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13250
13251 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
13252 Let HAVE_GSETTINGS override HAVE_GCONF.
13253 (store_monospaced_changed): New function.
13254 (EMACS_SETTINGS): A new type derived from GObject to handle
13255 GSettings notifications.
13256 (emacs_settings_constructor, emacs_settings_get_property)
13257 (emacs_settings_set_property, emacs_settings_class_init):
13258 New functions.
13259 (gsettings_client, gsettings_obj): New variables.
13260 (GSETTINGS_SCHEMA): New define.
13261 (something_changedCB): Call store_monospaced_changed.
13262 (init_gsettings): New function.
13263 (xsettings_initialize): Call init_gsettings.
13264 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13265 to NULL.
13266
13267 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13268 GCONF_CFLAGS/LIBS.
13269
13270 2011-06-29 Martin Rudalics <rudalics@gmx.at>
13271
13272 * window.c (resize_root_window, grow_mini_window)
13273 (shrink_mini_window): Rename Qresize_root_window to
13274 Qwindow_resize_root_window and Qresize_root_window_vertically to
13275 Qwindow_resize_root_window_vertically.
13276
13277 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13278
13279 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13280
13281 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
13282
13283 * makefile.w32-in: Redesign dependencies so they reflect more
13284 clearly which files are directly included by each source file,
13285 and not through other includes.
13286
13287 2011-06-27 Martin Rudalics <rudalics@gmx.at>
13288
13289 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13290 (sort_overlays, overlay_strings): When an overlay's clone number
13291 matches the window's clone number process the overlay even if
13292 the overlay's window property doesn't match the current window.
13293
13294 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13295 (Fwindow_hchild): Rename to Fwindow_left_child.
13296 (Fwindow_next): Rename to Fwindow_next_sibling.
13297 (Fwindow_prev): Rename to Fwindow_prev_sibling.
13298 (resize_window_check): Rename to window_resize_check.
13299 (resize_window_apply): Rename to window_resize_apply.
13300 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13301 (Fdelete_other_windows_internal, resize_frame_windows)
13302 (Fsplit_window_internal, Fdelete_window_internal)
13303 (grow_mini_window, shrink_mini_window)
13304 (Fresize_mini_window_internal): Fix callers accordingly.
13305
13306 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13307
13308 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13309 (emacs_fixed_set_min_size): Remove.
13310 (emacs_fixed_new): Take frame as argument.
13311
13312 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13313 (_EmacsFixedPrivate): Remove minwidth/height.
13314 Add struct frame *f.
13315 (emacs_fixed_init): Initialize priv->f.
13316 (get_parent_class, emacs_fixed_set_min_size): Remove.
13317 (emacs_fixed_new): Set priv->f to argument.
13318 (emacs_fixed_get_preferred_width)
13319 (emacs_fixed_get_preferred_height): Use min_width/height from
13320 frames size_hint to set minimum and natural (Bug#8919).
13321 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13322 and use min_width/height from frames size_hint to set
13323 min_width/height (Bug#8919).
13324
13325 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13326 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13327 Fix indentation.
13328
13329 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13330
13331 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13332 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13333 called at ZV.
13334
13335 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13336
13337 * process.c (wait_reading_process_output): Bypass select if
13338 waiting for a cell while ignoring keyboard input, and input is
13339 pending. Suggested by Jan Djärv (Bug#8869).
13340
13341 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13342
13343 Use gnulib's dup2 module instead of rolling our own.
13344 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13345
13346 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13347
13348 * dispnew.c (scrolling_window): Before scrolling, turn off a
13349 mouse-highlight in the window being scrolled.
13350
13351 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13352
13353 Move DEFSYM to lisp.h and use everywhere.
13354
13355 * character.h (DEFSYM): Move declaration...
13356 * lisp.h (DEFSYM): ...here.
13357
13358 * gnutls.c:
13359 * minibuf.c:
13360 * w32menu.c:
13361 * w32proc.c:
13362 * w32select.c: Don't include character.h.
13363
13364 * alloc.c (syms_of_alloc):
13365 * buffer.c (syms_of_buffer):
13366 * bytecode.c (syms_of_bytecode):
13367 * callint.c (syms_of_callint):
13368 * casefiddle.c (syms_of_casefiddle):
13369 * casetab.c (init_casetab_once):
13370 * category.c (init_category_once, syms_of_category):
13371 * ccl.c (syms_of_ccl):
13372 * cmds.c (syms_of_cmds):
13373 * composite.c (syms_of_composite):
13374 * dbusbind.c (syms_of_dbusbind):
13375 * dired.c (syms_of_dired):
13376 * dispnew.c (syms_of_display):
13377 * doc.c (syms_of_doc):
13378 * editfns.c (syms_of_editfns):
13379 * emacs.c (syms_of_emacs):
13380 * eval.c (syms_of_eval):
13381 * fileio.c (syms_of_fileio):
13382 * fns.c (syms_of_fns):
13383 * frame.c (syms_of_frame):
13384 * fringe.c (syms_of_fringe):
13385 * insdel.c (syms_of_insdel):
13386 * keymap.c (syms_of_keymap):
13387 * lread.c (init_obarray, syms_of_lread):
13388 * macros.c (syms_of_macros):
13389 * msdos.c (syms_of_msdos):
13390 * print.c (syms_of_print):
13391 * process.c (syms_of_process):
13392 * search.c (syms_of_search):
13393 * sound.c (syms_of_sound):
13394 * syntax.c (init_syntax_once, syms_of_syntax):
13395 * terminal.c (syms_of_terminal):
13396 * textprop.c (syms_of_textprop):
13397 * undo.c (syms_of_undo):
13398 * w32.c (globals_of_w32):
13399 * window.c (syms_of_window):
13400 * xdisp.c (syms_of_xdisp):
13401 * xfaces.c (syms_of_xfaces):
13402 * xfns.c (syms_of_xfns):
13403 * xmenu.c (syms_of_xmenu):
13404 * xsettings.c (syms_of_xsettings):
13405 * xterm.c (syms_of_xterm): Use DEFSYM.
13406
13407 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13408
13409 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13410
13411 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13412
13413 Integer and buffer overflow fixes (Bug#8873).
13414
13415 * print.c (printchar, strout): Check for string overflow.
13416 (PRINTPREPARE, printchar, strout):
13417 Don't set size unless allocation succeeds.
13418
13419 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13420 for sizes. Check for string overflow more accurately.
13421 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13422
13423 * macros.c: Integer and buffer overflow fixes.
13424 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13425 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13426 Use ptrdiff_t, not int, for sizes.
13427 Don't increment bufsize until after realloc succeeds.
13428 Check for size-calculation overflow.
13429 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13430
13431 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13432
13433 * lread.c: Integer overflow fixes.
13434 (read_integer): Radix is now EMACS_INT, not int,
13435 to improve quality of diagnostics for out-of-range radices.
13436 Calculate buffer size correctly for out-of-range radices.
13437 (read1): Check for integer overflow in radices, and in
13438 read-circle numbers.
13439 (read_escape): Avoid int overflow.
13440 (Fload, openp, read_buffer_size, read1)
13441 (substitute_object_recurse, read_vector, read_list, map_obarray):
13442 Use ptrdiff_t, not int, for sizes.
13443 (read1): Use EMACS_INT, not int, for sizes.
13444 Check for size overflow.
13445
13446 * image.c (cache_image): Check for size arithmetic overflow.
13447
13448 * lread.c: Integer overflow issues.
13449 (saved_doc_string_size, saved_doc_string_length)
13450 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13451 Now ptrdiff_t, not int.
13452 (read1): Don't assume doc string length fits in int. Check for
13453 out-of-range doc string lengths.
13454 (read_list): Don't assume file position fits in int.
13455 (read_escape): Check for hex character overflow.
13456
13457 2011-06-22 Leo Liu <sdl.web@gmail.com>
13458
13459 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13460 Move to minibuffer.el.
13461
13462 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13463
13464 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13465 The following patches are for when GLYPH_DEBUG && !XASSERT.
13466 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13467 * dispnew.c (flush_stdout):
13468 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13469 Mark as externally visible.
13470 * dispnew.c (check_window_matrix_pointers): Now static.
13471 * dispnew.c (window_to_frame_vpos):
13472 * xfns.c (unwind_create_frame):
13473 * xterm.c (x_check_font): Remove unused local.
13474 * scroll.c (CHECK_BOUNDS):
13475 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13476 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13477 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13478 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13479 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13480 Now static.
13481 (debug_method_add): Use va_list and vsprintf rather than relying
13482 on undefined behavior with wrong number of arguments.
13483 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13484 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13485 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13486 since we're not interested in debugging glyphs with old libraries.
13487 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13488 GCC 4.6.0's static checking.
13489
13490 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13491
13492 Integer overflow and signedness fixes (Bug#8873).
13493 A few related buffer overrun fixes, too.
13494
13495 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13496
13497 * dispextern.h (struct face.stipple):
13498 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13499 (x_bitmap_mask, x_allocate_bitmap_record)
13500 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13501 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13502 (x_create_bitmap_from_xpm_data):
13503 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13504 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13505 (.bitmaps_last):
13506 * xfaces.c (load_pixmap):
13507 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13508 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13509 (.bitmaps_last, struct x_output.icon_bitmap):
13510 Use ptrdiff_t, not int, for bitmap indexes.
13511 (x_allocate_bitmap_record): Check for size overflow.
13512 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13513
13514 Use ptrdiff_t, not int, for overlay counts.
13515 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13516 * editfns.c (overlays_around, get_pos_property):
13517 * textprop.c (get_char_property_and_overlay):
13518 * xdisp.c (next_overlay_change, note_mouse_highlight):
13519 * xfaces.c (face_at_buffer_position):
13520 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13521 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13522 (Fnext_overlay_change, Fprevious_overlay_change)
13523 (mouse_face_overlay_overlaps, Foverlays_in):
13524 Use ptrdiff_t, not int, for sizes.
13525 (overlays_at, overlays_in): Check for size-calculation overflow.
13526
13527 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13528
13529 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13530 (x_session_initialize): Do not assume string length fits in int.
13531
13532 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13533 This is unlikely, but can occur if DPI is outlandish.
13534
13535 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13536 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13537
13538 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13539 * xrdb.c (magic_file_p, search_magic_path):
13540 Omit last arg SUFFIX; it was always 0. All callers changed.
13541 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13542
13543 * xfont.c (xfont_match): Avoid need for strlen.
13544
13545 * xfns.c: Don't assume strlen fits in int.
13546 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13547
13548 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13549 not unsigned long, as we prefer signed integers. All callers changed.
13550 Detect integer overflow in repeat count.
13551 (message_dolog): Don't assume print length fits in 39 bytes.
13552 (display_mode_element): Don't assume strlen fits in int.
13553
13554 * termcap.c: Don't assume sizes fit in int and never overflow.
13555 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13556 (gobble_line): Check for size-calculation overflow.
13557
13558 * minibuf.c (Fread_buffer):
13559 * lread.c (intern, intern_c_string):
13560 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13561 Don't assume string length fits in int.
13562
13563 * keyboard.c (parse_tool_bar_item):
13564 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13565
13566 * font.c: Don't assume string length fits in int.
13567 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13568 Use ptrdiff_t, not int.
13569 (font_intern_prop): Don't assume string length fits in int.
13570 Don't assume integer property fits in fixnum.
13571 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13572
13573 * filelock.c: Fix some buffer overrun and integer overflow issues.
13574 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13575 Reformulate so as not to need the command string.
13576 Invoke gzip -cd rather than gunzip, as it's more portable.
13577 (lock_info_type, lock_file_1, lock_file):
13578 Don't assume pid_t and time_t fit in unsigned long.
13579 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13580 (current_lock_owner): Prefer signed type for sizes.
13581 Use memcpy, not strncpy, where memcpy is what is really wanted.
13582 Don't assume (via atoi) that time_t and pid_t fit in int.
13583 Check for time_t and/or pid_t out of range, e.g., via a network share.
13584 Don't alloca where an auto var works fine.
13585
13586 * fileio.c: Fix some integer overflow issues.
13587 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13588 Don't assume string length fits in int.
13589 (directory_file_name): Don't assume string length fits in long.
13590 (make_temp_name): Don't assume pid fits in int, or that its print
13591 length is less than 20.
13592
13593 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13594
13595 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13596
13597 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13598
13599 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13600 We prefer signed integers, even for size calculations.
13601
13602 * emacs.c: Don't assume string length fits in 'int'.
13603 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13604 (main): Don't invoke strlen when not needed.
13605
13606 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13607 (XD_DEBUG_MESSAGE): Don't waste a byte.
13608
13609 * callproc.c (getenv_internal_1, getenv_internal)
13610 (Fgetenv_internal):
13611 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13612
13613 * lread.c (invalid_syntax): Omit length argument.
13614 All uses changed. This doesn't fix a bug, but it simplifies the
13615 code away from its former Hollerith-constant appearance, and it's
13616 one less 'int' to worry about when looking at integer-overflow issues.
13617 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13618
13619 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13620 This didn't break anything, but it didn't help either.
13621 It's confusing to put a bogus integer in a place where the actual
13622 value does not matter.
13623 (LIST_END_P): Remove unused macro and its bogus comment.
13624 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13625
13626 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13627 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13628 implementation.
13629 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13630 We prefer signed types, and the value cannot exceed the EMACS_INT
13631 range anyway (because otherwise the length would not be representable).
13632 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13633 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13634 This avoids a GCC warning when WIDE_EMACS_INT.
13635
13636 * indent.c (sane_tab_width): New function.
13637 (current_column, scan_for_column, Findent_to, position_indentation)
13638 (compute_motion): Use it. This is just for clarity.
13639 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13640
13641 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13642
13643 * lisp.h (lint_assume): New macro.
13644 * composite.c (composition_gstring_put_cache):
13645 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13646
13647 * editfns.c, insdel.c:
13648 Omit unnecessary forward decls, to simplify future changes.
13649
13650 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13651
13652 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13653
13654 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13655 Use much-faster test for byte-length change.
13656 Don't assume string byte-length fits in 'int'.
13657 Check that character arg fits in 'int'.
13658 (mapcar1): Declare byte as byte, for clarity.
13659
13660 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13661
13662 * fns.c (concat): Catch string overflow earlier.
13663 Do not rely on integer wraparound.
13664
13665 * dispextern.h (struct it.overlay_strings_charpos)
13666 (struct it.selective): Now EMACS_INT, not int.
13667 * xdisp.c (forward_to_next_line_start)
13668 (back_to_previous_visible_line_start)
13669 (reseat_at_next_visible_line_start, next_element_from_buffer):
13670 Don't arbitrarily truncate the value of 'selective' to int.
13671
13672 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13673
13674 * composite.c: Don't truncate sizes to 'int'.
13675 (composition_gstring_p, composition_reseat_it)
13676 (composition_adjust_point): Use EMACS_INT, not int.
13677 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13678 not EMACS_UINT, for indexes.
13679
13680 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13681
13682 * buffer.c: Include <verify.h>.
13683 (struct sortvec.priority, struct sortstr.priority):
13684 Now EMACS_INT, not int.
13685 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13686 (struct sortstr.size, record_overlay_string)
13687 (struct sortstrlist.size, struct sortlist.used):
13688 Don't truncate size to int.
13689 (record_overlay_string): Check for size-calculation overflow.
13690 (init_buffer_once): Check at compile-time, not run-time.
13691
13692 2011-06-22 Jim Meyering <meyering@redhat.com>
13693
13694 Don't leak an XBM-image-sized buffer
13695 * image.c (xbm_load): Free the image buffer after using it.
13696
13697 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13698
13699 Port to Sun C.
13700 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13701 that Sun C diagnosed.
13702 * fns.c (secure_hash): Fix pointer signedness issue.
13703 * intervals.c (static_offset_intervals): New function.
13704 (offset_intervals): Use it.
13705
13706 2011-06-21 Leo Liu <sdl.web@gmail.com>
13707
13708 * deps.mk (fns.o):
13709 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13710 sha512.h.
13711
13712 * fns.c (secure_hash): Rename from crypto_hash_function and change
13713 the first arg to accept symbols.
13714 (Fsecure_hash): New primitive.
13715 (syms_of_fns): New symbols.
13716
13717 2011-06-20 Deniz Dogan <deniz@dogan.se>
13718
13719 * process.c (Fset_process_buffer): Clarify return value in
13720 docstring.
13721
13722 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
13723
13724 * dispnew.c (add_window_display_history): Use BVAR.
13725
13726 * xdisp.c (debug_method_add): Use BVAR.
13727 (check_window_end, dump_glyph_matrix, dump_glyph)
13728 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13729
13730 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13731 Likewise.
13732
13733 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13734 check till after the cache is created in init_frame_faces.
13735
13736 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13737
13738 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13739
13740 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13741
13742 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13743 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13744 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13745
13746 Improve buffer-overflow checking (Bug#8873).
13747 * fileio.c (Finsert_file_contents):
13748 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13749 Remove the old (too-loose) buffer overflow checks.
13750 They weren't needed, since make_gap checks for buffer overflow.
13751 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13752 The old code merely checked for Emacs fixnum overflow, and relied
13753 on undefined (wraparound) behavior. The new code avoids undefined
13754 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13755
13756 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13757 Tune. Don't use wider integers than needed. Don't use alloca.
13758 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13759
13760 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13761
13762 * insdel.c, lisp.h (buffer_overflow): New function.
13763 (insert_from_buffer_1, replace_range, replace_range_2):
13764 * insdel.c (make_gap_larger):
13765 * editfns.c (Finsert_char):
13766 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13767
13768 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13769
13770 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13771
13772 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13773
13774 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13775 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13776
13777 * fileio.c: Don't assume EMACS_INT fits in off_t.
13778 (emacs_lseek): New static function.
13779 (Finsert_file_contents, Fwrite_region): Use it.
13780 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13781
13782 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13783
13784 * fns.c: Don't overflow int when computing a list length.
13785 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13786 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13787 truncation on 64-bit hosts. Check for QUIT every
13788 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13789 faster and is responsive enough.
13790 (Flength): Report an error instead of overflowing an integer.
13791 (Fsafe_length): Return a float if the value is not representable
13792 as a fixnum. This shouldn't happen except in contrived situations.
13793 (Fnthcdr, Fsort): Don't assume list length fits in int.
13794 (Fcopy_sequence): Don't assume vector length fits in int.
13795
13796 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13797 (header_size, word_size): New constants.
13798 (allocate_vectorlike): Don't check size overflow here.
13799 (allocate_vector): Check it here instead, since this is the only
13800 caller of allocate_vectorlike that could cause overflow.
13801 Check that the new vector's length is representable as a fixnum.
13802
13803 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13804 The previous code was bogus. For example, next_almost_prime (32)
13805 returned 39, which is undesirable as it is a multiple of 3; and
13806 next_almost_prime (24) returned 25, which is a multiple of 5 so
13807 why was the code bothering to check for multiples of 7?
13808
13809 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13810
13811 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13812
13813 Variadic C functions now count arguments with ptrdiff_t.
13814 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13815 Back then I didn't know that the Emacs coding style prefers signed int.
13816 Also, in the meantime I found a few more instances where arguments
13817 were being counted with int, which may truncate counts on 64-bit
13818 machines, or EMACS_INT, which may be unnecessarily wide.
13819 * lisp.h (struct Lisp_Subr.function.aMANY)
13820 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13821 Arg counts are now ptrdiff_t, not size_t.
13822 All variadic functions and their callers changed accordingly.
13823 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13824 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13825 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13826 * callint.c (Fcall_interactively): Check arg count for overflow,
13827 to avoid potential buffer overrun. Use signed char, not 'int',
13828 for 'varies' array, so that we needn't bother to check its size
13829 calculation for overflow.
13830 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13831 * eval.c (apply_lambda):
13832 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13833 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13834 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13835
13836 * callint.c (Fcall_interactively): Don't use index var as event count.
13837
13838 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13839 * mem-limits.h (SIZE): Remove; no longer used.
13840
13841 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13842
13843 Remove unnecessary casts.
13844 * xterm.c (x_term_init):
13845 * xfns.c (x_set_border_pixel):
13846 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13847 These aren't needed now that we assume ANSI C.
13848
13849 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13850 It's more likely to cause problems (due to unsigned overflow)
13851 than to cure them.
13852
13853 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13854
13855 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13856
13857 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13858
13859 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13860
13861 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13862
13863 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13864
13865 GLYPH_CODE_FACE returns EMACS_INT, not int.
13866 * dispextern.h (merge_faces):
13867 * xfaces.c (merge_faces):
13868 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13869 Don't assume EMACS_INT fits in int.
13870
13871 * character.h (CHAR_VALID_P): Remove unused parameter.
13872 * fontset.c, lisp.h, xdisp.c: All uses changed.
13873
13874 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13875
13876 * fns.c (concat): Minor tuning based on overflow analysis.
13877 This doesn't fix any bugs. Use int to hold character, instead
13878 of constantly refetching from Emacs object. Use XFASTINT, not
13879 XINT, for value known to be a character. Don't bother comparing
13880 a single byte to 0400, as it's always less.
13881
13882 * floatfns.c (Fexpt):
13883 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13884
13885 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13886 for characters.
13887
13888 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13889
13890 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13891 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13892 incorrectly succeed when S was a string, because 4294967386 was
13893 truncated before it was used.
13894
13895 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13896 Otherwise, an out-of-range integer could cause undefined behavior
13897 on a 64-bit host.
13898
13899 * composite.c: Use int, not EMACS_INT, for characters.
13900 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13901 EMACS_INT, for values that are known to be in character range.
13902 This doesn't fix any bugs but is the usual style inside Emacs and
13903 may generate better code on 32-bit machines.
13904
13905 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13906 This is for reasons similar to the recent CHAR_STRING fix.
13907 * charset.c (Fencode_char): Check that character arg is actually
13908 a character. Pass an int to ENCODE_CHAR.
13909 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13910 wider than 'int', as a compile-time check to prevent future regressions
13911 in this area.
13912
13913 * character.c (char_string): Remove unnecessary casts.
13914
13915 Make sure a 64-bit char is never passed to CHAR_STRING.
13916 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13917 by silently ignoring the top 32 bits, allowing some values
13918 that were far too large to be valid characters.
13919 * character.h: Include <verify.h>.
13920 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13921 arguments are no wider than unsigned, as a compile-time check
13922 to prevent future regressions in this area.
13923 * data.c (Faset):
13924 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13925 (Fsubst_char_in_region):
13926 * fns.c (concat):
13927 * xdisp.c (decode_mode_spec_coding):
13928 Adjust to CHAR_STRING's new requirement.
13929 * editfns.c (Finsert_char, Fsubst_char_in_region):
13930 * fns.c (concat): Check that character args are actually
13931 characters. Without this test, these functions did the wrong
13932 thing with wildly out-of-range values on 64-bit hosts.
13933
13934 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13935 These casts should not be needed on 32-bit hosts, either.
13936 * keyboard.c (read_char):
13937 * lread.c (Fload): Remove casts to unsigned.
13938
13939 * lisp.h (UNSIGNED_CMP): New macro.
13940 This fixes comparison bugs on 64-bit hosts.
13941 (ASCII_CHAR_P): Use it.
13942 * casefiddle.c (casify_object):
13943 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13944 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13945 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13946 * dispextern.h (FACE_FROM_ID):
13947 * keyboard.c (read_char): Use UNSIGNED_CMP.
13948
13949 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13950 not to EMACS_INT, to avoid GCC warning.
13951
13952 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13953
13954 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13955 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13956 isn't needed on 32-bit machines.
13957
13958 * buffer.c (Fgenerate_new_buffer_name):
13959 Use EMACS_INT for count, not int.
13960 (advance_to_char_boundary): Return EMACS_INT, not int.
13961
13962 * data.c (Qcompiled_function): Now static.
13963
13964 * window.c (window_body_lines): Now static.
13965
13966 * image.c (gif_load): Rename local to avoid shadowing.
13967
13968 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13969 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13970 * alloc.c (make_save_value): Integer argument is now of type
13971 ptrdiff_t, not int.
13972 (mark_object): Use ptrdiff_t, not int.
13973 * lisp.h (pD): New macro.
13974 * print.c (print_object): Use it.
13975
13976 * alloc.c: Use EMACS_INT, not int, to count objects.
13977 (total_conses, total_markers, total_symbols, total_vector_size)
13978 (total_free_conses, total_free_markers, total_free_symbols)
13979 (total_free_floats, total_floats, total_free_intervals)
13980 (total_intervals, total_strings, total_free_strings):
13981 Now EMACS_INT, not int. All uses changed.
13982 (Fgarbage_collect): Compute overall total using a double, so that
13983 integer overflow is less likely to be a problem. Check for overflow
13984 when converting back to an integer.
13985 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13986 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13987 These were 'int' variables that could overflow on 64-bit hosts;
13988 they were never used, so remove them instead of repairing them.
13989 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13990 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13991 Previously, this ceilinged at INT_MAX, but that doesn't work on
13992 64-bit machines.
13993 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13994
13995 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13996 (allocate_vectorlike): Check for ptrdiff_t overflow.
13997 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13998 when a (possibly-narrower) signed value would do just as well.
13999 We prefer using signed arithmetic, to avoid comparison confusion.
14000
14001 * alloc.c: Catch some string size overflows that we were missing.
14002 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14003 for convenience in STRING_BYTES_MAX.
14004 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14005 The definition here is exact; the one in lisp.h was approximate.
14006 (allocate_string_data): Check for string overflow. This catches
14007 some instances we weren't catching before. Also, it catches
14008 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14009 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14010 and ptrdiff_t and EMACS_INT are both 64 bits.
14011
14012 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14013 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14014 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14015
14016 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14017
14018 * alloc.c (Fmake_string): Check for out-of-range init.
14019
14020 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14021
14022 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14023
14024 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14025
14026 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14027 xg_get_default_scrollbar_width.
14028
14029 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14030 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14031 (style_changed_cb): Call update_theme_scrollbar_width and call
14032 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14033 all frames (Bug#8505).
14034 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14035 Call gtk_window_set_resizable if HAVE_GTK3.
14036 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14037 and height if HAVE_GTK3 (Bug#8505).
14038 (scroll_bar_width_for_theme): New variable.
14039 (update_theme_scrollbar_width): New function.
14040 (xg_get_default_scrollbar_width): Move code to
14041 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14042 (xg_initialize): Call update_theme_scrollbar_width.
14043
14044 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14045
14046 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14047
14048 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14049
14050 * frame.c (make_frame): Call other_buffer_safely instead of
14051 other_buffer.
14052
14053 * window.c (temp_output_buffer_show): Call display_buffer with
14054 second argument Vtemp_buffer_show_specifiers and reset latter
14055 immediately after the call.
14056 (Vtemp_buffer_show_specifiers): New variable.
14057 (auto_window_vscroll_p, next_screen_context_lines)
14058 (Vscroll_preserve_screen_position): Remove leading asterisks from
14059 doc-strings.
14060
14061 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
14062
14063 Fix minor problems found by GCC 4.6.0 static checking.
14064 * buffer.c (Qclone_number): Remove for now, as it's unused.
14065 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14066 (record_buffer): Remove unused local.
14067 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14068 (set_frame_buffer_list): Remove; unused.
14069 * frame.h (other_visible_frames): Remove decl.
14070 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14071 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14072 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14073 if HAVE_GPM.
14074 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14075 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14076 Define only if HAVE_GPM.
14077 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14078 (update_hints_inhibit): Remove; never set. All uses removed.
14079 * widgetprv.h (emacsFrameClassRec): Remove decl.
14080 * window.c (delete_deletable_window): Now returns void, since it
14081 wasn't returning anything.
14082 (compare_window_configurations): Remove unused locals.
14083 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14084 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14085 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14086 the same widths as pointers. This follows up on the 2011-05-06 patch.
14087 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14088 * xterm.h: Likewise.
14089 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14090
14091 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
14092
14093 * makefile.w32-in: Update dependencies.
14094 (LISP_H): Add lib/intprops.h.
14095
14096 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14097
14098 * image.c (gif_load): Add animation frame delay to the metadata.
14099 (syms_of_image): Use DEFSYM. New symbol `delay'.
14100
14101 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14102
14103 * window.c (delete_deletable_window): Re-add.
14104 (Fset_window_configuration): Rewrite to handle dead buffers and
14105 consequently deletable windows.
14106 (window_tree, Fwindow_tree): Remove. Supply functionality in
14107 window.el.
14108 (compare_window_configurations): Simplify code.
14109
14110 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14111
14112 * image.c (imagemagick_load_image): Fix type mismatch.
14113 (Fimagemagick_types): Likewise.
14114
14115 * window.h (replace_buffer_in_windows): Declare.
14116
14117 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14118
14119 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14120 Qclone_number. Remove external declaration of Qdelete_window.
14121 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14122 code.
14123 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14124 Run Qbuffer_list_update_hook if allowed.
14125 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14126 buffer list implementation.
14127 (other_buffer_safely): New function.
14128 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14129 calls to replace_buffer_in_windows and
14130 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14131 if allowed.
14132 (record_buffer): Inhibit quitting and rewrite using quittable
14133 functions. Run Qbuffer_list_update_hook if allowed.
14134 (Frecord_buffer, Funrecord_buffer): New functions.
14135 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14136 Move switch-to-buffer to window.el.
14137 (bury-buffer): Move to window.el.
14138 (Vbuffer_list_update_hook): New variable.
14139
14140 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14141 section.
14142
14143 * window.h (resize_frame_windows): Move up in code.
14144 (Fwindow_frame): Remove EXFUN.
14145 (replace_buffer_in_all_windows): Remove prototype.
14146 (replace_buffer_in_windows_safely): Add prototype.
14147
14148 * window.c: Declare Qdelete_window static again. Move down
14149 declaration of select_count.
14150 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14151 (Fother_window): Move to window.el.
14152 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14153 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14154 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14155 window.el.
14156 (replace_buffer_in_windows): Implement by calling
14157 Qreplace_buffer_in_windows.
14158 (replace_buffer_in_all_windows): Remove with some functionality
14159 moved into replace_buffer_in_windows_safely.
14160 (replace_buffer_in_windows_safely): New function.
14161 (select_window_norecord, select_frame_norecord): Move in front
14162 of run_window_configuration_change_hook. Remove now obsolete
14163 declarations.
14164 (Fset_window_buffer): Rewrite doc-string.
14165 Call Qrecord_window_buffer.
14166 (keys_of_window): Move binding for other-window to window.el.
14167
14168 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14169
14170 * dispextern.h (struct image): Replace data member, whose int_val
14171 and ptr_val fields were not used by anything, with a single
14172 lisp_val object.
14173
14174 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14175 (gif_clear_image, gif_load, imagemagick_load_image)
14176 (gs_clear_image, gs_load): Callers changed.
14177
14178 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14179
14180 * buffer.h: Include <time.h>, for time_t.
14181 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14182
14183 Fix minor problems found by static checking.
14184
14185 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14186
14187 Make identifiers static if they are not used in other modules.
14188 * data.c (Qcompiled_function, Qframe, Qvector):
14189 * image.c (QimageMagick, Qsvg):
14190 * minibuf.c (Qmetadata):
14191 * window.c (resize_window_check, resize_root_window): Now static.
14192 * window.h (resize_window_check, resize_root_window): Remove decls.
14193
14194 * window.c (window_deletion_count, delete_deletable_window):
14195 Remove; unused.
14196 (window_body_lines): Now static.
14197 (Fdelete_other_windows_internal): Mark vars as initialized.
14198 Make sure 'resize_failed' is initialized.
14199 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14200 (resize_window_apply): Remove unused local.
14201 * window.h (delete_deletable_window): Remove decl.
14202
14203 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14204 (imagemagick_load_image): Fix pointer signedness problem by changing
14205 last arg from unsigned char * to char *. All uses changed.
14206 Also, fix a local for similar reasons.
14207 Remove unused locals. Remove locals to avoid shadowing.
14208 (fn_rsvg_handle_free): Remove; unused.
14209 (svg_load, svg_load_image): Fix pointer signedness problem.
14210 (imagemagick_load_image): Don't use garbage pointer image_wand.
14211
14212 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14213
14214 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
14215
14216 * image.c (gif_load): Fix omitted cast error introduced by
14217 2011-06-06 change.
14218
14219 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14220
14221 * window.h (resize_proportionally, orig_total_lines)
14222 (orig_top_line): Remove from window structure.
14223 (set_window_height, set_window_width, change_window_heights)
14224 (Fdelete_window): Remove prototypes.
14225 (resize_frame_windows): Remove duplicate declaration.
14226
14227 2011-06-10 Eli Zaretskii <eliz@gnu.org>
14228
14229 * window.h (resize_frame_windows, resize_window_check)
14230 (delete_deletable_window, resize_root_window)
14231 (resize_frame_windows): Declare prototypes.
14232
14233 * window.c (resize_window_apply): Make definition be "static" to
14234 match the prototype.
14235
14236 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14237
14238 * window.c: Remove declarations of Qwindow_size_fixed,
14239 window_min_size_1, window_min_size_2, window_min_size,
14240 size_window, window_fixed_size_p, enlarge_window, delete_window.
14241 Remove static from declaration of Qdelete_window, it's
14242 temporarily needed by Fbury_buffer.
14243 (replace_window): Don't assign orig_top_line and
14244 orig_total_lines.
14245 (Fdelete_window, delete_window): Remove. Window deletion is
14246 handled by window.el.
14247 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14248 Replace Fdelete_window calls with calls to Qdelete_window.
14249 (Fdelete_other_windows): Remove. Deleting other windows is
14250 handled by window.el.
14251 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14252 handled in window.el.
14253 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14254 Window minimum sizes are handled in window.el.
14255 (shrink_windows, size_window, set_window_height)
14256 (set_window_width, change_window_heights, window_height)
14257 (window_width, CURBEG, CURSIZE, enlarge_window)
14258 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14259 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14260 handled in window.el.
14261 (make_dummy_parent): Rename to make_parent_window and give it a
14262 second argument horflag.
14263 (make_window): Don't set resize_proportionally any more.
14264 (Fsplit_window): Remove. Windows are split in window.el.
14265 (save_restore_action, save_restore_orig_size)
14266 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14267 Resize mini windows in window.el.
14268 (grow_mini_window, shrink_mini_window): Implement by calling
14269 Qresize_root_window_vertically, resize_window_check and
14270 resize_window_apply.
14271 (saved_window, Fset_window_configuration, save_window_save):
14272 Do not handle orig_top_line, orig_total_lines, and
14273 resize_proportionally.
14274 (window_min_height, window_min_width): Move to window.el.
14275 (keys_of_window): Move bindings for delete-other-windows,
14276 split-window, delete-window and enlarge-window to window.el.
14277
14278 * buffer.c: Temporarily extern Qdelete_window.
14279 (Fbury_buffer): Temporarily call Qdelete_window instead of
14280 Fdelete_window (Fbury_buffer will move to window.el soon).
14281
14282 * frame.c (set_menu_bar_lines_1): Remove code handling
14283 orig_top_line and orig_total_lines.
14284
14285 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14286 set_window_height but set heights directly.
14287 (change_frame_size_1): Use resize_frame_windows.
14288
14289 * xdisp.c (init_xdisp): Don't use set_window_height but set
14290 heights directly.
14291
14292 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14293 Use resize_frame_windows instead of change_window_heights and run
14294 run_window_configuration_change_hook.
14295
14296 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14297 instead of change_window_heights and run
14298 run_window_configuration_change_hook.
14299
14300 2011-06-09 Martin Rudalics <rudalics@gmx.at>
14301
14302 * window.c (replace_window): Rename second argument REPLACEMENT to
14303 NEW. New third argument SETFLAG. Rewrite.
14304 (delete_window, make_dummy_parent): Call replace_window with
14305 third argument 1.
14306 (window_list_1): Move down in code.
14307 (run_window_configuration_change_hook): Move set_buffer part
14308 before select_frame_norecord part in order to unwind correctly.
14309 Rename count1 to count.
14310 (recombine_windows, delete_deletable_window, resize_root_window)
14311 (Fdelete_other_windows_internal)
14312 (Frun_window_configuration_change_hook, make_parent_window)
14313 (resize_window_check, resize_window_apply, Fresize_window_apply)
14314 (resize_frame_windows, Fsplit_window_internal)
14315 (Fdelete_window_internal, Fresize_mini_window_internal):
14316 New functions.
14317 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14318
14319 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14320
14321 * window.h (window): Add some new members to window structure -
14322 normal_lines, normal_cols, new_total, new_normal, clone_number,
14323 splits, nest, prev_buffers, next_buffers.
14324 (WINDOW_TOTAL_SIZE): Move here from window.c.
14325 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14326
14327 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14328 Remove.
14329 (make_dummy_parent): Set new members of windows structure.
14330 (make_window): Move down in code. Handle new members of window
14331 structure.
14332 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14333 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14334 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14335 (Fset_window_prev_buffers, Fwindow_next_buffers)
14336 (Fset_window_next_buffers, Fset_window_clone_number):
14337 New functions.
14338 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14339 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14340 Doc-string fixes.
14341 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14342 Argument WINDOW can be now internal window too.
14343 (Fwindow_use_time): Move up in code.
14344 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14345 Rewrite doc-string.
14346 (Fset_window_configuration, saved_window)
14347 (Fcurrent_window_configuration, save_window_save): Handle new
14348 members of window structure.
14349 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14350 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14351 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14352 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14353 Qget_mru_window, Qresize_root_window,
14354 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14355 Qauto_buffer_name; staticpro them.
14356
14357 2011-06-07 Martin Rudalics <rudalics@gmx.at>
14358
14359 * window.c (Fwindow_total_size, Fwindow_left_column)
14360 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14361 (Fwindow_list_1): New functions.
14362 (window_box_text_cols): Replace with window_body_cols.
14363 (Fwindow_width, Fscroll_left, Fscroll_right):
14364 Use window_body_cols instead of window_box_text_cols.
14365 (delete_window, Fset_window_configuration):
14366 Call delete_all_subwindows with window as argument.
14367 (delete_all_subwindows): Take a window as argument and not a
14368 structure. Rewrite.
14369 (window_loop): Remove handling of GET_LRU_WINDOW and
14370 GET_LARGEST_WINDOW.
14371 (Fget_lru_window, Fget_largest_window): Move to window.el.
14372
14373 * window.h: Extern window_body_cols instead of
14374 window_box_text_cols. delete_all_subwindows now takes a
14375 Lisp_Object as argument.
14376
14377 * indent.c (compute_motion, Fcompute_motion):
14378 Use window_body_cols instead of window_box_text_cols.
14379
14380 * frame.c (delete_frame): Call delete_all_subwindows with root
14381 window as argument.
14382
14383 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14384
14385 * fns.c (Fputhash): Document return value.
14386
14387 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
14388
14389 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14390
14391 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14392
14393 Cons<->int and similar integer overflow fixes (Bug#8794).
14394
14395 Check for overflow when converting integer to cons and back.
14396 * charset.c (Fdefine_charset_internal, Fdecode_char):
14397 Use cons_to_unsigned to catch overflow.
14398 (Fencode_char): Use INTEGER_TO_CONS.
14399 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14400 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14401 * data.c (long_to_cons, cons_to_long): Remove.
14402 (cons_to_unsigned, cons_to_signed): New functions.
14403 These signal an error for invalid or out-of-range values.
14404 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14405 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14406 * font.c (Ffont_variation_glyphs):
14407 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14408 * lisp.h: Include <intprops.h>.
14409 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14410 (cons_to_signed, cons_to_unsigned): New decls.
14411 (long_to_cons, cons_to_long): Remove decls.
14412 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14413 (Fprimitive_undo): Use CONS_TO_INTEGER.
14414 * xfns.c (Fx_window_property): Likewise.
14415 * xselect.c: Include <limits.h>.
14416 (x_own_selection, selection_data_to_lisp_data):
14417 Use INTEGER_TO_CONS.
14418 (x_handle_selection_request, x_handle_selection_clear)
14419 (x_get_foreign_selection, Fx_disown_selection_internal)
14420 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14421 (lisp_data_to_selection_data): Use cons_to_unsigned.
14422 (x_fill_property_data): Use cons_to_signed.
14423 Report values out of range.
14424
14425 Check for buffer and string overflow more precisely.
14426 * buffer.h (BUF_BYTES_MAX): New macro.
14427 * lisp.h (STRING_BYTES_MAX): New macro.
14428 * alloc.c (Fmake_string):
14429 * character.c (string_escape_byte8):
14430 * coding.c (coding_alloc_by_realloc):
14431 * doprnt.c (doprnt):
14432 * editfns.c (Fformat):
14433 * eval.c (verror):
14434 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14435 since they may not be the same number.
14436 * editfns.c (Finsert_char):
14437 * fileio.c (Finsert_file_contents):
14438 Likewise for BUF_BYTES_MAX.
14439
14440 * image.c: Use ptrdiff_t, not int, for sizes.
14441 (slurp_file): Switch from int to ptrdiff_t.
14442 All uses changed.
14443 (slurp_file): Check that file size fits in both size_t (for
14444 malloc) and ptrdiff_t (for sanity and safety).
14445
14446 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14447 if b->modtime has its maximal value.
14448
14449 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14450
14451 Don't assume time_t can fit into int.
14452 * buffer.h (struct buffer.modtime): Now time_t, not int.
14453 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14454 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14455
14456 Minor fixes for signed vs unsigned integers.
14457 * character.h (MAYBE_UNIFY_CHAR):
14458 * charset.c (maybe_unify_char):
14459 * keyboard.c (read_char, reorder_modifiers):
14460 XINT -> XFASTINT, since the integer must be nonnegative.
14461 * ftfont.c (ftfont_spec_pattern):
14462 * keymap.c (access_keymap, silly_event_symbol_error):
14463 XUINT -> XFASTINT, since the integer must be nonnegative.
14464 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14465 since it makes no difference and we prefer signed.
14466 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14467 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14468 nonnegative.
14469
14470 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14471
14472 * window.h (Fwindow_frame): Declare.
14473
14474 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14475
14476 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14477 (SPARE_MEMORY): Always define.
14478 (LARGE_REQUEST): Remove.
14479 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14480
14481 2011-06-06 Martin Rudalics <rudalics@gmx.at>
14482
14483 * lisp.h: Move EXFUNS for Fframe_root_window,
14484 Fframe_first_window and Fset_frame_selected_window to window.h.
14485
14486 * window.h: Move EXFUNS for Fframe_root_window,
14487 Fframe_first_window and Fset_frame_selected_window here from
14488 lisp.h.
14489
14490 * frame.c (Fwindow_frame, Fframe_first_window)
14491 (Fframe_root_window, Fframe_selected_window)
14492 (Fset_frame_selected_window): Move to window.c.
14493 (Factive_minibuffer_window): Move to minibuf.c.
14494 (Fother_visible_frames_p): New function.
14495
14496 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14497
14498 * window.c (decode_window, decode_any_window): Move up in code.
14499 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14500 (inhibit_frame_unsplittable): Remove unused variable.
14501 (Fwindow_buffer): Move up and rewrite doc-string.
14502 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14503 (Fwindow_prev): New functions.
14504 (Fwindow_frame): Move here from frame.c. Accept any window as
14505 argument.
14506 (Fframe_root_window, Fframe_first_window)
14507 (Fframe_selected_window): Move here from frame.c. Accept frame
14508 or arbitrary window as argument. Update doc-strings.
14509 (Fminibuffer_window): Move up in code.
14510 (Fwindow_minibuffer_p): Move up in code and simplify.
14511 (Fset_frame_selected_window): Move here from frame.c.
14512 Marginal rewrite.
14513 (Fselected_window, select_window, Fselect_window): Move up in
14514 code. Minor doc-string fixes.
14515
14516 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14517
14518 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14519 Do not assume that spare memory exists; that assumption is valid
14520 only if SYSTEM_MALLOC.
14521 (LARGE_REQUEST): New macro, so that the issue of large requests
14522 is separated from the issue of spare memory.
14523
14524 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14525
14526 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14527 format. (Bug#8806)
14528
14529 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14530
14531 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14532 before statements.
14533
14534 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14535
14536 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14537
14538 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14539
14540 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14541 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14542
14543 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
14544
14545 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14546
14547 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
14548
14549 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14550 (x_clipboard_manager_save): Add return value.
14551 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14552 New error handlers.
14553 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14554 Obey Vx_select_enable_clipboard_manager. Catch errors in
14555 x_clipboard_manager_save (Bug#8779).
14556 (Vx_select_enable_clipboard_manager): New variable.
14557 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14558
14559 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
14560
14561 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14562
14563 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14564
14565 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14566 in the current matrix if keep_current_p is non-zero.
14567
14568 2011-06-04 Eli Zaretskii <eliz@gnu.org>
14569
14570 * bidi.c (bidi_level_of_next_char): Fix last change.
14571
14572 2011-06-03 Eli Zaretskii <eliz@gnu.org>
14573
14574 Support bidi reordering of text covered by display properties.
14575
14576 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14577 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14578 (bidi_cache_search, bidi_cache_iterator_state)
14579 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14580 (bidi_level_of_next_char, bidi_move_to_visually_next):
14581 Support character positions inside a run of characters covered by a
14582 display string.
14583 (bidi_paragraph_init, bidi_resolve_explicit_1)
14584 (bidi_level_of_next_char): Call bidi_fetch_char and
14585 bidi_fetch_char_advance instead of FETCH_CHAR and
14586 FETCH_CHAR_ADVANCE.
14587 (bidi_init_it): Initialize new members.
14588 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14589 definitions.
14590 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14591 instead of using explicit *_CHAR codes.
14592 (bidi_resolve_explicit, bidi_resolve_weak):
14593 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14594 bidirectional text is supported only in multibyte buffers.
14595 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14596 it to initialize the frame_window_p member of struct bidi_it.
14597 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14598 (bidi_resolve_explicit, bidi_resolve_weak)
14599 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14600 bidi_it->nchars is non-positive.
14601 (bidi_level_of_next_char): Don't try to lookup the cache for the
14602 next/previous character if nothing is cached there yet, or if we
14603 were just reseat()'ed to a new position.
14604
14605 * xdisp.c (set_cursor_from_row): Set start and stop points
14606 according to the row's direction when priming the loop that looks
14607 for the glyph on which to display cursor.
14608 (single_display_spec_intangible_p): Function deleted.
14609 (display_prop_intangible_p): Reimplement to call
14610 handle_display_spec instead of single_display_spec_intangible_p.
14611 Accept 3 additional arguments needed by handle_display_spec.
14612 This fixes incorrect cursor motion across display property with complex
14613 values: lists, `(when COND...)' forms, etc.
14614 (single_display_spec_string_p): Support property values that are
14615 lists with the argument STRING its top-level element.
14616 (display_prop_string_p): Fix the condition for processing a
14617 property that is a list to be consistent with handle_display_spec.
14618 (handle_display_spec): New function, refactored from the
14619 last portion of handle_display_prop.
14620 (compute_display_string_pos): Accept additional argument
14621 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14622 value of a `display' property is a "replacing spec".
14623 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14624 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14625 the display property, but just return a value indicating whether
14626 the display property will replace the characters it covers.
14627 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14628 frame_window_p members of struct bidi_it.
14629 (compute_display_string_pos, compute_display_string_end):
14630 New functions.
14631 (push_it): Accept second argument POSITION, where pop_it should
14632 jump to continue iteration.
14633 (reseat_1): Initialize bidi_it.disp_pos.
14634
14635 * keyboard.c (adjust_point_for_property): Adjust the call to
14636 display_prop_intangible_p to its new signature.
14637
14638 * dispextern.h (struct bidi_it): New member frame_window_p.
14639 (bidi_init_it): Update prototypes.
14640 (display_prop_intangible_p): Update prototype.
14641 (compute_display_string_pos, compute_display_string_end):
14642 Declare prototypes.
14643 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14644 EMACS_INT.
14645
14646 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14647
14648 Malloc failure behavior now depends on size of allocation.
14649 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14650 * lisp.h: Change signatures accordingly.
14651 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14652 All callers changed. (Bug#8762)
14653
14654 * gnutls.c: Use Emacs's memory allocators.
14655 Without this change, the gnutls library would invoke malloc etc.
14656 directly, which causes problems on non-SYNC_INPUT hosts, and which
14657 runs afoul of improving memory_full behavior. (Bug#8761)
14658 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14659 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14660 xfree instead of the default malloc, realloc, free.
14661 (Fgnutls_boot): No need to check for memory allocation failure,
14662 since xmalloc does that for us.
14663
14664 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14665 * category.c (hash_get_category_set):
14666 * ccl.c (ccl_driver):
14667 * charset.c (Fdefine_charset_internal):
14668 * charset.h (struct charset.hash_index):
14669 * composite.c (get_composition_id, gstring_lookup_cache)
14670 (composition_gstring_put_cache):
14671 * composite.h (struct composition.hash_index):
14672 * dispextern.h (struct image.hash):
14673 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14674 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14675 (hashfn_equal, hashfn_user_defined, make_hash_table)
14676 (maybe_resize_hash_table, hash_lookup, hash_put)
14677 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14678 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14679 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14680 * image.c (make_image, search_image_cache, lookup_image)
14681 (xpm_put_color_table_h):
14682 * lisp.h (struct Lisp_Hash_Table):
14683 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14684 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14685 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14686 * alloc.c (allocate_vectorlike):
14687 Check for overflow in vector size calculations.
14688 * ccl.c (ccl_driver):
14689 Check for overflow when converting EMACS_INT to int.
14690 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14691 need to be updated by these changes.
14692 * fns.c (make_hash_table, maybe_resize_hash_table):
14693 Check for integer overflow with large hash tables.
14694 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14695 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14696 (SXHASH_REDUCE): New macro.
14697 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14698 Use it instead of discarding useful hash info with large hash values.
14699 (sxhash_float): New function.
14700 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14701 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14702 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14703 Rewrite to use FIXNUM_BITS, as this simplifies things.
14704 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14705 Adjust signatures to match updated version of code.
14706 (consing_since_gc): Now EMACS_INT, since a single hash table can
14707 use more than INT_MAX bytes.
14708
14709 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14710
14711 Make it possible to build with GCC-4.6+ -O2 -flto.
14712
14713 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14714
14715 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14716
14717 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14718 Call minibuffer-inactive-mode.
14719
14720 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
14721
14722 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14723 Update dependencies.
14724
14725 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14726
14727 * data.c (init_data): Remove code for UTS, this system is not
14728 supported anymore.
14729
14730 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14731
14732 Don't force ./temacs to start in terminal mode.
14733
14734 * frame.c (make_initial_frame): Initialize faces in all cases, not
14735 only when CANNOT_DUMP is defined.
14736 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14737
14738 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14739
14740 * dispnew.c (add_window_display_history): Use const for the string
14741 pointer. Remove declaration, not needed.
14742
14743 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14744
14745 Use 'inline', not 'INLINE'.
14746 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14747 * alloc.c, fontset.c (INLINE): Remove.
14748 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14749 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14750 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14751 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14752 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14753
14754 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14755
14756 Make it possible to run ./temacs.
14757
14758 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14759 syms_of_callproc does the same thing. Remove test for
14760 "initialized", do it in the caller.
14761 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14762
14763 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14764
14765 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14766 (read_minibuf): Use get_minibuffer.
14767 (syms_of_minibuf): Use DEFSYM.
14768 (Qmetadata): New var.
14769 * data.c (Qbuffer): Don't make it static.
14770 (syms_of_data): Use DEFSYM.
14771
14772 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14773
14774 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14775 (CCL_CODE_MIN): New macro.
14776
14777 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14778
14779 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14780
14781 * eval.c (Qdebug): Now static.
14782 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14783 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14784 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14785
14786 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14787
14788 * image.c: Various fixes to ImageMagick code comments.
14789 (Fimagemagick_types): Doc fix.
14790
14791 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14792
14793 Minor fixes prompted by GCC 4.6.0 warnings.
14794
14795 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14796
14797 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14798 (x_clipboard_manager_save_all): Move extern decl to ...
14799 * xterm.h: ... here, so that it can be checked for consistency.
14800
14801 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14802
14803 * xselect.c (x_clipboard_manager_save_frame)
14804 (x_clipboard_manager_save_all): New functions.
14805 (Fx_clipboard_manager_save): Lisp function deleted.
14806
14807 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14808 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14809
14810 * xterm.h: Update prototype.
14811
14812 2011-05-28 William Xu <william.xwl@gmail.com>
14813
14814 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14815 exiting (Bug#8239).
14816
14817 2011-05-28 Jim Meyering <meyering@redhat.com>
14818
14819 Avoid a sign-extension bug in crypto_hash_function.
14820 * fns.c (to_uchar): Define.
14821 (crypto_hash_function): Use it to convert some newly-signed
14822 variables to unsigned, to avoid sign-extension bugs. For example,
14823 without this change, (md5 "truc") would evaluate to
14824 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14825 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14826 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14827
14828 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14829
14830 Integer overflow fixes.
14831
14832 * dbusbind.c: Serial number integer overflow fixes.
14833 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14834 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14835 to hold a serial number that is too large for a fixnum.
14836 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14837 Check for serial numbers out of range. Decode any serial number
14838 that was so large that it became a float. (Bug#8722)
14839
14840 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14841 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14842 Use XFASTINT rather than XUINT when numbers are nonnegative.
14843 (xd_append_arg, Fdbus_method_return_internal):
14844 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14845 arguments, check that Lisp number is nonnegative, rather than
14846 silently wrapping negative numbers around. (Bug#8722)
14847 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14848 (Bug#8722)
14849
14850 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14851
14852 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14853
14854 ccl: Add integer overflow checks.
14855 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14856 (IN_INT_RANGE): New macros.
14857 (ccl_driver): Use them to check for integer overflow when
14858 decoding a CCL program. Many of the new checks are whether XINT (x)
14859 fits in int; it doesn't always, on 64-bit hosts. The new version
14860 doesn't catch all possible integer overflows, but it's an
14861 improvement. (Bug#8719)
14862
14863 * alloc.c (make_event_array): Use XINT, not XUINT.
14864 There's no need for unsigned here.
14865
14866 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14867 This follows up to the 2011-05-06 change that substituted uintptr_t
14868 for EMACS_INT. This case wasn't caught back then.
14869
14870 Rework Fformat to avoid integer overflow issues.
14871 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14872 now (part of C89). Include <verify.h>.
14873 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14874 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14875 (Fformat): Avoid the prepass trying to compute sizes; it was only
14876 approximate and thus did not catch overflow reliably. Instead, walk
14877 through the format just once, formatting and computing sizes as we go,
14878 checking for integer overflow at every step, and allocating a larger
14879 buffer as needed. Keep track separately whether the format is
14880 multibyte. Keep only the most-recently calculated precision, rather
14881 than them all. Record whether each argument has been converted to
14882 string. Use EMACS_INT, not int, for byte and char and arg counts.
14883 Support field widths and precisions larger than INT_MAX. Avoid
14884 sprintf's undefined behavior with conversion specifications such as %#d
14885 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14886 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14887 formatting out-of-range floating point numbers with int
14888 formats. (Bug#8668)
14889
14890 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14891
14892 * data.c: Avoid integer truncation in expressions involving floats.
14893 * data.c: Include <intprops.h>.
14894 (arith_driver): When there's an integer overflow in an expression
14895 involving floating point, convert the integers to floating point
14896 so that the resulting value does not suffer from catastrophic
14897 integer truncation. For example, on a 64-bit host (* 4
14898 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14899 Do not rely on undefined behavior after integer overflow.
14900
14901 merge count_size_as_multibyte, parse_str_to_multibyte
14902 * character.c, character.h (count_size_as_multibyte):
14903 Rename from parse_str_to_multibyte; all uses changed.
14904 Check for integer overflow.
14905 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14906 since it's now a duplicate of the other. This is more of
14907 a character than a buffer op, so better that it's in character.c.
14908 * fns.c, print.c: Adjust to above changes.
14909
14910 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14911
14912 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14913
14914 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14915
14916 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14917 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14918 (x_clipboard_manager_save): Now static.
14919 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14920
14921 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14922 (crypto_hash_function): Now static.
14923 Fix pointer signedness problems. Avoid unnecessary initializations.
14924
14925 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14926
14927 * termhooks.h (Vselection_alist): Make it terminal-local.
14928
14929 * terminal.c (create_terminal): Initialize it.
14930
14931 * xselect.c: Support for clipboard managers.
14932 (Vselection_alist): Move to termhooks.h as terminal-local var.
14933 (LOCAL_SELECTION): New macro.
14934 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14935 (symbol_to_x_atom): Remove gratuitous arg.
14936 (x_handle_selection_request, lisp_data_to_selection_data)
14937 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14938 (x_own_selection, x_get_local_selection, x_convert_selection):
14939 New arg, specifying work frame. Use terminal-local Vselection_alist.
14940 (some_frame_on_display): Delete unused function.
14941 (Fx_own_selection_internal, Fx_get_selection_internal)
14942 (Fx_disown_selection_internal, Fx_selection_owner_p)
14943 (Fx_selection_exists_p): New optional frame arg.
14944 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14945 (x_handle_selection_clear): Don't treat other terminals with the
14946 same keyboard specially. Use the terminal-local Vselection_alist.
14947 (x_clear_frame_selections): Use Frun_hook_with_args.
14948
14949 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14950
14951 * xterm.h: Add support for those atoms.
14952
14953 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14954
14955 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14956 (converted_selections, conversion_fail_tag): New global variables.
14957 (x_selection_request_lisp_error): Free the above.
14958 (x_get_local_selection): Remove unnecessary code.
14959 (x_reply_selection_request): Args changed; handle arbitrary array
14960 of converted selections stored in converted_selections.
14961 Separate the XChangeProperty and SelectionNotify steps.
14962 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14963 (x_convert_selection): New function.
14964 (x_handle_selection_event): Simplify.
14965 (x_get_foreign_selection): Don't ignore incoming requests while
14966 waiting for an answer; this will fail when we implement
14967 SAVE_TARGETS, and seems unnecessary anyway.
14968 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14969 (Vx_sent_selection_functions): Doc fix.
14970
14971 2011-05-26 Leo Liu <sdl.web@gmail.com>
14972
14973 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14974
14975 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14976
14977 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14978
14979 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14980 for fringe update if it has periodic bitmap.
14981 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14982 and fringe_bitmap_periodic_p.
14983
14984 * fringe.c (get_fringe_bitmap_data): New function.
14985 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14986 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14987 row. Mark glyph row for fringe update if periodicity changed.
14988
14989 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14990 for fringe update unless it has periodic bitmap.
14991
14992 2011-05-25 Kenichi Handa <handa@m17n.org>
14993
14994 * xdisp.c (get_next_display_element): Set correct it->face_id for
14995 a static composition.
14996
14997 2011-05-24 Leo Liu <sdl.web@gmail.com>
14998
14999 * deps.mk (fns.o):
15000 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15001
15002 * fns.c (crypto_hash_function, Fsha1): New function.
15003 (Fmd5): Use crypto_hash_function.
15004 (syms_of_fns): Add Ssha1.
15005
15006 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15007
15008 * gnutls.c: Remove unused macros.
15009 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15010 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15011 Remove macros that are defined and never used.
15012 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15013
15014 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15015
15016 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15017 (Fx_get_selection_internal): Minor cleanup.
15018 (Fx_own_selection_internal): Rename arguments for consistency with
15019 select.el.
15020
15021 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15022
15023 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15024
15025 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15026
15027 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15028
15029 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15030
15031 * dispnew.c (scrolling_window): Don't exclude the case that the
15032 last enabled row in the desired matrix touches the bottom boundary.
15033
15034 2011-05-21 Glenn Morris <rgm@gnu.org>
15035
15036 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15037 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15038 and add some more files.
15039
15040 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15041
15042 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15043 report_file_error introduced by the change from 2011-05-07.
15044
15045 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15046
15047 * systime.h (Time): Define only if emacs is defined.
15048 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15049 where the include path doesn't have X11/X.h by default. See
15050 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15051
15052 2011-05-20 Kenichi Handa <handa@m17n.org>
15053
15054 * composite.c (find_automatic_composition): Fix previous change.
15055
15056 2011-05-20 Glenn Morris <rgm@gnu.org>
15057
15058 * lisp.mk: New file, split from Makefile.in.
15059 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15060 (shortlisp): Remove.
15061 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15062
15063 2011-05-19 Glenn Morris <rgm@gnu.org>
15064
15065 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15066 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15067 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15068 (lisp): Set the order to that of loadup.el.
15069 (shortlisp): Make it a copy of $lisp.
15070 (SOME_MACHINE_LISP): Remove.
15071 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15072 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15073
15074 2011-05-18 Kenichi Handa <handa@m17n.org>
15075
15076 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15077 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15078 (find_automatic_composition): Mostly rewrite for efficiency.
15079
15080 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
15081
15082 * makefile.w32-in: Update dependencies.
15083
15084 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15085
15086 * menu.c: Include limits.h (fixes the MS-Windows build broken by
15087 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15088
15089 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
15090
15091 Fix some integer overflow issues, such as string length overflow.
15092
15093 * insdel.c (count_size_as_multibyte): Check for string overflow.
15094
15095 * character.c (lisp_string_width): Check for string overflow.
15096 Use EMACS_INT, not int, for string indexes and lengths; in
15097 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15098 the resulting string length overflows an EMACS_INT; instead,
15099 report a string overflow if no precision given. When checking for
15100 precision exhaustion, use a check that cannot possibly have
15101 integer overflow. (Bug#8675)
15102 * character.h (lisp_string_width): Adjust to new signature.
15103
15104 * alloc.c (string_overflow): New function.
15105 (Fmake_string): Use it. This doesn't change behavior, but saves
15106 a few bytes and will simplify future changes.
15107 * character.c (string_escape_byte8): Likewise.
15108 * lisp.h (string_overflow): New decl.
15109
15110 Fixups, following up to the user-interface timestamp change.
15111 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15112 for UI timestamps, instead of unsigned long.
15113 * msdos.c (mouse_get_pos): Likewise.
15114 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15115 * w32gui.h (Time): Define by including "systime.h" rather than by
15116 declaring it ourselves. (Bug#8664)
15117
15118 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15119 * image.c (clear_image_cache): Likewise.
15120
15121 * term.c (term_mouse_position): Don't assume time_t wraparound.
15122
15123 Be more systematic about user-interface timestamps.
15124 Before, the code sometimes used 'Time', sometimes 'unsigned long',
15125 and sometimes 'EMACS_UINT', to represent these timestamps.
15126 This change causes it to use 'Time' uniformly, as that's what X uses.
15127 This makes the code easier to follow, and makes it easier to catch
15128 integer overflow bugs such as Bug#8664.
15129 * frame.c (Fmouse_position, Fmouse_pixel_position):
15130 Use Time, not unsigned long, for user-interface timestamps.
15131 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15132 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15133 * keyboard.h (last_event_timestamp): Likewise.
15134 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15135 * menu.h (xmenu_show): Likewise.
15136 * term.c (term_mouse_position): Likewise.
15137 * termhooks.h (struct input_event.timestamp): Likewise.
15138 (struct terminal.mouse_position_hook): Likewise.
15139 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15140 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15141 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15142 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15143 what it was before.
15144 * menu.h, termhooks.h: Include "systime.h", for Time.
15145
15146 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15147 Don't assume that the difference between two unsigned long values
15148 can fit into an integer. At this point, we know button_down_time
15149 <= event->timestamp, so the difference must be nonnegative, so
15150 there's no need to cast the result if double-click-time is
15151 nonnegative, as it should be; check that it's nonnegative, just in
15152 case. This bug is triggered when events are more than 2**31 ms
15153 apart (about 25 days). (Bug#8664)
15154
15155 * xselect.c (last_event_timestamp): Remove duplicate decl.
15156 (x_own_selection): Remove needless cast to unsigned long.
15157
15158 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15159 that always fit in int. Use a sentinel instead of a counter, to
15160 avoid a temp and to allay GCC's concerns about possible int overflow.
15161 * frame.h (struct frame): Use int for menu_bar_items_used
15162 instead of EMACS_INT, since it always fits in int.
15163
15164 * menu.c (grow_menu_items): Check for int overflow.
15165
15166 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15167
15168 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15169 Before, the code was not consistent. These values cannot exceed
15170 2**31 - 1 so there's no need to make them unsigned.
15171 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15172 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15173 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15174 as modifiers.
15175 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15176
15177 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15178 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15179 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15180 presumably because the widths might not match.
15181
15182 * window.c (size_window): Avoid needless test at loop start.
15183
15184 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15185
15186 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15187
15188 2011-05-12 Drew Adams <drew.adams@oracle.com>
15189
15190 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15191
15192 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15193
15194 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15195 `width' to `bar_area_x' and `bar_area_width', respectively.
15196 (x_scroll_run): Take account of fringe background extension.
15197
15198 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15199 Rename local vars `left' and `width' to `bar_area_x' and
15200 `bar_area_width', respectively.
15201 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15202 background extension.
15203
15204 2011-05-10 Jim Meyering <meyering@redhat.com>
15205
15206 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15207
15208 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
15209
15210 * image.c (Finit_image_library): Return t for built-in image types,
15211 like pbm and xbm. (Bug#8640)
15212
15213 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15214
15215 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15216
15217 2011-05-07 Eli Zaretskii <eliz@gnu.org>
15218
15219 * w32console.c (Fset_screen_color): Doc fix.
15220 (Fget_screen_color): New function.
15221 (syms_of_ntterm): Defsubr it.
15222
15223 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15224 unlink the temporary file if Fcall_process didn't create it in the
15225 first place.
15226 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15227 child process will be redirected to a file specified with `:file'.
15228 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15229 cue to call_process_cleanup not to close that handle.
15230
15231 2011-05-07 Ben Key <bkey76@gmail.com>
15232
15233 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15234 one of two shell specific rules, either bootstrap-temacs-CMD or
15235 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15236 to the previous implementation of the bootstrap-temacs rule.
15237 The bootstrap-temacs-CMD rule is similar to the previous
15238 implementation of the bootstrap-temacs rule except that it
15239 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15240 variable.
15241
15242 These changes, along with some changes to nt/configure.bat,
15243 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15244 earlier fix to add support for --cflags and --ldflags options
15245 that include quotes so that it works whether make uses cmd or
15246 sh as the shell.
15247
15248 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
15249
15250 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15251 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15252 is a constant.
15253 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15254 a string. Handle both cases.
15255 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15256 (Fdbus_register_method): Use Qinvalid_function.
15257
15258 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15259
15260 * makefile.w32-in: Update dependencies.
15261 (LISP_H): Add inttypes.h and stdin.h.
15262 (PROCESS_H): Add unistd.h.
15263
15264 2011-05-06 Eli Zaretskii <eliz@gnu.org>
15265
15266 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15267 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15268
15269 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
15270
15271 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15272
15273 * term.c (vfatal): Remove stray call to va_end.
15274 It's not needed and the C Standard doesn't allow it here anyway.
15275
15276 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15277 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15278
15279 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15280 bytes.
15281
15282 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15283
15284 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15285
15286 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15287
15288 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15289
15290 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15291
15292 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15293 * charset.c (Fdefine_charset_internal): Don't initialize
15294 charset.code_space[15]. The value was garbage, on hosts with
15295 32-bit int (Bug#8600).
15296
15297 * lread.c (read_integer): Be more consistent with string-to-number.
15298 Use string_to_number to do the actual conversion; this avoids
15299 rounding errors and fixes some other screwups. Without this fix,
15300 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15301 (digit_to_number): Move earlier, for benefit of read_integer.
15302 Return -1 if the digit is out of range for the base, -2 if it is
15303 not a digit in any supported base. (Bug#8602)
15304
15305 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15306
15307 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15308 to match comment at start of function. This also removes a
15309 GCC warning about overflow in a 32+64-bit port.
15310
15311 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15312
15313 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15314 Reported by Stefan Monnier in
15315 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15316 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15317 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15318
15319 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15320 (EMACS_UINTPTR): Likewise, with uintptr_t.
15321
15322 * lisp.h: Prefer 64-bit EMACS_INT if available.
15323 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15324 on 32-bit hosts that have 64-bit int, so that they can access
15325 large files.
15326 However, temporarily disable this change unless the temporary
15327 symbol WIDE_EMACS_INT is defined.
15328
15329 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15330
15331 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15332 This removes an assumption that EMACS_INT and long are the same
15333 width as pointers. The assumption is true for Emacs porting targets
15334 now, but we want to make other targets possible.
15335 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15336 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15337 In the rest of the code, change types of integers that hold casted
15338 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15339 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15340 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15341 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15342 No need to cast type when ORing.
15343 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15344 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15345 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15346 assume EMACS_INT is the same width as char *.
15347 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15348 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15349 Remove no-longer-needed casts.
15350 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15351 (xg_tool_bar_help_callback, xg_make_tool_item):
15352 Use EMACS_INTPTR to hold an integer
15353 that will be cast to void *; this can avoid a GCC warning
15354 if EMACS_INT is not the same width as void *.
15355 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15356 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15357 (current_message_1, set_message_1):
15358 Use a local to convert to proper width without a cast.
15359 * xmenu.c (dialog_selection_callback): Likewise.
15360
15361 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15362 Also, don't assume VALBITS / RAND_BITS is less than 5,
15363 and don't rely on undefined behavior when shifting a 1 left into
15364 the sign bit.
15365 * lisp.h (get_random): Change signature to match.
15366
15367 * lread.c (hash_string): Use size_t, not int, for hash computation.
15368 Normally we prefer signed values; but hashing is special, because
15369 it's better to use unsigned division on hash table sizes so that
15370 the remainder is nonnegative. Also, size_t is the natural width
15371 for hashing into memory. The previous code used 'int', which doesn't
15372 retain enough info to hash well into very large tables.
15373 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15374
15375 * dbusbind.c: Don't possibly lose pointer info when converting.
15376 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15377 Use XPNTR rather than XHASH, so that the high-order bits of
15378 the pointer aren't lost when converting through void *.
15379
15380 * eval.c (Fautoload): Don't double-shift a pointer.
15381
15382 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15383
15384 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15385
15386 * gnutls.c (DEF_GNUTLS_FN):
15387 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15388
15389 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15390
15391 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15392 marker. (Bug#8610)
15393
15394 2011-05-05 Eli Zaretskii <eliz@gnu.org>
15395
15396 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15397 New version that can reserve upto 2GB of heap space.
15398
15399 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
15400
15401 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15402
15403 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15404
15405 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15406 `gnutls_certificate_set_x509_key_file'.
15407
15408 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
15409
15410 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15411 Update dependencies.
15412
15413 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15414
15415 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15416 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15417 Remove unused parameter `fildes'.
15418 * process.c (read_process_output, send_process): Don't pass it.
15419
15420 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15421
15422 Fix previous change: the library cache is defined in w32.c.
15423 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15424 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15425
15426 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15427
15428 Implement dynamic loading of GnuTLS on Windows.
15429
15430 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15431 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15432 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15433 Declare.
15434
15435 * gnutls.c (Qgnutls_dll): Define.
15436 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15437 (gnutls_*): Declare function pointers.
15438 (init_gnutls_functions): New function to initialize function pointers.
15439 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15440 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15441 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15442 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15443 (emacs_gnutls_write, emacs_gnutls_read)
15444 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15445 (Fgnutls_available_p): New function.
15446 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15447 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15448 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15449
15450 * image.c: Include w32.h.
15451 (Vimage_type_cache): Delete.
15452 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15453 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15454 (w32_delayed_load): Move to w32.c.
15455
15456 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15457
15458 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15459 (w32_delayed_load): Move from image.c. When loading a library, record
15460 its filename in the :loaded-from property of the library id.
15461 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15462 Initialize and staticpro them.
15463 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15464
15465 * process.c: Include lisp.h before w32.h, not after.
15466 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15467 instead of gnutls_record_check_pending.
15468
15469 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15470
15471 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15472
15473 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15474 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15475 as passed in.
15476
15477 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15478
15479 * xterm.c (x_set_frame_alpha): Do not set property on anything
15480 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15481
15482 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15483
15484 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15485
15486 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15487
15488 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15489 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15490 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15491 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15492 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15493 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15494 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15495 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15496 (Qgnutls_bootprop_callbacks_verify): Make static.
15497
15498 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15499
15500 * callproc.c: Indentation fixup.
15501
15502 * sysdep.c (wait_for_termination_1): Make static.
15503 (wait_for_termination, interruptible_wait_for_termination):
15504 Move after wait_for_termination_1.
15505
15506 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15507
15508 * sysdep.c (interruptible_wait_for_termination): New function
15509 which is like wait_for_termination, but allows keyboard
15510 interruptions.
15511
15512 * callproc.c (Fcall_process): Add (:file "file") as an option for
15513 the STDOUT buffer.
15514 (Fcall_process_region): Ditto.
15515
15516 2011-04-30 Eli Zaretskii <eliz@gnu.org>
15517
15518 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15519 rather than `XVECTOR (FOO)->size'.
15520
15521 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15522 inttypes.h, as a gnulib replacement is used if it not available in
15523 system headers.
15524
15525 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15526
15527 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15528 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15529 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15530
15531 * coding.c (coding_alloc_by_realloc): Error out if destination
15532 will grow beyond MOST_POSITIVE_FIXNUM.
15533 (decode_coding_emacs_mule): Abort if there isn't enough place in
15534 charbuf for the composition carryover bytes. Reserve an extra
15535 space for up to 2 characters produced in a loop.
15536 (decode_coding_iso_2022): Abort if there isn't enough place in
15537 charbuf for the composition carryover bytes.
15538
15539 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15540
15541 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15542 aborting when %lld or %lll format is passed.
15543 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15544 %llo or %llx format is passed. (Bug#8545)
15545
15546 * window.c (window_scroll_line_based): Use a marker instead of
15547 simple variables to record original value of point. (Bug#7952)
15548
15549 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15550 produced by %s or %c overflows available buffer space. (Bug#8545)
15551
15552 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15553
15554 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15555 (SIZE_MAX): Move defn after all includes, as they might #define it.
15556
15557 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15558
15559 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15560
15561 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15562
15563 * keyboard.c (Qdelayed_warnings_hook): Define.
15564 (command_loop_1): Run `delayed-warnings-hook'
15565 if Vdelayed_warnings_list is non-nil.
15566 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15567 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15568
15569 2011-04-28 Eli Zaretskii <eliz@gnu.org>
15570
15571 * doprnt.c (doprnt): Don't return value smaller than the buffer
15572 size if the message was truncated. (Bug#8545).
15573
15574 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15575
15576 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15577 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15578
15579 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15580
15581 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15582
15583 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
15584
15585 * makefile.w32-in: Update dependencies.
15586
15587 2011-04-27 Eli Zaretskii <eliz@gnu.org>
15588
15589 Improve `doprnt' and its usage. (Bug#8545)
15590 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15591 `format_end'. Remove support for %l as a conversion specifier.
15592 Don't use xrealloc. Improve diagnostics when the %l size modifier
15593 is used. Update the commentary.
15594
15595 * eval.c (verror): Simplify calculation of size_t.
15596
15597 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15598 messages.
15599
15600 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15601
15602 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15603 change.
15604
15605 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15606
15607 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15608 This makes this file independent of the recent pseudovector change.
15609
15610 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
15611
15612 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15613
15614 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15615 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15616 Remove unused local.
15617 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15618
15619 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
15620 GCC 4.6.0 optimizes based on type-based alias analysis.
15621 For example, if b is of type struct buffer * and v of type struct
15622 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15623 != &v->size, and therefore "v->size = 1; b->size = 2; return
15624 v->size;" must therefore return 1. This assumption is incorrect
15625 for Emacs, since it type-puns struct Lisp_Vector * with many other
15626 types. To fix this problem, this patch adds a new type struct
15627 vectorlike_header that documents the constraints on layout of vectors
15628 and pseudovectors, and helps optimizing compilers not get fooled
15629 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15630 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15631 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15632 the size member.
15633 (XSETPVECTYPE): Rewrite in terms of new macro.
15634 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15635 This is a bit clearer, and further avoids the possibility of
15636 undesirable aliasing.
15637 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15638 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15639 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15640 since Lisp_Subr is a special case (no "next" field).
15641 (ASIZE): Now uses header.size rather than size.
15642 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15643 to avoid the hassle of writing XVECTOR (foo)->header.size.
15644 (struct vectorlike_header): New type.
15645 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15646 object, to help avoid aliasing.
15647 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15648 (SUBRP): Likewise, since Lisp_Subr is a special case.
15649 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15650 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15651 (struct Lisp_Hash_Table): Combine first two members into a single
15652 struct vectorlike_header member. All uses of "size" and "next" members
15653 changed to be "header.size" and "header.next".
15654 * buffer.h (struct buffer): Likewise.
15655 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15656 * frame.h (struct frame): Likewise.
15657 * process.h (struct Lisp_Process): Likewise.
15658 * termhooks.h (struct terminal): Likewise.
15659 * window.c (struct save_window_data, struct saved_window): Likewise.
15660 * window.h (struct window): Likewise.
15661 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15662 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15663 * buffer.c (init_buffer_once): Likewise.
15664 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15665 special case.
15666 * process.c (Fformat_network_address): Use local var for size,
15667 for brevity.
15668
15669 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15670
15671 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15672 * data.c (atof): Remove decl; no longer used or needed.
15673 (digit_to_number): Move to lread.c.
15674 (Fstring_to_number): Use new string_to_number function, to be
15675 consistent with how the Lisp reader treats infinities and NaNs.
15676 Do not assume that floating-point numbers represent EMACS_INT
15677 without losing information; this is not true on most 64-bit hosts.
15678 Avoid double-rounding errors, by insisting on integers when
15679 parsing non-base-10 numbers, as the documentation specifies.
15680 * lisp.h (string_to_number): New decl, replacing ...
15681 (isfloat_string): Remove.
15682 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15683 (read1): Do not accept +. and -. as integers; this
15684 appears to have been a coding error. Similarly, do not accept
15685 strings like +-1e0 as floating point numbers. Do not report
15686 overflow for integer overflows unless the base is not 10 which
15687 means we have no simple and reliable way to continue.
15688 Break out the floating-point parsing into a new
15689 function string_to_number, so that Fstring_to_number parses
15690 floating point numbers consistently with the Lisp reader.
15691 (digit_to_number): Move here from data.c. Make it static inline.
15692 (E_CHAR, EXP_INT): Remove, replacing with ...
15693 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15694 (string_to_number): New function, replacing isfloat_string.
15695 This function checks for valid syntax and produces the resulting
15696 Lisp float number too. Rework it so that string-to-number
15697 no longer mishandles examples like "1.0e+". Use strtoumax,
15698 so that overflow for non-base-10 numbers is reported only when
15699 there's no portable and simple way to convert to floating point.
15700
15701 * textprop.c (set_text_properties_1): Rewrite for clarity,
15702 and to avoid GCC warning about integer overflow.
15703
15704 * intervals.h (struct interval): Use EMACS_INT for members
15705 where EMACS_UINT might cause problems. See
15706 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15707 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15708 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15709 All uses changed.
15710 (offset_intervals): Tell GCC not to worry about length overflow
15711 when negating a negative length.
15712
15713 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15714 (overrun_check_free): Likewise.
15715
15716 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15717 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15718 word size.
15719
15720 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15721 (gnutls_make_error): Rename local to avoid shadowing.
15722 (gnutls_emacs_global_deinit): ifdef out; not used.
15723 (Fgnutls_boot): Use const for pointer to readonly storage.
15724 Comment out unused local. Fix pointer signedness problems.
15725
15726 * lread.c (openp): Don't stuff size_t into an 'int'.
15727 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15728 about possible signed overflow.
15729
15730 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15731 (GDK_KEY_g): Don't define if already defined.
15732 (xg_prepare_tooltip): Avoid pointer signedness problem.
15733 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15734
15735 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15736 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15737
15738 * xfns.c (Fx_window_property): Simplify a bit,
15739 to make a bit faster and to avoid GCC 4.6.0 warning.
15740 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15741
15742 * fns.c (internal_equal): Don't assume size_t fits in int.
15743
15744 * alloc.c (compact_small_strings): Tighten assertion a little.
15745
15746 Replace pEd with more-general pI, and fix some printf arg casts.
15747 * lisp.h (pI): New macro, generalizing old pEd macro to other
15748 conversion specifiers. For example, use "...%"pI"d..." rather
15749 than "...%"pEd"...".
15750 (pEd): Remove. All uses replaced with similar uses of pI.
15751 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15752 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15753 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15754 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15755 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15756 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15757 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15758 64-bit hosts.
15759 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15760 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15761 * print.c (safe_debug_print, print_object): Likewise.
15762 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15763 to int.
15764 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15765 avoiding the 0 flag, which is not portable.
15766 * process.c (Fmake_network_process): Use pI to avoid cast.
15767 * region-cache.c (pp_cache): Likewise.
15768 * xdisp.c (decode_mode_spec): Likewise.
15769 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15770 behavior on 64-bit hosts with printf arg.
15771 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15772 (x_stop_queuing_selection_requests): Likewise.
15773 (x_get_window_property): Don't truncate byte count to an 'int'
15774 when tracing.
15775
15776 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15777 here, since it parses constructs like leading '-' and spaces,
15778 which are not wanted; and it overflows with large numbers.
15779 Instead, simply match F[0-9]+, which is what is wanted anyway.
15780
15781 * alloc.c: Remove unportable assumptions about struct layout.
15782 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15783 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15784 (allocate_vectorlike, make_pure_vector): Use the new macros,
15785 plus offsetof, to remove unportable assumptions about struct layout.
15786 These assumptions hold on all porting targets that I know of, but
15787 they are not guaranteed, they're easy to remove, and removing them
15788 makes further changes easier.
15789
15790 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15791 This doesn't fix a bug but makes the code clearer.
15792 (string_overrun_cookie): Now const. Use initializers that
15793 don't formally overflow signed char, to avoid warnings.
15794 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15795 can cause Emacs to crash when string overrun checking is enabled.
15796 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15797 multiple of sizeof (EMACS_INT); it need not be, if
15798 alignof(EMACS_INT) < sizeof (EMACS_INT).
15799 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15800
15801 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
15802
15803 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15804
15805 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15806
15807 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15808 supposed to be handshaking. (Bug#8556)
15809 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15810
15811 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15812
15813 * lisp.h (Qdebug): List symbol.
15814 * eval.c (Qdebug): Restore global linkage.
15815 * keyboard.c (debug-on-event): New variable.
15816 (handle_user_signal): Break into debugger when debug-on-event
15817 matches the current signal symbol.
15818
15819 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15820
15821 * alloc.c (check_sblock, check_string_bytes)
15822 (check_string_free_list): Convert to standard C.
15823
15824 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15825
15826 * w32.c (emacs_gnutls_push): Fix typo.
15827
15828 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15829
15830 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15831 "cast to pointer from integer of different size".
15832
15833 Improve doprnt and its use in verror. (Bug#8545)
15834 * doprnt.c (doprnt): Document the set of format control sequences
15835 supported by the function. Use SAFE_ALLOCA instead of always
15836 using `alloca'.
15837
15838 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15839 is one byte too soon. Don't use xrealloc; instead xfree and
15840 xmalloc anew.
15841
15842 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15843
15844 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15845 callbacks stage.
15846
15847 * gnutls.c: Renamed global_initialized to
15848 gnutls_global_initialized. Added internals for the
15849 :verify-hostname-error, :verify-error, and :verify-flags
15850 parameters of `gnutls-boot' and documented those parameters in the
15851 docstring. Start callback support.
15852 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15853 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15854 on error. Return error code.
15855 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15856 (emacs_gnutls_read): Likewise.
15857 (Fgnutls_boot): Return handshake error code.
15858 (emacs_gnutls_handle_error): New function.
15859 (wsaerror_to_errno): Likewise.
15860
15861 * w32.h (emacs_gnutls_pull): Add prototype.
15862 (emacs_gnutls_push): Likewise.
15863
15864 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15865 (emacs_gnutls_push): Likewise.
15866
15867 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15868
15869 * process.c (wait_reading_process_output): Check if GnuTLS
15870 buffered some data internally if no FDs are set for TLS
15871 connections.
15872
15873 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15874 (LIBS): Link to USER_LIBS.
15875 ($(BLD)/gnutls.$(0)): New target.
15876
15877 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15878
15879 * xdisp.c (handle_single_display_spec): Rename the
15880 display_replaced_before_p argument into display_replaced_p, to
15881 make it consistent with the commentary. Fix typos in the
15882 commentary.
15883
15884 * textprop.c (syms_of_textprop): Remove dead code.
15885 (copy_text_properties): Delete obsolete commentary about an
15886 interface that was deleted long ago. Fix typos in the description
15887 of arguments.
15888
15889 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15890 to changes in oldXMenu/XMenu.h from 2011-04-16.
15891 <menu_help_message, prev_menu_help_message>: Constify.
15892 (IT_menu_make_room): menu->help_text is now `const char **';
15893 adjust.
15894
15895 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15896 to changes in oldXMenu/XMenu.h from 2011-04-16.
15897 (struct XMenu): Declare `help_text' `const char **'.
15898
15899 * xfaces.c <Qunspecified>: Make extern again.
15900
15901 * syntax.c: Include sys/types.h before including regex.h, as
15902 required by POSIX.
15903
15904 * doc.c (get_doc_string): Improve the format passed to `error'.
15905
15906 * doprnt.c (doprnt): Improve commentary.
15907
15908 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15909
15910 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15911 them with etags.
15912
15913 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15914 changes in globals.h immediately force recompilation.
15915 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15916 $(CURDIR)/s/ms-w32.h.
15917 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15918
15919 * character.c (Fchar_direction): Function deleted.
15920 (syms_of_character): Don't defsubr it.
15921 <char-direction-table>: Deleted.
15922
15923 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15924
15925 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15926 * doprnt.c: Include limits.h.
15927 (SIZE_MAX): New macro.
15928 (doprnt): Return a size_t value. 2nd arg is now size_t.
15929 Many local variables are now size_t instead of int or unsigned.
15930 Improve overflow protection. Support `l' modifier for integer
15931 conversions. Support %l conversion. Don't assume an EMACS_INT
15932 argument for integer conversions and for %c.
15933
15934 * lisp.h (doprnt): Restore prototype.
15935
15936 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15937 $(SRC)/character.h.
15938
15939 * Makefile.in (base_obj): Add back doprnt.o.
15940
15941 * deps.mk (doprnt.o): Add back prerequisites.
15942 (callint.o): Depend on character.h.
15943
15944 * eval.c (internal_lisp_condition_case): Include the handler
15945 representation in the error message.
15946 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15947 when breaking from the loop.
15948
15949 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15950
15951 * callint.c (Fcall_interactively): When displaying error message
15952 about invalid control letter, pass the character's codepoint, not
15953 a pointer to its multibyte form. Improve display of the character
15954 in octal and display also its hex code.
15955
15956 * character.c (char_string): Use %x to display the (unsigned)
15957 codepoint of an invalid character, to avoid displaying a bogus
15958 negative value.
15959
15960 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15961 `error', not SYMBOL_NAME itself.
15962
15963 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15964 character arguments to `error'.
15965
15966 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15967 to `error' in error message about FINAL_CHAR argument. Make sure
15968 FINAL_CHAR is a character, and use %c when it is passed as
15969 argument to `error'.
15970
15971 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15972
15973 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15974
15975 * w32.c: Include <time.h>.
15976 (sys_localtime): New function.
15977
15978 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15979
15980 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15981
15982 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15983
15984 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15985
15986 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15987 zombies (Bug#8467).
15988
15989 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15990
15991 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15992 gl_state.e_property when gl_state.object is Qt.
15993
15994 * insdel.c (make_gap_larger): Remove limitation of buffer size
15995 to <= INT_MAX.
15996
15997 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15998
15999 * xdisp.c (lookup_glyphless_char_display)
16000 (produce_glyphless_glyph): Handle cons cell entry in
16001 glyphless-char-display.
16002 (Vglyphless_char_display): Document it.
16003
16004 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16005 glyphless-char-display.
16006
16007 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
16008
16009 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16010
16011 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16012
16013 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16014 definition for no-X builds.
16015
16016 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
16017
16018 Static checks with GCC 4.6.0 and non-default toolkits.
16019
16020 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16021
16022 * process.c (keyboard_bit_set): Define only if SIGIO.
16023 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16024 (send_process): Repair possible setjmp clobbering.
16025
16026 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16027
16028 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16029
16030 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16031
16032 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16033 Define only if needed.
16034
16035 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16036 by pacifying GCC about it. Maybe it's time to retire it?
16037 * xfaces.c (USG, __TIMEVAL__): Likewise.
16038
16039 * dispextern.h (struct redisplay_interface): Rename param
16040 to avoid shadowing.
16041 * termhooks.h (struct terminal): Likewise.
16042 * xterm.c (xembed_send_message): Likewise.
16043
16044 * insdel.c (make_gap_smaller): Define only if
16045 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16046
16047 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16048 it.
16049
16050 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16051 so that we aren't warned about unused symbols.
16052
16053 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16054
16055 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16056
16057 * xfns.c (x_real_positions): Mark locals as initialized.
16058
16059 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16060
16061 * xterm.c: Fix problems found by static analysis with other toolkits.
16062 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16063 (x_dispatch_event): Declare static if USE_GTK, and
16064 define if USE_GTK || USE_X_TOOLKIT.
16065 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16066 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16067 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16068 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16069
16070 * xmenu.c (menu_help_callback): Pointer type fixes.
16071 Use const pointers when pointing at readonly data. Avoid pointer
16072 signedness clashes.
16073 (FALSE): Remove unused macro.
16074 (update_frame_menubar): Remove unused decl.
16075
16076 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16077
16078 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16079 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16080 (single_menu_item): Rename local to avoid shadowing.
16081
16082 * keyboard.c (make_lispy_event): Remove unused local var.
16083
16084 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16085 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16086
16087 * bitmaps: Change bitmaps from unsigned char back to the X11
16088 compatible char. Avoid the old compiler warnings about
16089 out-of-range initializers by using, for example, '\xab' rather
16090 than 0xab.
16091
16092 * xgselect.c (xgselect_initialize): Check vs interface
16093 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16094
16095 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16096
16097 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16098 to read-only memory.
16099
16100 * fns.c (vector): Remove; this old hack is no longer needed.
16101
16102 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16103 Remove unused var.
16104 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16105
16106 * xrdb.c (x_load_resources): Omit unused local.
16107
16108 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16109 (x_window): Rename locals to avoid shadowing.
16110 (USG): Use the kludged USG macro, to pacify gcc.
16111
16112 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16113 (x_term_init): Remove local to avoid shadowing.
16114
16115 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16116
16117 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16118 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16119
16120 2011-04-16 Eli Zaretskii <eliz@gnu.org>
16121
16122 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16123
16124 Fix regex.c, syntax.c and friends for buffers > 2GB.
16125 * syntax.h (struct gl_state_s): Declare character position members
16126 EMACS_INT.
16127
16128 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16129
16130 * textprop.c (verify_interval_modification, interval_of):
16131 Declare arguments EMACS_INT.
16132
16133 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16134 EMACS_INT.
16135
16136 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16137
16138 * indent.c (Fvertical_motion): Local variable it_start is now
16139 EMACS_INT.
16140
16141 * regex.c (re_match, re_match_2, re_match_2_internal)
16142 (bcmp_translate, regcomp, regexec, print_double_string)
16143 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16144 (re_compile_pattern, re_exec): Declare arguments and local
16145 variables `size_t' and `ssize_t' and return values `regoff_t', as
16146 appropriate.
16147 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16148 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16149 <compile_stack_type>: `size' and `avail' are now `size_t'.
16150
16151 * regex.h <regoff_t>: Use ssize_t, not int.
16152 (re_search, re_search_2, re_match, re_match_2): Arguments that
16153 specify buffer/string position and length are now ssize_t and
16154 size_t. Return type is regoff_t.
16155
16156 2011-04-16 Ben Key <bkey76@gmail.com>
16157
16158 * nsfont.m: Fixed bugs in ns_get_family and
16159 ns_descriptor_to_entity that were caused by using free to
16160 deallocate memory blocks that were allocated by xmalloc (via
16161 xstrdup). This caused Emacs to crash when compiled with
16162 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16163 --enable-checking=xmallocoverrun). xfree is now used to
16164 deallocate these memory blocks.
16165
16166 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
16167
16168 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16169
16170 emacs_write: Accept and return EMACS_INT for sizes.
16171 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16172 et seq.
16173 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16174 Accept and return EMACS_INT.
16175 (emacs_gnutls_write): Return the number of bytes written on
16176 partial writes.
16177 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16178 (emacs_read, emacs_write): Remove check for negative size, as the
16179 Emacs source code has been audited now.
16180 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16181 (emacs_read, emacs_write): Use it.
16182 * process.c (send_process): Adjust to the new signatures of
16183 emacs_write and emacs_gnutls_write. Do not attempt to store
16184 a byte offset into an 'int'; it might overflow.
16185 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16186
16187 * sound.c: Don't assume sizes fit in 'int'.
16188 (struct sound_device.period_size, alsa_period_size):
16189 Return EMACS_INT, not int.
16190 (struct sound_device.write, vox_write, alsa_write):
16191 Accept EMACS_INT, not int.
16192 (wav_play, au_play): Use EMACS_INT to store sizes and to
16193 record read return values.
16194
16195 2011-04-15 Ben Key <bkey76@gmail.com>
16196
16197 * keyboard.c (Qundefined): Don't declare static since it is used
16198 in nsfns.m.
16199 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16200 static since they are used in nsfont.m.
16201
16202 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16203
16204 * process.c (Qprocessp): Don't declare static.
16205 * lisp.h (Qprocessp): Declare again.
16206
16207 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
16208
16209 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16210
16211 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16212
16213 Improve C-level modularity by making more things 'static'.
16214
16215 Don't publish debugger-only interfaces to other modules.
16216 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16217 (verify_bytepos, count_markers): Move decls to the only modules
16218 that need them.
16219 * region-cache.h (pp_cache): Likewise.
16220 * window.h (check_all_windows): Likewise.
16221 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16222
16223 * sysdep.c (croak): Now static, if
16224 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16225 * syssignal.h (croak): Declare only if not static.
16226
16227 * alloc.c (refill_memory_reserve): Now static if
16228 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16229 * lisp.h (refill_memory_reserve): Declare only if not static.
16230
16231 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16232 Define only if USE_LUCID.
16233
16234 * xrdb.c (x_customization_string, x_rm_string): Now static.
16235
16236 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16237 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16238
16239 * xdisp.c (draw_row_with_mouse_face): Now static.
16240 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16241
16242 * window.h (check_all_windows): Mark externally visible.
16243
16244 * window.c (window_deletion_count): Now static.
16245
16246 * undo.c: Make symbols static if they're not exported.
16247 (last_undo_buffer, last_boundary_position, pending_boundary):
16248 Now static.
16249
16250 * textprop.c (interval_insert_behind_hooks): Now static.
16251 (interval_insert_in_front_hooks): Likewise.
16252
16253 * term.c: Make symbols static if they're not exported.
16254 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16255 (max_frame_lines, tty_set_terminal_modes):
16256 (tty_reset_terminal_modes, tty_turn_off_highlight):
16257 (get_tty_terminal): Now static.
16258 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16259 * termhooks.h (term_mouse_moveto): Do not declare if
16260 HAVE_WINDOW_SYSTEM.
16261 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16262 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16263
16264 * sysdep.c: Make symbols static if they're not exported.
16265 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16266 Now static.
16267 (sigprocmask_set, full_mask): Remove; unused.
16268 (wait_debugging): Mark as visible.
16269 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16270 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16271
16272 * syntax.c (syntax_temp): Define only if !__GNUC__.
16273
16274 * sound.c (current_sound_device, current_sound): Now static.
16275
16276 * search.c (searchbufs, searchbuf_head): Now static.
16277
16278 * scroll.c (scroll_cost): Remove; unused.
16279 * dispextern.h (scroll_cost): Remove decl.
16280
16281 * region-cache.h (pp_cache): Mark as externally visible.
16282
16283 * process.c: Make symbols static if they're not exported.
16284 (process_tick, update_tick, create_process, chan_process):
16285 (Vprocess_alist, proc_buffered_char, datagram_access):
16286 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16287 (deactivate_process): Mark defn as static, as well as decl.
16288 * lisp.h (create_process): Remove decl.
16289 * process.h (chan_process, Vprocess_alist): Remove decls.
16290
16291 * print.c: Make symbols static if they're not exported.
16292 (print_depth, new_backquote_output, being_printed, print_buffer):
16293 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16294 (print_interval, print_number_index, initial_stderr_stream):
16295 Now static.
16296 * lisp.h (Fprinc): Remove decl.
16297 (debug_output_compilation_hack): Mark as externally visible.
16298
16299 * sysdep.c (croak): Move decl from here to syssignal.h.
16300 * syssignal.h (croak): Put it here, so the API can be checked when
16301 'croak' is called from dissociate_if_controlling_tty.
16302
16303 * minibuf.c: Make symbols static if they're not exported.
16304 (minibuf_save_list, choose_minibuf_frame): Now static.
16305 * lisp.h (choose_minibuf_frame): Remove decl.
16306
16307 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16308
16309 * lread.c: Make symbols static if they're not exported.
16310 (read_objects, initial_obarray, oblookup_last_bucket_number):
16311 Now static.
16312 (make_symbol): Remove; unused.
16313 * lisp.h (initial_obarray, make_symbol): Remove decls.
16314
16315 * keyboard.c: Make symbols static if they're not exported.
16316 (single_kboard, recent_keys_index, total_keys, recent_keys):
16317 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16318 (this_single_command_key_start, echoing, last_auto_save):
16319 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16320 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16321 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16322 (Vlispy_mouse_stem, double_click_count):
16323 Now static.
16324 (force_auto_save_soon): Define only if SIGDANGER.
16325 (ignore_mouse_drag_p): Now static if
16326 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16327 (print_help): Remove; unused.
16328 (stop_character, last_timer_event): Mark as externally visible.
16329 * keyboard.h (ignore_mouse_drag_p): Declare only if
16330 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16331 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16332 * lisp.h (echoing): Remove decl.
16333 (force_auto_save_soon): Declare only if SIGDANGER.
16334 * xdisp.c (redisplay_window): Simplify code, to make it more
16335 obvious that ignore_mouse_drag_p is not accessed if !defined
16336 USE_GTK && !defined HAVE_NS.
16337
16338 * intervals.c: Make symbols static if they're not exported.
16339 (merge_properties_sticky, merge_interval_right, delete_interval):
16340 Now static.
16341 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16342
16343 * insdel.c: Make symbols static if they're not exported.
16344 However, leave prepare_to_modify_buffer alone. It's never
16345 called from outside this function, but that appears to be a bug.
16346 (combine_after_change_list, combine_after_change_buffer):
16347 (adjust_after_replace, signal_before_change): Now static.
16348 (adjust_after_replace_noundo): Remove; unused.
16349 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16350 (signal_before_change): Remove decls.
16351
16352 * indent.c (val_compute_motion, val_vmotion): Now static.
16353
16354 * image.c: Make symbols static if they're not exported.
16355 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16356 if USE_GTK.
16357 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16358 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16359
16360 * fringe.c (standard_bitmaps): Now static.
16361 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16362
16363 * frame.c: Make symbols static if they're not exported.
16364 (x_report_frame_params, make_terminal_frame): Now static.
16365 (get_frame_param): Now static, unless HAVE_NS.
16366 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16367 (x_get_resource_string): Remove; not used.
16368 * frame.h (make_terminal_frame, x_report_frame_params):
16369 (x_get_resource_string); Remove decls.
16370 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16371 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16372
16373 * font.c, fontset.c: Make symbols static if they're not exported.
16374 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16375 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16376 * font.c (font_close_object): Now static.
16377 * font.h (font_close_object): Remove.
16378 * fontset.c (FONTSET_OBJLIST): Remove.
16379 (free_realized_fontset) #if-0 the body, which does nothing.
16380 (face_suitable_for_char_p): #if-0, as it's never called.
16381 * fontset.h (face_suitable_for_char_p): Remove decl.
16382 * xfaces.c (face_at_string_position):
16383 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16384 since 0 is always ASCII.
16385
16386 * fns.c (weak_hash_tables): Now static.
16387
16388 * fileio.c: Make symbols static if they're not exported.
16389 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16390 (Vwrite_region_annotation_buffers): Now static.
16391
16392 * eval.c: Make symbols static if they're not exported.
16393 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16394 * lisp.h (backtrace_list): Remove decl.
16395
16396 * emacs.c: Make symbols static if they're not exported.
16397 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16398 (fatal_error_code, fatal_error_signal_hook, standard_args):
16399 Now static.
16400 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16401 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16402 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16403 * lisp.h (fatal_error_signal_hook): Remove decl.
16404 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16405
16406 * editfns.c: Move a (normally-unused) function to its only use.
16407 * editfns.c, lisp.h (get_operating_system_release): Remove.
16408 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16409 worth the hassle of breaking this out.
16410
16411 * xterm.c: Make symbols static if they're not exported.
16412 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16413 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16414 (x_destroy_window, x_delete_display):
16415 Now static.
16416 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16417 (x_mouse_leave): Remove; unused.
16418 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16419 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16420 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16421 Remove decls.
16422 (x_mouse_leave): Declare only if WINDOWSNT.
16423 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16424 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16425 USE_X_TOOLKIT.
16426
16427 * ftxfont.c: Make symbols static if they're not exported.
16428 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16429 HAVE_FREETYPE.
16430 * font.h (ftxfont_driver): Likewise.
16431
16432 * xfns.c: Make symbols static if they're not exported.
16433 (x_last_font_name, x_display_info_for_name):
16434 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16435 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16436 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16437 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16438 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16439 (last_show_tip_args): Now static.
16440 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16441 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16442 (x_screen_planes): Remove; unused.
16443 * dispextern.h (x_screen_planes): Remove decl.
16444
16445 * dispnew.c: Make symbols static if they're not exported.
16446 * dispextern.h (redraw_garbaged_frames, scrolling):
16447 (increment_row_positions): Remove.
16448 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16449 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16450 Now static.
16451 (redraw_garbaged_frames): Remove; unused.
16452
16453 * xfaces.c: Make symbols static if they're not exported.
16454 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16455 Remove decls.
16456 * xterm.h (defined_color): Remove decls.
16457 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16458 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16459 (menu_face_changed_default, defined_color, free_realized_face):
16460 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16461 (ascii_face_of_lisp_face): Remove; unused.
16462
16463 * xdisp.c: Make symbols static if they're not exported.
16464 * dispextern.h (scratch_glyph_row, window_box_edges):
16465 (glyph_to_pixel_coords, set_cursor_from_row):
16466 (get_next_display_element, set_iterator_to_next):
16467 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16468 (show_mouse_face): Remove decls
16469 * frame.h (message_buf_print): Likewise.
16470 * lisp.h (pop_message, set_message, check_point_in_composition):
16471 Likewise.
16472 * xterm.h (set_vertical_scroll_bar): Likewise.
16473 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16474 (message_buf_print, scratch_glyph_row, displayed_buffer):
16475 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16476 (get_next_display_element, show_mouse_face, window_box_edges):
16477 (frame_to_window_pixel_xy, check_point_in_composition):
16478 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16479 (glyph_to_pixel_coords): Remove; unused.
16480
16481 * dired.c (file_name_completion): Now static.
16482
16483 * dbusbind.c (xd_in_read_queued_messages): Now static.
16484
16485 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16486 * data.c (circular_list_error): Remove.
16487
16488 * commands.h (last_point_position, last_point_position_buffer):
16489 (last_point_position_window): Remove decls.
16490 * keyboard.c: Make these variables static.
16491
16492 * coding.h (coding, code_convert_region, encode_coding_gap):
16493 Remove decls.
16494 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16495 (iso_code_class, detect_coding, code_convert_region): Now static.
16496 (encode_coding_gap): Remove; unused.
16497
16498 * chartab.c (chartab_chars, chartab_bits): Now static.
16499
16500 * charset.h (charset_iso_8859_1): Remove decl.
16501 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16502 Now static.
16503
16504 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16505 * ccl.c (Vccl_program_table): Now static.
16506 (check_ccl_update): Remove; unused.
16507
16508 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16509 * category.h: ... from here.
16510 * category.c (check_category_table, set_category_set): Now static.
16511
16512 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16513 * lisp.h: Remove these decls.
16514
16515 * buffer.c (buffer_count): Remove unused var.
16516
16517 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16518 so that it's not optimized away.
16519 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16520 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16521 exported only to the debugger.
16522
16523 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16524 * atimer.h (run_all_atimers): Remove; not exported.
16525
16526 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16527 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16528 was inaccessible from Lisp.
16529 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16530 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16531
16532 alloc.c: Import and export fewer symbols, and remove unused items.
16533 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16534 is defined.
16535 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16536 it's not optimized away by whole-program optimization.
16537 (message_enable_multibyte, free_misc): Remove.
16538 (catchlist, handlerlist, mark_backtrace):
16539 Declare only if BYTE_MARK_STACK.
16540 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16541 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16542 (message_enable_multibyte): Remove decl.
16543 (free_misc, interval_free_list, float_block, float_block_index):
16544 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16545 (cons_free_list, last_marked_index):
16546 Now static.
16547 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16548 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16549 (mark_backtrace): Define only if BYTE_MARK_STACK.
16550 * xdisp.c (message_enable_multibyte): Now static.
16551
16552 Declare Lisp_Object Q* variables to be 'static' if not exported.
16553 This makes it easier for human readers (and static analyzers)
16554 to see whether these variables are used from other modules.
16555 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16556 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16557 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16558 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16559 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16560 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16561 * xmenu.c, xselect.c:
16562 Declare Q* vars static if they are not used in other modules.
16563 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16564 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16565 Remove decls of unexported vars.
16566 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16567
16568 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16569
16570 Make Emacs functions such as Fatom 'static' by default.
16571 This makes it easier for human readers (and static analyzers)
16572 to see whether these functions can be called from other modules.
16573 DEFUN now defines a static function. To make the function external
16574 so that it can be used in other C modules, use the new macro DEFUE.
16575 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16576 (Finit_image_library):
16577 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16578 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16579 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16580 Remove decls, since these functions are now static.
16581 (Funintern, Fget_internal_run_time): New decls, since these functions
16582 were already external.
16583
16584 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16585 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16586 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16587 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16588 * keyboard.c, keymap.c, lread.c:
16589 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16590 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16591 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16592 Mark functions with DEFUE instead of DEFUN,
16593 if they are used in other modules.
16594 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16595 decls for now-static functions.
16596 * buffer.h (Fdelete_overlay): Remove decl.
16597 * callproc.c (Fgetenv_internal): Mark as internal.
16598 * composite.c (Fremove_list_of_text_properties): Remove decl.
16599 (Fcomposition_get_gstring): New forward static decl.
16600 * composite.h (Fcomposite_get_gstring): Remove decl.
16601 * dired.c (Ffile_attributes): New forward static decl.
16602 * doc.c (Fdocumntation_property): New forward static decl.
16603 * eval.c (Ffetch_bytecode): New forward static decl.
16604 (Funintern): Remove extern decl; now in .h file where it belongs.
16605 * fileio.c (Fmake_symbolic_link): New forward static decl.
16606 * image.c (Finit_image_library): New forward static decl.
16607 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16608 * intervals.h (Fprevious_property_change):
16609 (Fremove_list_of_text_properties): Remove decls.
16610 * keyboard.c (Fthis_command_keys): Remove decl.
16611 (Fcommand_execute): New forward static decl.
16612 * keymap.c (Flookup_key): New forward static decl.
16613 (Fcopy_keymap): Now static.
16614 * keymap.h (Flookup_key): Remove decl.
16615 * process.c (Fget_process): New forward static decl.
16616 (Fprocess_datagram_address): Mark as internal.
16617 * syntax.c (Fsyntax_table_p): New forward static decl.
16618 (skip_chars): Remove duplicate decl.
16619 * textprop.c (Fprevious_property_change): New forward static decl.
16620 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16621 Now internal.
16622 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16623 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16624
16625 * editfns.c (Fformat): Remove unreachable code.
16626
16627 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16628
16629 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16630 change. (Bug#8496)
16631
16632 2011-04-13 Eli Zaretskii <eliz@gnu.org>
16633
16634 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16635 when at ZV. (Bug#8487)
16636
16637 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16638
16639 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16640 (Bug#8437)
16641 * keyboard.c (parse_tool_bar_item): Likewise.
16642 * sound.c (sound_cleanup, alsa_close): Likewise.
16643 * termcap.c (tgetent): Likewise.
16644 * xfns.c (x_default_font_parameter): Likewise.
16645 * xsettings.c (read_and_apply_settings): Likewise.
16646
16647 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16648 (overrun_check_free): Protoize.
16649
16650 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16651
16652 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16653 since callers should never pass a negative size.
16654 Change the signature to match that of plain 'read' and 'write'; see
16655 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16656 * lisp.h: Update prototypes of emacs_write and emacs_read.
16657
16658 2011-04-11 Eli Zaretskii <eliz@gnu.org>
16659
16660 * xdisp.c (redisplay_window): Don't try to determine the character
16661 position of the scroll margin if the window start point w->startp
16662 is outside the buffer's accessible region. (Bug#8468)
16663
16664 2011-04-10 Eli Zaretskii <eliz@gnu.org>
16665
16666 Fix write-region and its subroutines for buffers > 2GB.
16667 * fileio.c (a_write, e_write): Modify declaration of arguments and
16668 local variables to support buffers larger than 2GB.
16669 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16670
16671 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16672 argument, local variables, and return value.
16673
16674 * lisp.h: Update prototypes of emacs_write and emacs_read.
16675
16676 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16677
16678 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16679
16680 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16681
16682 Fix more problems found by GCC 4.6.0's static checks.
16683
16684 * xdisp.c (vmessage): Use a better test for character truncation.
16685
16686 * charset.c (load_charset_map): <, not <=, for optimization,
16687 and to avoid potential problems with integer overflow.
16688 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16689 * casetab.c (set_identity, shuffle): Likewise.
16690 * editfns.c (Fformat): Likewise.
16691 * syntax.c (skip_chars): Likewise.
16692
16693 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16694 This also lets GCC 4.6.0 generate slightly better loop code.
16695
16696 * callint.c (Fcall_interactively): <, not <=, for optimization.
16697 (Fcall_interactively): Count the number of arguments produced,
16698 not the number of arguments given. This is simpler and lets GCC
16699 4.6.0 generate slightly better code.
16700
16701 * ftfont.c: Distingish more carefully between FcChar8 and char.
16702 The previous code passed unsigned char * to a functions like
16703 strlen and xstrcasecmp that expect char *, which does not
16704 conform to the C standard.
16705 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16706 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16707 char * when the C standard requires it.
16708
16709 * keyboard.c (read_char): Remove unused var.
16710
16711 * eval.c: Port to Windows vsnprintf (Bug#8435).
16712 Include <limits.h>.
16713 (SIZE_MAX): Define if the headers do not.
16714 (verror): Do not give up if vsnprintf returns a negative count.
16715 Instead, grow the buffer. This ports to Windows vsnprintf, which
16716 does not conform to C99. Problem reported by Eli Zaretskii.
16717 Also, simplify the allocation scheme, by avoiding the need for
16718 calling realloc, and removing the ALLOCATED variable.
16719
16720 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16721
16722 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16723 But keep the doprint source code for now, as we might revamp it
16724 and use it again (Bug#8435).
16725 * lisp.h (doprnt): Remove.
16726 * Makefile.in (base_obj): Remove doprnt.o.
16727 * deps.mk (doprnt.o): Remove.
16728
16729 error: Print 32- and 64-bit integers portably (Bug#8435).
16730 Without this change, on typical 64-bit hosts error ("...%d...", N)
16731 was used to print both 32- and 64-bit integers N, which relied on
16732 undefined behavior.
16733 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16734 * lisp.h (error, verror): Mark as printf-like functions.
16735 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16736 Report overflow in size calculations when allocating printf buffer.
16737 Do not truncate output string at its first null byte.
16738 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16739 Truncate the output at a character boundary, since vsnprintf does not
16740 do that.
16741 * charset.c (check_iso_charset_parameter): Convert internal
16742 character to string before calling 'error', since %c now has the
16743 printf meaning.
16744 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16745 overflow when computing char to be passed to 'error'. Do not
16746 pass Lisp_Object to 'error'; pass the integer instead.
16747 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16748 formatted with plain %d.
16749
16750 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16751
16752 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16753
16754 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16755
16756 * xterm.c (x_catch_errors): Remove duplicate declaration.
16757
16758 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16759
16760 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16761
16762 2011-04-10 Jim Meyering <meyering@redhat.com>
16763
16764 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16765 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16766 return ssize_t not "int", and use size_t as the buffer length.
16767 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16768 * gnutls.h: Update declarations.
16769 * process.c (read_process_output): Use ssize_t, to match.
16770 (send_process): Likewise.
16771
16772 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16773
16774 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16775
16776 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16777
16778 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16779 Use unsigned char, to match FcChar8 type definition.
16780
16781 * xterm.c (handle_one_xevent):
16782 * xmenu.c (create_and_show_popup_menu):
16783 * xselect.c (x_decline_selection_request)
16784 (x_reply_selection_request): Avoid type-punned deref of X events.
16785
16786 2011-04-09 Eli Zaretskii <eliz@gnu.org>
16787
16788 Fix some uses of `int' instead of EMACS_INT.
16789 * search.c (string_match_1, fast_string_match)
16790 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16791 (scan_buffer, find_next_newline_no_quit)
16792 (find_before_next_newline, search_command, Freplace_match)
16793 (Fmatch_data): Make some `int' variables be EMACS_INT.
16794
16795 * xdisp.c (display_count_lines): 3rd argument and return value now
16796 EMACS_INT. All callers changed.
16797 (pint2hrstr): Last argument is now EMACS_INT.
16798
16799 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16800 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16801 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16802 (decode_coding_utf_16, decode_coding_emacs_mule)
16803 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16804 (decode_coding_ccl, decode_coding_charset)
16805 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16806 (decode_coding_iso_2022, decode_coding_emacs_mule)
16807 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16808 <char_offset, last_offset>: Declare EMACS_INT.
16809 (encode_coding_utf_8, encode_coding_utf_16)
16810 (encode_coding_emacs_mule, encode_invocation_designation)
16811 (encode_designation_at_bol, encode_coding_iso_2022)
16812 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16813 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16814 Declare EMACS_INT.
16815 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16816 (encode_invocation_designation): Last argument P_NCHARS is now
16817 EMACS_INT.
16818 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16819 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16820
16821 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16822 All users changed.
16823
16824 * ccl.c (Fccl_execute_on_string): Declare some variables
16825 EMACS_INT.
16826
16827 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16828
16829 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16830
16831 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16832
16833 * process.c (Fformat_network_address): Doc fix.
16834
16835 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16836
16837 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16838
16839 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16840
16841 * keyboard.c (read_char): Call Lisp function help-form-show,
16842 instead of using internal_with_output_to_temp_buffer.
16843 (Qhelp_form_show): New var.
16844 (syms_of_keyboard): Use DEFSYM macro.
16845
16846 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16847
16848 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16849
16850 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16851
16852 * process.c (Flist_processes): Remove to Lisp.
16853 (list_processes_1): Delete.
16854
16855 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16856
16857 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16858
16859 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16860
16861 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16862
16863 Fix more problems found by GCC 4.6.0's static checks.
16864
16865 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16866
16867 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16868
16869 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16870
16871 * xdisp.c (vmessage): Mark as a printf-like function.
16872
16873 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16874
16875 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16876
16877 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16878 printf-like functions.
16879 (tiff_load): Add casts to remove these marks before passing them
16880 to system-supplied API.
16881
16882 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16883
16884 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16885 This avoids several warnings with gcc -Wstrict-overflow.
16886 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16887 directly, rather than having caller test rule sign. This avoids
16888 some unnecessary tests.
16889 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16890 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16891 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16892
16893 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16894 (xfont_open): Avoid unnecessary tests.
16895
16896 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16897
16898 * composite.h, composite.c (composition_gstring_put_cache):
16899 Use EMACS_INT, not int, for length.
16900
16901 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16902 breaking out part of COMPOSITION_DECODE_RULE.
16903 (COMPOSITION_DECODE_RULE): Use it.
16904 * composite.c (get_composition_id): Remove unused local vars,
16905 by using the new macro.
16906
16907 * textprop.c (set_text_properties_1): Change while to do-while,
16908 since the condition is always true at first.
16909
16910 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16911 (interval_deletion_adjustment): Return unsigned value.
16912 All uses changed.
16913
16914 * process.c (list_processes_1, create_pty, read_process_output):
16915 (exec_sentinel): Remove vars that were set but not used.
16916 (create_pty): Remove unnecessary "volatile"s.
16917 (Fnetwork_interface_info): Avoid possibility of int overflow.
16918 (read_process_output): Do adaptive read buffering even if carryover.
16919 (read_process_output): Simplify nbytes computation if buffered.
16920
16921 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16922
16923 * syntax.c (scan_words): Remove var that was set but not used.
16924 (update_syntax_table): Use unsigned instead of int.
16925
16926 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16927 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16928 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16929
16930 * print.c (print_error_message): Avoid int overflow.
16931
16932 * font.c (font_list_entities): Redo for clarity,
16933 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16934
16935 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16936 (font_score): Avoid potential overflow in diff calculation.
16937
16938 * fns.c (substring_both): Remove var that is set but not used.
16939 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16940
16941 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16942
16943 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16944 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16945 can always succeed if overflow has undefined behavior.
16946
16947 * search.c (boyer_moore, wordify): Remove vars set but not used.
16948 (wordify): Omit three unnecessary tests.
16949
16950 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16951 All callers changed. This avoids the need for an unused var.
16952
16953 * casefiddle.c (casify_region): Remove var that is set but not used.
16954
16955 * dired.c (file_name_completion): Remove var that is set but not used.
16956
16957 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16958
16959 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16960 (Finsert_file_contents): Remove unnecessary code checking fd.
16961
16962 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16963 Check for integer overflow on size calculations.
16964
16965 * buffer.c (Fprevious_overlay_change): Remove var that is set
16966 but not used.
16967
16968 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16969 Remove vars that are set but not used.
16970 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16971 (timer_check_2): Mark vars as initialized.
16972
16973 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16974
16975 * image.c (lookup_image): Remove var that is set but not used.
16976 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16977
16978 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16979 that are set but not used.
16980
16981 * xfns.c (make_invisible_cursor): Don't return garbage
16982 if XCreateBitmapFromData fails (Bug#8410).
16983
16984 * xselect.c (x_get_local_selection, x_handle_property_notify):
16985 Remove vars that are set but not used.
16986
16987 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16988 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16989
16990 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16991 Remove var that is set but not used.
16992 (scroll_bar_windows_size): Now size_t, not int.
16993 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16994 Check for overflow.
16995
16996 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16997 (map_tty_color) [!defined MSDOS]: Likewise.
16998
16999 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17000
17001 * coding.c: Remove vars that are set but not used.
17002 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17003 All callers changed.
17004 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17005 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17006 (decode_coding_charset): Remove vars that are set but not used.
17007
17008 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17009 that is set but not used.
17010
17011 * print.c (print_object): Remove var that is set but not used.
17012
17013 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17014 The gnulib version avoids calling malloc in the usual case,
17015 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17016 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17017 * filelock.c (current_lock_owner): Likewise.
17018 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17019 * sysdep.c: Include allocator.h, careadlinkat.h.
17020 (emacs_no_realloc_allocator): New static constant.
17021 (emacs_readlink): New function.
17022 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17023 ../lib/careadlinkat.h.
17024
17025 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17026
17027 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17028 first non-nil return value).
17029
17030 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17031
17032 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17033 if not defined (Bug#8403).
17034
17035 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17036
17037 * xdisp.c (display_count_lines): Remove parameter `start',
17038 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17039 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17040 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17041 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17042 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17043 and thereabouts. All callers changed.
17044 (get_per_char_metric): Remove parameter `f', unused since
17045 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17046
17047 2011-04-02 Jim Meyering <meyering@redhat.com>
17048
17049 do not dereference NULL upon failed strdup
17050 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17051 (ns_get_family): Likewise.
17052
17053 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17054
17055 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17056
17057 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17058
17059 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17060 later (Bug#8403).
17061
17062 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17063
17064 Add lexical binding.
17065
17066 * window.c (Ftemp_output_buffer_show): New fun.
17067 (Fsave_window_excursion):
17068 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17069
17070 * lread.c (lisp_file_lexically_bound_p): New function.
17071 (Fload): Bind Qlexical_binding.
17072 (readevalloop): Remove `evalfun' arg.
17073 Bind Qinternal_interpreter_environment.
17074 (Feval_buffer): Bind Qlexical_binding.
17075 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17076 Mark as dynamic.
17077 (syms_of_lread): Declare `lexical-binding'.
17078
17079 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17080
17081 * keyboard.c (eval_dyn): New fun.
17082 (menu_item_eval_property): Use it.
17083
17084 * image.c (parse_image_spec): Use Ffunctionp.
17085
17086 * fns.c (concat, mapcar1): Accept byte-code-functions.
17087
17088 * eval.c (Fsetq): Handle lexical vars.
17089 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17090 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17091 (FletX, Flet): Obey lexical binding.
17092 (Fcommandp): Handle closures.
17093 (Feval): New `lexical' arg.
17094 (eval_sub): New function extracted from Feval. Use it almost
17095 everywhere where Feval was used. Look up vars in lexical env.
17096 Handle closures.
17097 (Ffunctionp): Move from subr.el.
17098 (Ffuncall): Handle closures.
17099 (apply_lambda): Remove `eval_flags'.
17100 (funcall_lambda): Handle closures and new byte-code-functions.
17101 (Fspecial_variable_p): New function.
17102 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17103 but without exporting it to Lisp.
17104
17105 * doc.c (Fdocumentation, store_function_docstring):
17106 * data.c (Finteractive_form): Handle closures.
17107
17108 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17109 interactive spec.
17110
17111 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17112 New byte-codes.
17113 (exec_byte_code): New function extracted from Fbyte_code to handle new
17114 calling convention for byte-code-functions. Add new byte-codes.
17115
17116 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17117
17118 * alloc.c (Fmake_symbol): Init new `declared_special' field.
17119
17120 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17121
17122 * xdisp.c (redisplay_internal): Fix prototype.
17123
17124 2011-03-31 Eli Zaretskii <eliz@gnu.org>
17125
17126 * xdisp.c (SCROLL_LIMIT): New macro.
17127 (try_scrolling): Use it when setting scroll_limit.
17128 Limit scrolling to 100 screen lines.
17129 (redisplay_window): Even when falling back on "recentering",
17130 position point in the window according to scroll-conservatively,
17131 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17132
17133 (try_scrolling): When point is above the window, allow searching
17134 as far as scroll_max, or one screenful, to compute vertical
17135 distance from PT to the scroll margin position. This prevents
17136 try_scrolling from unnecessarily failing when
17137 scroll-conservatively is set to a value slightly larger than the
17138 window height. Clean up the case of PT below the margin at bottom
17139 of window: scroll_max can no longer be INT_MAX. When aggressive
17140 scrolling is in use, don't let point enter the opposite scroll
17141 margin as result of the scroll.
17142 (syms_of_xdisp) <scroll-conservatively>: Document the
17143 threshold of 100 lines for never-recentering scrolling.
17144
17145 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17146
17147 * dispextern.h (move_it_by_lines):
17148 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17149 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17150 (message_log_check_duplicate): Remove parameters `prev_bol' and
17151 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17152 (redisplay_internal): Remove parameter `preserve_echo_area',
17153 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17154
17155 * indent.c (Fvertical_motion):
17156 * window.c (window_scroll_pixel_based, Frecenter):
17157 Don't pass `need_y_p' to `move_it_by_lines'.
17158
17159 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17160
17161 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17162 steal a few bits to be more compact.
17163 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17164 Remove unneeded casts.
17165
17166 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17167
17168 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17169
17170 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17171 binding" message (bug#7967).
17172
17173 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17174
17175 Fix more problems found by GCC 4.6.0's static checks.
17176
17177 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17178 Remove unused local var.
17179
17180 * editfns.c (Fmessage_box): Remove unused local var.
17181
17182 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17183 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17184 Omit unused local vars.
17185 * window.c (shrink_windows): Omit unused local var.
17186 * menu.c (digest_single_submenu): Omit unused local var.
17187 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17188 Omit unused local var.
17189
17190 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17191 Don't assume string length fits in int.
17192 (keyremap_step, read_key_sequence): Use size_t for sizes.
17193 (read_key_sequence): Don't check last_real_key_start redundantly.
17194
17195 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17196 instead of alloca (Bug#8344).
17197
17198 * eval.c (Fbacktrace): Don't assume nargs fits in int.
17199 (Fbacktrace_frame): Don't assume nframes fits in int.
17200
17201 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17202
17203 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17204 concerns.
17205
17206 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17207
17208 * cm.c (calccost): Turn while-do into do-while, for clarity.
17209
17210 * keyboard.c (syms_of_keyboard): Use the same style as later
17211 in this function when indexing through an array. This also
17212 works around GCC bug 48267.
17213
17214 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17215
17216 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17217
17218 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17219 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17220
17221 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17222 This avoids undefined behavior on integer overflow, and is a bit
17223 more convenient anyway since it is compared to a size_t variable.
17224
17225 Variadic C functions now count arguments with size_t, not int.
17226 This avoids an unnecessary limitation on 64-bit machines, which
17227 caused (substring ...) to crash on large vectors (Bug#8344).
17228 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17229 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
17230 All variadic functions and their callers changed accordingly.
17231 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17232 * data.c (arith_driver, float_arith_driver): Likewise.
17233 * editfns.c (general_insert_function): Likewise.
17234 * eval.c (struct backtrace.nargs, interactive_p)
17235 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17236 (funcall_lambda, mark_backtrace): Likewise.
17237 * fns.c (concat): Likewise.
17238 * frame.c (x_set_frame_parameters): Likewise.
17239 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17240 0 if not found, not -1. All callers changed.
17241
17242 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17243 (stack_copy_size): Now size_t, not int.
17244 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17245
17246 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17247
17248 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17249 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17250 All callers changed.
17251
17252 * lisp.h (multibyte_char_to_unibyte):
17253 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17254 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17255 * character.h (CHAR_TO_BYTE8):
17256 * cmds.c (internal_self_insert):
17257 * editfns.c (general_insert_function):
17258 * keymap.c (push_key_description):
17259 * search.c (Freplace_match):
17260 * xdisp.c (message_dolog, set_message_1): All callers changed.
17261
17262 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17263
17264 * keyboard.c (safe_run_hook_funcall): New function.
17265 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17266 don't set the hook to nil, but remove the offending function instead.
17267 (Qcommand_hook_internal): Remove, unused.
17268 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17269 Vcommand_hook_internal.
17270
17271 * eval.c (enum run_hooks_condition): Remove.
17272 (funcall_nil, funcall_not): New functions.
17273 (run_hook_with_args): Call each function through a `funcall' argument.
17274 Remove `cond' argument, now redundant.
17275 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17276 (Frun_hook_with_args_until_failure): Adjust accordingly.
17277 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17278
17279 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17280
17281 * dispextern.h (string_buffer_position): Remove declaration.
17282
17283 * print.c (strout): Remove parameter `multibyte', unused since
17284 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17285
17286 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17287 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17288 All callers changed.
17289
17290 * w32.c (_wsa_errlist): Use braces for struct initializers.
17291
17292 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17293 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17294 All callers changed.
17295 (string_buffer_position): Likewise. Also, make static (it's never
17296 used outside xdisp.c).
17297 (cursor_row_p): Remove parameter `w', unused since
17298 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17299 (decode_mode_spec): Remove parameter `precision', introduced during
17300 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17301 All callers changed.
17302
17303 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17304
17305 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17306
17307 2011-03-27 Anders Lindgren <andlind@gmail.com>
17308
17309 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17310 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17311 (ns_update_auto_hide_menu_bar): New functions.
17312 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17313 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17314 ns_constrain_all_frames.
17315 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17316 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17317
17318 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17319
17320 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17321
17322 2011-03-27 Glenn Morris <rgm@gnu.org>
17323
17324 * syssignal.h: Replace RETSIGTYPE with void.
17325 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17326 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17327 Replace SIGTYPE with void everywhere.
17328 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17329 * s/template.h (SIGTYPE): Remove commented out definition.
17330
17331 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17332
17333 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17334 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17335
17336 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17337
17338 * w32.c (read_unc_volume): Use parameter `henum', instead of
17339 global variable `wget_enum_handle'.
17340
17341 * keymap.c (describe_vector): Remove parameters `indices' and
17342 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17343 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17344
17345 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17346
17347 * keyboard.c (timer_check): Remove parameter `do_it_now',
17348 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17349 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17350 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17351
17352 * keyboard.c (read_char):
17353 * w32menu.c (w32_menu_display_help):
17354 * xmenu.c (show_help_event, menu_help_callback):
17355 Adjust calls to `show_help_echo'.
17356
17357 * gtkutil.c (xg_maybe_add_timer):
17358 * keyboard.c (readable_events):
17359 * process.c (wait_reading_process_output):
17360 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17361
17362 * insdel.c (adjust_markers_gap_motion):
17363 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17364 (gap_left, gap_right): Don't call it.
17365
17366 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17367
17368 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17369 incurred during fontification.
17370
17371 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17372
17373 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17374 (DEFVAR_PER_BUFFER): Don't pass it.
17375
17376 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17377 (scrolling_window): Don't pass it.
17378
17379 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17380
17381 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17382
17383 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17384 and `suffix'.
17385 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17386 of variables specific to SELinux and computation of `encoded_absname'.
17387
17388 * image.c (XPutPixel): Remove unused variable `height'.
17389
17390 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17391
17392 * unexw32.c (get_section_info): Remove unused variable `section'.
17393
17394 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17395 (system_process_attributes): Remove unused variable `sess'.
17396 (sys_read): Remove unused variable `err'.
17397
17398 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17399 (w32_wnd_proc): Remove unused variable `isdead'.
17400 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17401 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17402 (x_create_tip_frame): Remove unused variable `tem'.
17403
17404 * w32inevt.c (w32_console_read_socket):
17405 Remove unused variable `no_events'.
17406
17407 * w32term.c (x_draw_composite_glyph_string_foreground):
17408 Remove unused variable `width'.
17409
17410 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17411
17412 * w32term.c (x_set_glyph_string_clipping):
17413 Don't pass uninitialized region to CombineRgn.
17414
17415 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17416
17417 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17418 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17419 (Fx_close_connection): Remove unused variable `i'.
17420
17421 * w32font.c (w32font_draw): Return number of glyphs.
17422 (w32font_open_internal): Remove unused variable `i'.
17423 (w32font_driver): Add missing initializer.
17424
17425 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17426 (fill_in_menu): Remove unused variable `items_added'.
17427
17428 * w32term.c (last_mouse_press_frame): Remove static global variable.
17429 (w32_clip_to_row): Remove unused variable `f'.
17430 (x_delete_terminal): Remove unused variable `i'.
17431
17432 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17433 (NOTHING): Remove unused static global variable.
17434 (uniscribe_check_otf): Remove unused variable `table'.
17435 (uniscribe_font_driver): Add missing initializers.
17436
17437 2011-03-23 Julien Danjou <julien@danjou.info>
17438
17439 * term.c (Fsuspend_tty, Fresume_tty):
17440 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17441 * window.c (temp_output_buffer_show):
17442 * insdel.c (signal_before_change):
17443 * frame.c (Fhandle_switch_frame):
17444 * fileio.c (Fdo_auto_save):
17445 * emacs.c (Fkill_emacs):
17446 * editfns.c (save_excursion_restore):
17447 * cmds.c (internal_self_insert):
17448 * callint.c (Fcall_interactively):
17449 * buffer.c (Fkill_all_local_variables):
17450 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17451 Use Frun_hooks.
17452 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17453 unconditionally since it does the check itself.
17454
17455 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17456
17457 Fix more problems found by GCC 4.5.2's static checks.
17458
17459 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17460 the first time through the loop, since we know p0 < p1 then.
17461 This also avoids a gcc -Wstrict-overflow warning.
17462
17463 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17464 leading to a memory leak, possible in functions like
17465 load_charset_map_from_file that can allocate an unbounded number
17466 of objects (Bug#8318).
17467
17468 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17469 that could (at least in theory) be that large.
17470
17471 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17472 This is less likely to overflow, and avoids undefined behavior if
17473 overflow does occur. All callers changed. Use strtoul to scan
17474 for the unsigned long integer.
17475 (pint2hrstr): Simplify and tune code slightly.
17476 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17477
17478 * scroll.c (do_scrolling): Work around GCC bug 48228.
17479 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17480
17481 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17482 This also avoids a warning with gcc -Wstrict-overflow.
17483 (validate_x_resource_name): Simplify count usage.
17484 This also avoids a warning with gcc -Wstrict-overflow.
17485
17486 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17487 fail (Bug#8306).
17488
17489 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17490
17491 * process.c (Fmake_network_process): Use socklen_t, not int,
17492 where POSIX says socklen_t is required in portable programs.
17493 This fixes a porting bug on hosts like 64-bit HP-UX, where
17494 socklen_t is wider than int (Bug#8277).
17495 (Fmake_network_process, server_accept_connection):
17496 (wait_reading_process_output, read_process_output):
17497 Likewise.
17498
17499 * process.c: Rename or move locals to avoid shadowing.
17500 (list_processes_1, Fmake_network_process):
17501 (read_process_output_error_handler, exec_sentinel_error_handler):
17502 Rename or move locals.
17503 (Fmake_network_process): Define label "retry_connect" only if needed.
17504 (Fnetwork_interface_info): Fix pointer signedness.
17505 (process_send_signal): Add cast to avoid pointer signedness problem.
17506 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17507 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17508
17509 Make tparam.h and terminfo.c consistent.
17510 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17511 Include tparam.h instead, since it declares them.
17512 * cm.h (PC): Remove extern decl; tparam.h now does this.
17513 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17514 * terminfo.c: Include tparam.h, to check interfaces.
17515 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17516 (tparam): Adjust signature to match interface in tparam.h;
17517 this removes some undefined behavior. Check that outstring and len
17518 are zero, which they always are with Emacs.
17519 * tparam.h (PC, BC, UP): New extern decls.
17520
17521 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17522 (xftfont_open): Rename locals to avoid shadowing.
17523
17524 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17525 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17526 (OTF_TAG_SYM): Omit macro if not needed.
17527 (ftfont_list): Remove unused local.
17528 (get_adstyle_property, ftfont_pattern_entity):
17529 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17530 Rename locals to avoid shadowing.
17531
17532 * xfont.c (xfont_list_family): Mark var as initialized.
17533
17534 * xml.c (make_dom): Now static.
17535
17536 * composite.c (composition_compute_stop_pos): Rename local to
17537 avoid shadowing.
17538 (composition_reseat_it): Remove unused locals.
17539 (find_automatic_composition, composition_adjust_point): Likewise.
17540 (composition_update_it): Mark var as initialized.
17541 (find_automatic_composition): Mark vars as initialized,
17542 with a FIXME (Bug#8290).
17543
17544 character.h: Rename locals to avoid shadowing.
17545 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17546 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17547 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17548 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17549 to avoid shadowing.
17550
17551 * textprop.c (property_change_between_p): Remove; unused.
17552
17553 * intervals.c (interval_start_pos): Now static.
17554
17555 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17556
17557 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17558 Rename locals to avoid shadowing.
17559
17560 * sound.c (wav_play, au_play, Fplay_sound_internal):
17561 Fix pointer signedness.
17562 (alsa_choose_format): Remove unused local var.
17563 (wav_play): Initialize a variable to 0, to prevent undefined
17564 behavior (Bug#8278).
17565
17566 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17567
17568 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17569
17570 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17571 clobbering (Bug#8298).
17572 * sysdep.c (sys_subshell): Likewise.
17573 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17574
17575 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17576 This should get cleaned up, so that child_setup has the
17577 same signature on all platforms.
17578
17579 * callproc.c (call_process_cleanup): Now static.
17580 (relocate_fd): Rename locals to avoid shadowing.
17581
17582 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
17583
17584 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17585 not to be necessary, and produces flickering.
17586
17587 2011-03-20 Glenn Morris <rgm@gnu.org>
17588
17589 * config.in: Remove file.
17590
17591 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
17592
17593 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17594 are now in src/globals.h.
17595 (syms_of_minibuf): Remove spurious & from previous change.
17596
17597 2011-03-20 Leo Liu <sdl.web@gmail.com>
17598
17599 * minibuf.c (completing-read-function): New variable.
17600 (completing-read-default): Rename from completing-read.
17601 (completing-read): Call completing-read-function.
17602
17603 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17604
17605 * xfaces.c (Fx_load_color_file):
17606 Read color file from absolute filename (bug#8250).
17607
17608 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17609
17610 * makefile.w32-in: Update dependencies.
17611
17612 2011-03-17 Eli Zaretskii <eliz@gnu.org>
17613
17614 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17615
17616 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17617
17618 Fix more problems found by GCC 4.5.2's static checks.
17619
17620 * process.c (make_serial_process_unwind, send_process_trap):
17621 (sigchld_handler): Now static.
17622
17623 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17624 That way, the code declares only the vars that it needs.
17625 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17626 * s/cygwin.h (PTY_ITERATION): Likewise.
17627 * s/darwin.h (PTY_ITERATION): Likewise.
17628 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17629
17630 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17631 * process.c (allocate_pty): Don't declare stb unless it's needed.
17632
17633 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17634 (CONSTANTLIM): Remove; unused.
17635 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17636 Define only if needed.
17637
17638 * unexelf.c (unexec): Name an expression,
17639 to avoid gcc -Wbad-function-cast warning.
17640 Use a different way to cause a compilation error if anyone uses
17641 n rather than nn, a way that does not involve shadowing.
17642 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17643
17644 * deps.mk (unexalpha.o): Remove; unused.
17645
17646 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17647 * unexec.h: New file.
17648 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17649 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17650 Depend on unexec.h.
17651 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17652 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17653 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17654 Change as necessary to match prototype in unexec.h.
17655
17656 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17657 shadowing.
17658 (back_comment, skip_chars): Mark vars as initialized.
17659
17660 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17661 Rename locals to avoid shadowing.
17662
17663 * lread.c (read1): Rewrite so as not to use empty "else".
17664 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17665
17666 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17667
17668 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17669 warning when compiling print.c.
17670
17671 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17672 instead of using an uninitialized var.
17673 (font_sort_entities): Mark var as initialized.
17674
17675 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17676
17677 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17678 pointers to constants.
17679 (font_parse_fcname): Remove unused vars.
17680 (font_delete_unmatched): Now static.
17681 (font_get_spec): Remove; unused.
17682 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17683 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17684 Rename or move locals to avoid shadowing.
17685
17686 * fns.c (require_nesting_list, require_unwind): Now static.
17687 (Ffillarray): Rename locals to avoid shadowing.
17688
17689 * floatfns.c (domain_error2): Define only if needed.
17690 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17691
17692 * alloc.c (mark_backtrace): Move decl from here ...
17693 * lisp.h: ... to here, so that it can be checked.
17694
17695 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17696 (Fdefvar): Rewrite so as not to use empty "else".
17697 (lisp_indirect_variable): Name an expression,
17698 to avoid gcc -Wbad-function-cast warning.
17699 (Fdefvar): Rename locals to avoid shadowing.
17700
17701 * callint.c (quotify_arg, quotify_args): Now static.
17702 (Fcall_interactively): Rename locals to avoid shadowing.
17703 Use const pointer when appropriate.
17704
17705 * lisp.h (get_system_name, get_operating_system_release):
17706 Move decls here, to check interfaces.
17707 * process.c (get_operating_system_release): Move decl to lisp.h.
17708 * xrdb.c (get_system_name): Likewise.
17709 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17710 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17711 some of which prompt warnings from gcc -Wbad-function-cast.
17712 (Fformat_time_string, Fencode_time, Finsert_char):
17713 (Ftranslate_region_internal, Fformat):
17714 Rename or remove local vars to avoid shadowing.
17715 (Ftranslate_region_internal): Mark var as initialized.
17716
17717 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17718 avoid shadowing.
17719
17720 * lisp.h (eassert): Check that the argument compiles, even if
17721 ENABLE_CHECKING is not defined.
17722
17723 * data.c (Findirect_variable): Name an expression, to avoid
17724 gcc -Wbad-function-cast warning.
17725 (default_value, arithcompare, arith_driver, arith_error): Now static.
17726 (store_symval_forwarding): Rename local to avoid shadowing.
17727 (Fmake_variable_buffer_local, Fmake_local_variable):
17728 Mark variables as initialized.
17729 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17730
17731 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17732 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17733 Rename locals to avoid shadowing.
17734 (mark_stack): Move local variables into the #ifdef region where
17735 they're used.
17736 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17737 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17738 needed otherwise.
17739 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17740 (GC_STRING_CHARS): Remove; not used.
17741 (Fmemory_limit): Cast sbrk's returned value to char *.
17742
17743 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17744 avoids undefined behavior in theory.
17745
17746 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17747
17748 Use functions, not macros, for up- and down-casing (Bug#8254).
17749 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17750 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17751 to use the following functions instead of these macros.
17752 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17753 EMACS_INT, since callers assume the returned value fits in int.
17754 (upcase1): Likewise, for UPCASE_TABLE.
17755 (uppercasep, lowercasep, upcase): New static inline functions.
17756 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17757 the race-condition problem in the old DOWNCASE.
17758
17759 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17760 Rename locals to avoid shadowing.
17761 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17762 (regex_compile, re_search_2, re_match_2_internal):
17763 Remove unused local vars.
17764 (FREE_VAR): Rewrite so as not to use empty "else",
17765 which gcc can warn about.
17766 (regex_compile, re_match_2_internal): Mark locals as initialized.
17767 (RETALLOC_IF): Define only if needed.
17768 (WORDCHAR_P): Likewise. This one is never needed, but is used
17769 only in a comment talking about a compiler bug, so put inside
17770 the #if 0 of that comment.
17771 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17772 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17773 Remove; unused.
17774
17775 * search.c (boyer_moore): Rename locals to avoid shadowing.
17776 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17777 (PREV_CHAR_BOUNDARY): Likewise.
17778
17779 * search.c (simple_search): Remove unused var.
17780
17781 * dired.c (compile_pattern): Move decl from here ...
17782 * lisp.h: ... to here, so that it can be checked.
17783 (struct re_registers): New forward decl.
17784
17785 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17786
17787 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17788 All uses changed.
17789 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17790 Rename locals to avoid shadowing.
17791 (Fvertical_motion): Mark locals as initialized.
17792
17793 * casefiddle.c (casify_object, casify_region): Now static.
17794 (casify_region): Mark local as initialized.
17795
17796 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17797
17798 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17799 New macros, so that the caller can use some names other than
17800 gcpro1, gcpro2, etc.
17801 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17802 of the new macros.
17803 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17804 argument, for consistency with GCPRO2_VAR, etc: it is now the
17805 prefix of the variable, not the variable itself. All uses
17806 changed.
17807 * dired.c (directory_files_internal, file_name_completion):
17808 Rename locals to avoid shadowing.
17809
17810 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17811 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17812 dired.c's scmp function, had undefined behavior.
17813 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17814 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17815 * buffer.h: ... to here, because these macros use current_buffer,
17816 and the new implementation with inline functions needs to have
17817 current_buffer in scope now, rather than later when the macros
17818 are used.
17819 (downcase, upcase1): New static inline functions.
17820 (DOWNCASE, UPCASE1): Reimplement using these functions.
17821 This avoids undefined behavior in expressions like
17822 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17823 from race conditions in accessing the global variables
17824 case_temp1 and case_temp2.
17825 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17826 * lisp.h (case_temp1, case_temp2): Remove their decls.
17827 * character.h (ASCII_CHAR_P): Move from here ...
17828 * lisp.h: ... to here, so that the inline functions mentioned
17829 above can use them.
17830
17831 * dired.c (directory_files_internal_unwind): Now static.
17832
17833 * fileio.c (file_name_as_directory, directory_file_name):
17834 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17835 Now static.
17836 (file_name_as_directory): Use const pointers when appropriate.
17837 (Fexpand_file_name): Likewise. In particular, newdir might
17838 point at constant storage, so make it a const pointer.
17839 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17840 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17841 signedness issues.
17842 (Fset_file_times, Finsert_file_contents, auto_save_error):
17843 Rename locals to avoid shadowing.
17844
17845 * minibuf.c (choose_minibuf_frame_1): Now static.
17846 (Ftry_completion, Fall_completions): Rename or remove locals
17847 to avoid shadowing.
17848
17849 * marker.c (bytepos_to_charpos): Remove; unused.
17850
17851 * lisp.h (verify_bytepos, count_markers): New decls,
17852 so that gcc does not warn that these functions aren't declared.
17853
17854 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17855 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17856 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17857 (copy_text): Remove unused local var.
17858
17859 * filelock.c (within_one_second): Now static.
17860 (lock_file_1): Rename local to avoid shadowing.
17861
17862 * buffer.c (fix_overlays_before): Mark locals as initialized.
17863 (fix_start_end_in_overlays): Likewise. This function should be
17864 simplified by using pointers-to-pointers, but that's a different
17865 matter.
17866 (switch_to_buffer_1): Now static.
17867 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17868 (report_overlay_modification): Rename locals to avoid shadowing.
17869
17870 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17871 Fix pointer signedness issue.
17872 (sys_subshell): Mark local as volatile if checking for lint,
17873 to suppress a gcc -Wclobbered warning that does not seem to be right.
17874 (MAXPATHLEN): Define only if needed.
17875
17876 * process.c (serial_open, serial_configure): Move decls from here ...
17877 * systty.h: ... to here, so that they can be checked.
17878
17879 * fns.c (get_random, seed_random): Move extern decls from here ...
17880 * lisp.h: ... to here, so that they can be checked.
17881
17882 * sysdep.c (reset_io): Now static.
17883 (wait_for_termination_signal): Remove; unused.
17884
17885 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17886 (copy_keymap_item, append_key, push_text_char_description):
17887 Now static.
17888 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17889 (DENSE_TABLE_SIZE): Remove; unused.
17890 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17891 (describe_map_tree):
17892 Rename locals to avoid shadowing.
17893
17894 * keyboard.c: Declare functions static if they are not used elsewhere.
17895 (echo_char, echo_dash, cmd_error, top_level_2):
17896 (poll_for_input, handle_async_input): Now static.
17897 (read_char, kbd_buffer_get_event, make_lispy_position):
17898 (make_lispy_event, make_lispy_movement, apply_modifiers):
17899 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17900 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17901 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17902 (read_key_sequence, read_char): Mark locals as initialized.
17903 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17904
17905 * keyboard.h (make_ctrl_char): New decl.
17906 (mark_kboards): Move decl here ...
17907 * alloc.c (mark_kboards): ... from here.
17908
17909 * lisp.h (force_auto_save_soon): New decl.
17910
17911 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17912 (DEFINE_DUMMY_FUNCTION): New macro.
17913 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17914 Use it.
17915 (main): Add casts to avoid warnings
17916 if GCC considers string literals to be constants.
17917
17918 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17919
17920 * dbusbind.c: Pointer signedness fixes.
17921 (xd_signature, xd_append_arg, xd_initialize):
17922 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17923 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17924 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17925 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17926
17927 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17928 if GCC considers string literals to be constants.
17929 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17930
17931 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17932
17933 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17934 (print_preprocess, print_object): New macro to fix last change.
17935
17936 * print.c (print_preprocess): Don't forget font objects.
17937
17938 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17939
17940 * emacs.c (USAGE3): Doc fixes.
17941
17942 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17943
17944 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17945 structure.
17946
17947 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17948
17949 * lisp.h (VWindow_system, Qfile_name_history):
17950 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17951 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17952 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17953
17954 * w32select.c: Don't #include "keyboard.h".
17955 (run_protected): Add extern declaration for waiting_for_input.
17956
17957 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17958 * w32console.c (detect_input_pending, read_input_pending)
17959 (encode_terminal_code):
17960 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17961 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17962 (w32_system_caret_y, Qfile_name_history):
17963 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17964 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17965 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17966 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17967 * w32proc.c (Qlocal, report_file_error):
17968 * w32term.c (Vwindow_system, updating_frame):
17969 * w32uniscribe.c (initialized, uniscribe_font_driver):
17970 Remove unneeded extern declarations.
17971
17972 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17973
17974 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17975
17976 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17977
17978 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17979 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17980 These macros can no longer be used for assignment.
17981
17982 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17983 Assign struct members directly, instead of using BUF_BEGV etc.
17984 (record_buffer_markers, fetch_buffer_markers): New functions for
17985 recording and fetching special buffer markers.
17986 (set_buffer_internal_1, set_buffer_temp): Use them.
17987
17988 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17989
17990 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17991
17992 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17993 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17994
17995 * xdisp.c (hscroll_window_tree):
17996 (reconsider_clip_changes): Use PT instead of BUF_PT.
17997
17998 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17999
18000 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18001 $(EMACS_ROOT)/lib/intprops.h.
18002
18003 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18004
18005 Fix more problems found by GCC 4.5.2's static checks.
18006
18007 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18008 to unsigned char * to avoid compiler diagnostic.
18009 (xg_free_frame_widgets): Make it clear that a local variable is
18010 needed only if USE_GTK_TOOLTIP.
18011 (gdk_window_get_screen): Make it clear that this macro is needed
18012 only if USE_GTK_TOOLTIP.
18013 (int_gtk_range_get_value): New function, which avoids a diagnostic
18014 from gcc -Wbad-function-cast.
18015 (xg_set_toolkit_scroll_bar_thumb): Use it.
18016 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18017 diagnostic from gcc -Wbad-function-cast.
18018 (get_utf8_string, xg_get_file_with_chooser):
18019 Rename locals to avoid shadowing.
18020 (create_dialog): Move locals to avoid shadowing.
18021
18022 * xgselect.c (xg_select): Remove unused var.
18023
18024 * image.c (four_corners_best): Mark locals as initialized.
18025 (gif_load): Initialize transparent_p to zero (Bug#8238).
18026 Mark another local as initialized.
18027 (my_png_error, my_error_exit): Mark with NO_RETURN.
18028
18029 * image.c (clear_image_cache): Now static.
18030 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18031 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18032 (x_edge_detection): Remove unnecessary cast that
18033 gcc -Wbad-function-cast diagnoses.
18034 (gif_load): Fix pointer signedness.
18035 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18036 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18037
18038 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18039
18040 Improve quality of tests for time stamp overflow.
18041 For example, without this patch (encode-time 0 0 0 1 1
18042 1152921504606846976) returns the obviously-bogus value (-948597
18043 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18044 reports time overflow. See
18045 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18046 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18047 * editfns.c: Include limits.h and intprops.h.
18048 (TIME_T_MIN, TIME_T_MAX): New macros.
18049 (time_overflow): Move earlier, to before first use.
18050 (hi_time, lo_time): New functions, for an accurate test for
18051 out-of-range times.
18052 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18053 (Fget_internal_run_time): Don't assume time_t fits in int.
18054 (make_time): Use list2 instead of Fcons twice.
18055 (Fdecode_time): More accurate test for out-of-range times.
18056 (check_tm_member): New function.
18057 (Fencode_time): Use it, to test for out-of-range times.
18058 (lisp_time_argument): Don't rely on undefined left-shift and
18059 right-shift behavior when checking for time stamp overflow.
18060
18061 * editfns.c (time_overflow): New function, refactoring common code.
18062 (Fformat_time_string, Fdecode_time, Fencode_time):
18063 (Fcurrent_time_string): Use it.
18064
18065 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18066 * dired.c (make_time): Move to ...
18067 * editfns.c (make_time): ... here.
18068 * systime.h: Note the move.
18069
18070 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18071
18072 * fringe.c (update_window_fringes): Remove unused variables.
18073
18074 * unexmacosx.c (copy_data_segment): Also copy __got section.
18075 (Bug#8223)
18076
18077 2011-03-12 Eli Zaretskii <eliz@gnu.org>
18078
18079 * termcap.c [MSDOS]: Include "msdos.h".
18080 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18081 Constify `char *' arguments and their references according to
18082 prototypes in tparam.h.
18083
18084 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18085
18086 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18087 Adapt all references accordingly.
18088
18089 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18090
18091 2011-03-11 Tom Tromey <tromey@redhat.com>
18092
18093 * buffer.c (syms_of_buffer): Remove obsolete comment.
18094
18095 2011-03-11 Eli Zaretskii <eliz@gnu.org>
18096
18097 * termhooks.h (encode_terminal_code): Declare prototype.
18098
18099 * msdos.c (encode_terminal_code): Don't declare prototype.
18100
18101 * term.c (encode_terminal_code): Now external again, used by
18102 w32console.c and msdos.c.
18103
18104 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18105 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18106
18107 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
18108
18109 Fix some minor problems found by GCC 4.5.2's static checks.
18110
18111 * fringe.c (update_window_fringes): Mark locals as initialized
18112 (Bug#8227).
18113 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18114
18115 * alloc.c (mark_fringe_data): Move decl from here ...
18116 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18117 to check its interface.
18118 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18119
18120 * fontset.c (free_realized_fontset): Now static.
18121 (Fset_fontset_font): Rename local to avoid shadowing.
18122 (fontset_font): Mark local as initialized.
18123 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18124
18125 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18126
18127 * xselect.c (x_disown_buffer_selections): Remove; not used.
18128 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18129 (x_own_selection, Fx_disown_selection_internal): Rename locals
18130 to avoid shadowing.
18131 (x_handle_dnd_message): Remove local to avoid shadowing.
18132
18133 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18134 so that the caller can use some name other than gcpro1.
18135 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18136 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18137 (Fx_backspace_delete_keys_p):
18138 Use them to avoid shadowing, and rename vars to avoid shadowing.
18139 (x_decode_color, x_set_name, x_window): Now static.
18140 (Fx_create_frame): Add braces to silence GCC warning.
18141 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18142 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18143 Remove unused locals.
18144 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18145 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18146 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18147 macros.
18148
18149 * xterm.h (x_mouse_leave): New decl.
18150
18151 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18152 Remove unused functions.
18153 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18154 (x_calc_absolute_position): Now static.
18155 (XTread_socket): Don't define label "out" unless it's used.
18156 Don't declare local "event" unless it's used.
18157 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18158 unless they are used.
18159 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18160 (x_fatal_error_signal): Remove; not used.
18161 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18162 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18163 (x_error_catcher, x_connection_closed, x_error_handler):
18164 (x_error_quitter, xembed_send_message, x_iconify_frame):
18165 (my_log_handler): Rename locals to avoid shadowing.
18166 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18167 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18168
18169 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18170 Rename or move locals to avoid shadowing.
18171 (tty_defined_color, merge_face_heights): Now static.
18172 (free_realized_faces_for_fontset): Remove; not used.
18173 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18174 does not deduce is never used uninitialized.
18175 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18176 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18177
18178 * terminal.c (store_terminal_param): Now static.
18179
18180 * xmenu.c (menu_highlight_callback): Now static.
18181 (set_frame_menubar): Remove unused local.
18182 (xmenu_show): Rename parameter to avoid shadowing.
18183 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18184 since they might point to immutable storage.
18185 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18186 since it's unused otherwise.
18187
18188 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18189 Add a FIXME, since the code still doesn't look right. (Bug#8215)
18190 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18191 avoids a gcc -Wuninitialized diagnostic.
18192 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18193 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18194 does not deduce are never used uninitialized.
18195
18196 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18197
18198 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18199 * window.c (window_loop, size_window):
18200 (run_window_configuration_change_hook, enlarge_window): Likewise.
18201
18202 * window.c (display_buffer): Now static.
18203 (size_window): Mark variables that gcc -Wuninitialized
18204 does not deduce are never used uninitialized.
18205 * window.h (check_all_windows): New decl, to forestall
18206 gcc -Wmissing-prototypes diagnostic.
18207 * dispextern.h (bidi_dump_cached_states): Likewise.
18208
18209 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18210 shadowing.
18211 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18212 Include <limits.h>.
18213 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18214 and to avoid gcc -Wuninitialized warning.
18215 (load_charset_map): Mark variables that gcc -Wuninitialized
18216 does not deduce are never used uninitialized.
18217 (load_charset): Abort instead of using uninitialized var (Bug#8229).
18218
18219 * coding.c (coding_set_source, coding_set_destination):
18220 Use "else { /* comment */ }" rather than "else /* comment */;"
18221 for clarity, and to avoid gcc -Wempty-body warning.
18222 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18223 a block, when the outer 'i' will do.
18224 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18225 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18226 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18227 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18228 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18229 Rename locals to avoid shadowing.
18230 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
18231 * coding.c (emacs_mule_char, encode_invocation_designation):
18232 Now static, since they're not used elsewhere.
18233 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
18234 (decode_coding_object, encode_coding_object, detect_coding_system):
18235 (decode_coding_emacs_mule): Mark variables that gcc
18236 -Wuninitialized does not deduce are never used uninitialized.
18237 (detect_coding_iso_2022): Initialize a local variable that might
18238 be used uninitialized. Leave a FIXME because it's not clear that
18239 this initialization is needed. (Bug#8211)
18240 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18241 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18242 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18243 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18244 Remove unused macros.
18245
18246 * category.c (hash_get_category_set): Remove unused local var.
18247 (copy_category_table): Now static, since it's not used elsewhere.
18248 * character.c (string_count_byte8): Likewise.
18249
18250 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18251 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18252
18253 * chartab.c (copy_sub_char_table): Now static, since it's not used
18254 elsewhere.
18255 (sub_char_table_ref_and_range, char_table_ref_and_range):
18256 Rename locals to avoid shadowing.
18257 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
18258
18259 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18260 (BIDI_BOB): Remove unused macro.
18261
18262 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18263 deduce are never used uninitialized.
18264 * term.c (encode_terminal_code): Likewise.
18265
18266 * term.c (encode_terminal_code): Now static. Remove unused local.
18267
18268 * tparam.h: New file.
18269 * term.c, tparam.h: Include it.
18270 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18271 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18272 Move these decls to tparam.h, and make them agree with what
18273 is actually in tparam.c. The previous trick of using incompatible
18274 decls in different modules does not conform to the C standard.
18275 All callers of tparam changed to use tparam's actual API.
18276 * tparam.c (tparam1, tparam, tgoto):
18277 Use const pointers where appropriate.
18278
18279 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18280 * cm.h (struct cm): Likewise.
18281 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18282 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18283 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18284 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18285 (turn_on_face, init_tty): Likewise.
18286 * termchar.h (struct tty_display_info): Likewise.
18287
18288 * term.c (term_mouse_position): Rename local to avoid shadowing.
18289
18290 * alloc.c (mark_ttys): Move decl from here ...
18291 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18292
18293 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18294
18295 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18296
18297 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
18298
18299 * search.c (compile_pattern_1): Remove argument regp, unused since
18300 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18301 (compile_pattern): Don't pass it.
18302
18303 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18304
18305 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18306 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18307 for ! HAVE_GTK3.
18308 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18309
18310 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18311
18312 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18313 gdk_window_get_screen, gdk_window_get_geometry,
18314 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18315 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18316 (xg_get_pixbuf_from_pixmap): New function.
18317 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18318 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18319 Call xg_get_pixbuf_from_pixmap instead of
18320 gdk_pixbuf_get_from_drawable.
18321 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18322 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18323 (xg_check_special_colors): Use GtkStyleContext and its functions
18324 for HAVE_GTK3.
18325 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18326 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18327 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18328 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18329 Call gtk_widget_get_preferred_size.
18330 (xg_frame_resized): gdk_window_get_geometry only takes 5
18331 parameters.
18332 (xg_win_to_widget, xg_event_is_for_menubar):
18333 Call gdk_x11_window_lookup_for_display.
18334 (xg_set_widget_bg): New function.
18335 (delete_cb): New function.
18336 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18337 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18338 (xg_set_background_color): Call xg_set_widget_bg.
18339 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18340 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18341 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18342 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18343 if ! HAVE_GTK3.
18344 (update_frame_tool_bar): Call gtk_widget_hide.
18345 (xg_initialize): Use GDK_KEY_g.
18346
18347 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18348 if ! HAVE_GTK3
18349 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18350
18351 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18352 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18353 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18354
18355 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18356
18357 * w32xfns.c (select_palette): Check success of RealizePalette against
18358 GDI_ERROR, not zero.
18359
18360 See ChangeLog.11 for earlier changes.
18361
18362 ;; Local Variables:
18363 ;; coding: utf-8
18364 ;; End:
18365
18366 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18367
18368 This file is part of GNU Emacs.
18369
18370 GNU Emacs is free software: you can redistribute it and/or modify
18371 it under the terms of the GNU General Public License as published by
18372 the Free Software Foundation, either version 3 of the License, or
18373 (at your option) any later version.
18374
18375 GNU Emacs is distributed in the hope that it will be useful,
18376 but WITHOUT ANY WARRANTY; without even the implied warranty of
18377 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18378 GNU General Public License for more details.
18379
18380 You should have received a copy of the GNU General Public License
18381 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.