* xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
[bpt/emacs.git] / src / ChangeLog
... / ...
CommitLineData
12012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2
3 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
4 Suggested by Juri Linkov in
5 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
6
7 Prefer plain 'static' to 'static inline' (Bug#12541).
8 With static functions, modern compilers inline pretty well by
9 themselves; advice from programmers often hurts as much as it helps.
10 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
11 this change shrinks the text size of the Emacs executable by 1.1%
12 without affecting CPU significantly in my benchmark.
13 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
14 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
15 (mark_maybe_object, mark_maybe_pointer, bounded_number):
16 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
17 (bset_auto_fill_function, bset_auto_save_file_format)
18 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
19 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
20 (bset_cache_long_line_scans, bset_case_fold_search)
21 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
22 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
23 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
24 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
25 (bset_header_line_format, bset_indicate_buffer_boundaries)
26 (bset_indicate_empty_lines, bset_invisibility_spec)
27 (bset_left_fringe_width, bset_major_mode, bset_mark)
28 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
29 (bset_name, bset_overwrite_mode, bset_pt_marker)
30 (bset_right_fringe_width, bset_save_length)
31 (bset_scroll_bar_width, bset_scroll_down_aggressively)
32 (bset_scroll_up_aggressively, bset_selective_display)
33 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
34 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
35 (set_buffer_overlays_after):
36 * category.c (bset_category_table):
37 * charset.c (read_hex):
38 * coding.c (produce_composition, produce_charset)
39 (handle_composition_annotation, handle_charset_annotation)
40 (char_encodable_p):
41 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
42 (assign_row, set_frame_matrix_frame, make_current)
43 (add_row_entry):
44 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
45 * fns.c (maybe_resize_hash_table):
46 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
47 * gmalloc.c (register_heapinfo):
48 * image.c (lookup_image_type):
49 * intervals.c (set_interval_object, set_interval_left)
50 (set_interval_right, copy_interval_parent, rotate_right)
51 (rotate_left, balance_possible_root_interval):
52 * keyboard.c (kset_echo_string, kset_kbd_queue)
53 (kset_keyboard_translate_table, kset_last_prefix_arg)
54 (kset_last_repeatable_command, kset_local_function_key_map)
55 (kset_overriding_terminal_local_map, kset_real_last_command)
56 (kset_system_key_syms, clear_event, set_prop):
57 * lread.c (digit_to_number):
58 * marker.c (attach_marker, live_buffer, set_marker_internal):
59 * nsterm.m (ns_compute_glyph_string_overhangs):
60 * process.c (pset_buffer, pset_command)
61 (pset_decode_coding_system, pset_decoding_buf)
62 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
63 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
64 (pset_status, pset_tty_name, pset_type, pset_write_queue):
65 * syntax.c (bset_syntax_table, dec_bytepos):
66 * terminal.c (tset_param_alist):
67 * textprop.c (interval_has_some_properties)
68 (interval_has_some_properties_list):
69 * window.c (wset_combination_limit, wset_dedicated)
70 (wset_display_table, wset_hchild, wset_left_fringe_width)
71 (wset_left_margin_cols, wset_new_normal, wset_new_total)
72 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
73 (wset_right_fringe_width, wset_right_margin_cols)
74 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
75 (wset_vertical_scroll_bar_type, wset_window_parameters):
76 * xdisp.c (wset_base_line_number, wset_base_line_pos)
77 (wset_column_number_displayed, wset_region_showing)
78 (window_box_edges, run_window_scroll_functions)
79 (append_glyph_string_lists, prepend_glyph_string_lists)
80 (append_glyph_string, set_glyph_string_background_width)
81 (append_glyph, append_composite_glyph)
82 (take_vertical_position_into_account):
83 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
84 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
85 (lface_hash, lface_same_font_attributes_p, lookup_face):
86 * xml.c (libxml2_loaded_p):
87 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
88 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
89 Now 'static', not 'static inline'.
90
91 * bidi.c: Tune.
92 (bidi_copy_it): Do the whole copy with a single memcpy.
93 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
94
95 Revert the FOLLOW-SYMLINKS change for file-attributes.
96 Doing it right would require several changes to Tramp, and there's
97 not enough time to get that tested before the freeze today.
98 * dired.c (directory_files_internal, Ffile_attributes):
99 Undo last change.
100
101 * frame.c (x_report_frame_params): Port better to wider ints.
102 Do not assume that EMACS_UINT is the same width as uprintmax_t,
103 or that pointers can be printed in 15 decimal digits.
104 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
105
1062012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
107
108 Support x64 build on MS-Windows.
109 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
110 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
111 compatibility with x64.
112 (x_get_focus_frame): Add prototype.
113
114 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
115 defining an XRectangle structure.
116
117 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
118 arithmetics for compatibility with x64.
119
120 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
121 compatibility with x64.
122
123 * w32heap.h: Adjust prototypes and declarations.
124
125 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
126 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
127 DWORD, long, and unsigned long, for compatibility with x64.
128 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
129 (sbrk): Argument is now of type ptrdiff_t.
130
131 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
132 less than 0x0500.
133 (w32_msg_pump): Use WPARAM type for 'result'.
134
135 * w32.c (init_environment, get_emacs_configuration): Support AMD64
136 architecture.
137 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
138 compatibility with x64.
139
140 * vm-limit.c (lim_data): Now size_t.
141 (check_memory_limits): Adjust prototypes of real_morecore and
142 __morecore to receive argument of type ptrdiff_t. Use size_t for
143 five_percent and data_size.
144
145 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
146 variables, for compatibility with x64.
147 (rva_to_section, offset_to_section, relocate_offset)
148 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
149 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
150 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
151 for compatibility with x64.
152
153 * sysdep.c (STDERR_FILENO): Define if not already defined.
154
155 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
156 (__morecore): Argument type is now ptrdiff_t.
157 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
158 (relinquish): Use ptrdiff_t type for 'excess'.
159 (r_alloc_sbrk): Argument type is now ptrdiff_t.
160
161 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
162 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
163 instead of a literal number.
164
165 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
166 (min): Define only if not already defined.
167
168 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
169 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
170 hosts.
171
172 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
173 'bitmaps' is a pointer.
174
175 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
176
177 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
178
1792012-09-30 Paul Eggert <eggert@cs.ucla.edu>
180
181 file-attributes has a new optional arg FOLLOW-SYMLINKS.
182 * dired.c (directory_files_internal, Ffile_attributes):
183 New arg follow_symlinks. All uses changed.
184
1852012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
186
187 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
188
1892012-09-30 Eli Zaretskii <eliz@gnu.org>
190
191 Support atimers and CPU profiler via profile.c on MS-Windows.
192 * w32proc.c (sig_mask, crit_sig): New static variables.
193 (sys_signal): Support SIGALRM and SIGPROF.
194 (sigemptyset, sigaddset, sigfillset, sigprocmask)
195 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
196 sigfillset, and sigprocmask are no longer no-ops.
197 (sigismember): New function.
198 (struct itimer_data): New definition.
199 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
200 (crit_prof): New static variables.
201 (MAX_SINGLE_SLEEP): New definition.
202 (timer_loop, stop_timer_thread, term_timers, init_timers)
203 (start_timer_thread, getitimer, setitimer): New functions.
204 (alarm): No longer a no-op, calls setitimer.
205
206 * w32.c (term_ntproc): Call term_timers.
207 (init_ntproc): Make sure all signals are unblocked at startup, to
208 erase any traces of dumping. Call init_timers.
209
210 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
211 Windows-specific code to display the hourglass mouse pointer is no
212 longer used.
213 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
214 to hourglass timer expiration.
215 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
216 Remove, no longer used.
217 (w32_note_current_window, show_hourglass, hide_hourglass):
218 New functions, in support of hourglass cursor display similar to other
219 window systems.
220 (syms_of_w32fns): Don't initialize hourglass_timer.
221
222 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
223 WINDOWSNT as well.
224 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
225
226 * w32.h (init_timers, term_timers): Add prototypes.
227
2282012-09-30 Kenichi Handa <handa@gnu.org>
229
230 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
231 to the buffer relocation which may be caused by ccl_driver.
232
2332012-09-30 Jan Djärv <jan.h.d@swipnet.se>
234
235 * xfns.c (Fx_file_dialog): Update comment.
236
237 * w32fns.c (Fx_file_dialog): Update comment.
238
239 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
240 Initialize panel name field if OSX >= 10.6.
241
242 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
243
244 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
245
246 * nsterm.m (NEW_STYLE_FS): New define.
247 (ns_fullscreen_hook, windowWillEnterFullScreen)
248 (windowDidEnterFullScreen, windowWillExitFullScreen)
249 (windowDidExitFullScreen, toggleFullScreen, handleFS)
250 (setFSValue): New functions.
251 (EmacsFSWindow): New implementation.
252 (canBecomeKeyWindow): New function for EmacsFSWindow.
253 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
254 (dealloc): Release nonfs_window if in fullscreen.
255 (updateFrameSize:): Call windowDidMove to update top/left.
256 (windowWillResize:toSize:): Check if frame is still maximized.
257 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
258 next_maximized, maximized_width, maximized_height and nonfs_window.
259 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
260 tbar_height.
261 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
262 fullscreen. Set maximized_width/height. Act on next_maximized.
263
264 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
265 (EmacsView): Add variables for fullscreen.
266 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
267 (EmacsFSWindow): New interface for fullscreen.
268
2692012-09-30 Juanma Barranquero <lekktu@gmail.com>
270
271 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
272
2732012-09-30 Chong Yidong <cyd@gnu.org>
274
275 * fns.c (Frandom): Doc fix.
276
2772012-09-30 Martin Rudalics <rudalics@gmx.at>
278
279 * window.c (Vwindow_combination_limit): New default value.
280 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
281
2822012-09-30 Paul Eggert <eggert@cs.ucla.edu>
283
284 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
285 Suggested by Eli Zaretskii in
286 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
287
2882012-09-30 Eli Zaretskii <eliz@gnu.org>
289
290 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
291 HAVE_TIMER_SETTIME is defined.
292
2932012-09-30 Paul Eggert <eggert@cs.ucla.edu>
294
295 Profiler improvements: more-accurate timers, overflow checks.
296 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
297 signal.h, setjmp.h. Include systime.h instead.
298 (saturated_add): New function.
299 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
300 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
301 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
302 New static vars.
303 (enum profiler_cpu_running): New enum.
304 (profiler_cpu_running): Now of that enum type, not bool.
305 All uses changed to store the new value.
306 (handle_profiler_signal): Rename from sigprof_handler_1,
307 for consistency with other handlers. Do not check whether
308 cpu_log is a hash-table if garbage collecting, since it
309 doesn't matter in that case.
310 (deliver_profiler_signal): Rename from sigprof_handler,
311 for consistency with other handlers.
312 (setup_cpu_timer): New function, with much of what used to be in
313 Fprofiler_cpu_start. Check for out-of-range argument.
314 Prefer timer_settime if available, and prefer
315 thread cputime clocks, then process cputime clocks, then
316 monotonic clocks, to the old realtime clock. Use make_timeval
317 to round more-correctly when falling back to setitimer.
318 (Fprofiler_cpu_start): Use it.
319 (Fprofiler_cpu_stop): Prefer timer_settime if available.
320 Don't assume that passing NULL as the 2nd argument of setitimer
321 is the same as passing a pointer to all-zero storage.
322 Ignore SIGPROF afterwards.
323 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
324 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
325 non-fatal signal handlers. Ignore SIGPROF on startup.
326 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
327 in profiler.c, since sysdep.c now uses it.
328
329 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
330 Suggested by Eli Zaretskii in
331 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
332
3332012-09-29 Juanma Barranquero <lekktu@gmail.com>
334
335 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
336
3372012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
338
339 * lisp.h (struct backtrace): Remove indirection for `function' field.
340 * xdisp.c (redisplay_internal):
341 * profiler.c (record_backtrace, sigprof_handler_1):
342 * alloc.c (Fgarbage_collect):
343 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
344 (Fbacktrace_frame): Adjust accordingly.
345
3462012-09-28 Glenn Morris <rgm@gnu.org>
347
348 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
349 (Frun_hook_with_args_until_failure): Doc fixes.
350
3512012-09-28 Eli Zaretskii <eliz@gnu.org>
352
353 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
354 Qautomatic_redisplay and change the symbol name. All users changed.
355
3562012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
357
358 * profiler.c (sigprof_handler): Fix race condition.
359
3602012-09-28 Glenn Morris <rgm@gnu.org>
361
362 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
363
3642012-09-27 Paul Eggert <eggert@cs.ucla.edu>
365
366 Check more robustly for timer_settime.
367 * Makefile.in (LIB_TIMER_TIME): New macro.
368 (LIBES): Add it.
369 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
370 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
371 call timer_settime.
372
3732012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
374
375 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
376
3772012-09-26 Juanma Barranquero <lekktu@gmail.com>
378
379 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
380
3812012-09-26 Paul Eggert <eggert@cs.ucla.edu>
382
383 * character.h (MAYBE_UNIFY_CHAR): Remove.
384 * charset.c, charset.h (maybe_unify_char): Now static.
385 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
386 Since this stuff is now private to charset.c, there's no need for
387 a public macro and no need to inline by hand.
388
3892012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
390 Stefan Monnier <monnier@iro.umontreal.ca>
391 Juanma Barranquero <lekktu@gmail.com>
392
393 * profiler.c: New file.
394 * Makefile.in (base_obj): Add profiler.o.
395 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
396 ($(BLD)/profiler.$(O)): New target.
397 * emacs.c (main): Call syms_of_profiler.
398 * alloc.c (Qautomatic_gc): New constant.
399 (MALLOC_PROBE): New macro.
400 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
401 (total_bytes_of_live_objects): New function.
402 (Fgarbage_collect): Use it. Record itself in backtrace_list.
403 Call malloc_probe for the memory profiler.
404 (syms_of_alloc): Define Qautomatic_gc.
405 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
406 race condition.
407 (struct backtrace): Move definition...
408 * lisp.h (struct backtrace): ..here.
409 (Qautomatic_gc, profiler_memory_running): Declare vars.
410 (malloc_probe, syms_of_profiler): Declare functions.
411 * xdisp.c (Qautomatic_redisplay): New constant.
412 (redisplay_internal): Record itself in backtrace_list.
413 (syms_of_xdisp): Define Qautomatic_redisplay.
414
4152012-09-25 Eli Zaretskii <eliz@gnu.org>
4162012-09-25 Juanma Barranquero <lekktu@gmail.com>
417
418 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
419
4202012-09-25 Paul Eggert <eggert@cs.ucla.edu>
421
422 Prefer POSIX timers if available.
423 They avoid a race if the timer is too close to the current time.
424 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
425 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
426 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
427
4282012-09-25 Eli Zaretskii <eliz@gnu.org>
429
430 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
431 CHAR_STRING_ADVANCE.
432 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
433 STRING_CHAR_ADVANCE.
434
4352012-09-25 Juanma Barranquero <lekktu@gmail.com>
436
437 Move Vlibrary_cache to emacs.c and reset before dumping.
438
439 * lisp.h (reset_image_types): Declare.
440 [WINDOWSNT] (Vlibrary_cache): Declare.
441
442 * image.c (reset_image_types): New function.
443
444 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
445 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
446 (Fdump_emacs): Reset Vlibrary_cache and image_types.
447
448 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
449 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
450
451 * w32.h (Vlibrary_cache): Do not declare.
452
4532012-09-25 Eli Zaretskii <eliz@gnu.org>
454
455 * w32proc.c (sys_signal): Handle all signals defined by the
456 MS-Windows runtime, not just SIGCHLD. Actually install the signal
457 handlers for signals supported by Windows. Don't override
458 term_ntproc as the handler for SIGABRT.
459 (sigaction): Rewrite to call sys_signal instead of duplicating its
460 code.
461 (sys_kill): Improve commentary.
462
463 * w32.c (term_ntproc): Accept (and ignore) one argument, for
464 consistency with a signature of a signal handler. All callers
465 changed.
466 (init_ntproc): Accept an argument DUMPING. If dumping, don't
467 install term_ntproc as a signal handler for SIGABRT, as that
468 should be done by the dumped Emacs.
469
470 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
471
472 * w32select.c (term_w32select): Protect against repeated
473 invocation by setting clipboard_owner to NULL after calling
474 DestroyWindow.
475
476 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
477 and term_ntproc to their modified signatures.
478
479 * character.c (char_string, string_char): Remove calls to
480 MAYBE_UNIFY_CHAR. See the discussion starting at
481 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
482 for the details.
483
4842012-09-25 Chong Yidong <cyd@gnu.org>
485
486 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
487
4882012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
489
490 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
491 when encountering an unknown bytecode.
492
4932012-09-24 Paul Eggert <eggert@cs.ucla.edu>
494
495 image.c, indent.c: Use bool for booleans.
496 * dispextern.h (struct image_type): Members valid_p, load, init
497 now return bool, not int. All uses changed.
498 * image.c: Omit unnecessary static decls.
499 (x_create_bitmap_mask, x_build_heuristic_mask):
500 Return void, not int, since callers don't care about the return value.
501 (x_create_bitmap_mask, define_image_type, valid_image_p)
502 (struct image_keyword, parse_image_spec, image_spec_value)
503 (check_image_size, image_background)
504 (image_background_transparent, x_clear_image_1)
505 (postprocess_image, lookup_image, x_check_image_size)
506 (x_create_x_image_and_pixmap, xbm_image_p)
507 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
508 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
509 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
510 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
511 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
512 (png_image_p, init_png_functions, png_load_body, png_load)
513 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
514 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
515 (init_gif_functions, gif_load, imagemagick_image_p)
516 (imagemagick_load_image, imagemagick_load, svg_image_p)
517 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
518 (gs_load):
519 * nsimage.m (ns_load_image):
520 * nsterm.m (ns_defined_color):
521 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
522 * xfns.c (x_defined_color):
523 * xterm.c (x_alloc_lighter_color_for_widget)
524 (x_alloc_nearest_color_1, x_alloc_nearest_color)
525 (x_alloc_lighter_color):
526 * indent.c (disptab_matches_widthtab, current_column)
527 (scan_for_column, string_display_width, indented_beyond_p)
528 (compute_motion, vmotion, Fvertical_motion):
529 Use bool for booleans.
530
5312012-09-24 Chong Yidong <cyd@gnu.org>
532
533 * chartab.c (Fset_char_table_default): Obsolete function removed.
534
5352012-09-23 Paul Eggert <eggert@cs.ucla.edu>
536
537 Move pid_t related decls out of lisp.h.
538 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
539 (interruptible_wait_for_termination):
540 Move these decls from lisp.h to syswait.h, since they use pid_t.
541 Needed on FreeBSD; see Herbert J. Skuhra in
542 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
543 * callproc.c: Include syswait.h.
544
545 gnutls.c, gtkutil.c: Use bool for boolean.
546 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
547 (emacs_gnutls_handle_error):
548 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
549 (xg_hide_tooltip, xg_create_frame_widgets)
550 (create_dialog, xg_uses_old_file_dialog)
551 (xg_get_file_with_chooser, xg_get_file_with_selection)
552 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
553 (xg_item_label_same_p, xg_update_menubar)
554 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
555 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
556 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
557 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
558 (update_frame_tool_bar, free_frame_tool_bar):
559 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
560 * nsmenu.m (ns_update_menubar):
561 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
562 * xfns.c (Fx_show_tip) [USE_GTK]:
563 Use bool for boolean.
564 * gtkutil.c (xg_update_frame_menubar):
565 * xmenu.c (update_frame_menubar):
566 Return void, not int, since caller ignores return value.
567 * gtkutil.c (xg_change_toolbar_position):
568 Return void, not 1.
569
5702012-09-23 Juanma Barranquero <lekktu@gmail.com>
571
572 * makefile.w32-in (BLOCKINPUT_H): Remove.
573 (SYSSIGNAL_H): New macro.
574 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
575 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
576 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
577 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
578 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
579 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
580 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
581 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
582 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
583 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
584 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
585 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
586 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
587 ($(BLD)/w32xfns.$(O)): Update dependencies.
588
5892012-09-23 Eli Zaretskii <eliz@gnu.org>
590
591 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
592 fatal_error_backtrace.
593
594 * w32proc.c (sys_kill): Undo last change: don't do anything when
595 invoked to deliver SIGABRT to our own process. This is now
596 handled by emacs_raise.
597
5982012-09-23 Juanma Barranquero <lekktu@gmail.com>
599
600 * w32term.c (w32_read_socket): Remove leftover reference to
601 interrupt_input_pending.
602
6032012-09-23 Paul Eggert <eggert@cs.ucla.edu>
604
605 Do not use SA_NODEFER.
606 Problem reported by Dani Moncayo in
607 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
608 * alloc.c (die):
609 * sysdep.c (emacs_abort): Do not reset signal handler.
610 * emacs.c (terminate_due_to_signal): Reset signal handler here.
611 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
612 wanted even on POSIXish hosts, and it doesn't work on Windows.
613
6142012-09-23 Jan Djärv <jan.h.d@swipnet.se>
615
616 * xterm.c (x_term_init): Call fixup_locale before and after calling
617 gtk_init (Bug#12392).
618
6192012-09-23 Chong Yidong <cyd@gnu.org>
620
621 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
622 Vdynamic_library_alist.
623
624 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
625 (Fgnutls_available_p): Caller changed.
626
627 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
628 (Flibxml_parse_xml_region): Likewise.
629
630 * dispextern.h (struct image_type): Remove arg from init function.
631
632 * image.c (Finit_image_library, lookup_image_type)
633 (define_image_type): Remove now-unneeded second arg.
634 (init_xpm_functions, init_png_functions, init_jpeg_functions)
635 (init_tiff_functions, init_gif_functions, init_svg_functions):
636 Arglist and w32_delayed_load calling convention changed.
637 (gs_type): Remove init_gs_functions; there is no such function.
638 (valid_image_p, make_image): Fix caller to lookup_image_type.
639
6402012-09-23 Paul Eggert <eggert@cs.ucla.edu>
641
642 Simplify and avoid signal-handling races (Bug#12471).
643 * alloc.c (die):
644 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
645 Avoid recursive loop if there's a fatal error in the function itself.
646 * atimer.c (pending_atimers):
647 * blockinput.h: Don't include "atimer.h"; no longer needed.
648 (interrupt_input_pending): Remove. All uses removed.
649 pending_signals now counts both atimers and ordinary interrupts.
650 This is less racy than having three separate pending-signal flags.
651 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
652 (input_blocked_p):
653 Rename from their upper-case counterparts BLOCK_INPUT,
654 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
655 INPUT_BLOCKED_P, and turn into functions. All uses changed.
656 This makes it easier to access volatile variables more accurately.
657 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
658 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
659 that's more reliable if the code is buggy and sets
660 interrupt_input_blocked to a negative value. All uses changed.
661 * atimer.c (deliver_alarm_signal):
662 Remove. No need to deliver this to the parent; any thread can
663 handle this signal now. All uses replaced by underlying handler.
664 * atimer.c (turn_on_atimers):
665 * dispnew.c (handle_window_change_signal):
666 * emacs.c (handle_danger_signal):
667 * keyboard.c (kbd_buffer_get_event):
668 Don't reestablish signal handler; not needed with sigaction.
669 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
670 (UNBLOCK_INPUT_TO):
671 Rework to avoid unnecessary accesses to volatile variables.
672 (UNBLOCK_INPUT_TO): Now a function.
673 (totally_unblock_input, unblock_input): New decls.
674 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
675 (init_data): Remove. Necessary stuff now done in init_signal.
676 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
677 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
678 (fatal_error_code): Remove; no longer needed.
679 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
680 it doesn't always backtrace. All uses changed. No need to reset
681 signal to default, since sigaction and/or die does that for us now.
682 Use emacs_raise (FOO), not kill (getpid (), FOO).
683 (main): Check more-accurately whether we're dumping.
684 Move fatal-error setup to sysdep.c
685 * floatfns.c: Do not include "syssignal.h"; no longer needed.
686 * gtkutil.c (xg_get_file_name, xg_get_font):
687 Remove no-longer-needed signal-mask manipulation.
688 * keyboard.c, process.c (POLL_FOR_INPUT):
689 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
690 * keyboard.c (read_avail_input): Remove.
691 All uses replaced by gobble_input.
692 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
693 (kbd_buffer_store_event_hold, gobble_input):
694 (record_asynch_buffer_change) [USABLE_SIGIO]:
695 (store_user_signal_events):
696 No need to mess with signal mask.
697 (gobble_input): If blocking input and there are terminals, simply
698 set pending_signals to 1 and return. All hooks changed to not
699 worry about whether input is blocked.
700 (process_pending_signals): Clear pending_signals before processing
701 them, in case a signal comes in while we're processing.
702 By convention callers now test pending_signals before calling us.
703 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
704 New functions, to support changes to blockinput.h.
705 (handle_input_available_signal): Now extern.
706 (reinvoke_input_signal): Remove. All uses replaced by
707 handle_async_input.
708 (quit_count): Now volatile, since a signal handler uses it.
709 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
710 All callers changed. Block SIGINT only if not already blocked.
711 Clear sigmask reliably, even if Fsignal returns, which it can.
712 Omit unnecessary accesses to volatile var.
713 (quit_throw_to_read_char): No need to restore sigmask.
714 * keyboard.c (gobble_input, handle_user_signal):
715 * process.c (wait_reading_process_output):
716 Call signal-handling code rather than killing ourselves.
717 * lisp.h: Include <float.h>, for...
718 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
719 (pending_signals): Now volatile.
720 (syms_of_data): Now const if IEEE floating point.
721 (handle_input_available_signal) [USABLE_SIGIO]:
722 (terminate_due_to_signal, record_child_status_change): New decls.
723 * process.c (create_process): Avoid disaster if memory is exhausted
724 while we're processing a vfork, by tightening the critical section
725 around the vfork.
726 (send_process_frame, process_sent_to, handle_pipe_signal)
727 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
728 ignores SIGPIPE.
729 (send_process): No need for setjmp/longjmp any more, since the
730 SIGPIPE stuff is now gone. Instead, report an error if errno
731 is EPIPE.
732 (record_child_status_change): Now extern. PID and W are now args.
733 Return void, not bool. All callers changed.
734 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
735 Remove. All uses removed. This bug should be fixed now in a
736 different way.
737 (wait_for_termination_1): Use waitpid rather than sigsuspend,
738 and record the child status change directly. This avoids the
739 need to futz with the signal mask.
740 (process_fatal_action): Move here from emacs.c.
741 (emacs_sigaction_flags): New function, containing
742 much of what used to be in emacs_sigaction_init.
743 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
744 caught by emacs, to make races less likely.
745 (deliver_process_signal): Rename from handle_on_main_thread.
746 All uses changed.
747 (BACKTRACE_LIMIT_MAX): Now at top level.
748 (thread_backtrace_buffer, threadback_backtrace_pointers):
749 New static vars.
750 (deliver_thread_signal, deliver_fatal_thread_signal):
751 New functions, for more-accurate delivery of thread-specific signals.
752 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
753 (deliver_arith_signal): Handle in this thread, not
754 in the main thread, since it's triggered by this thread.
755 (maybe_fatal_sig): New function.
756 (init_signals): New arg DUMPING so that we can be more accurate
757 about whether we're dumping. Caller changed.
758 Treat thread-specific signals differently from process-general signals.
759 Block all signals while handling fatal error; that's safer.
760 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
761 on IEEE hosts.
762 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
763 Ignore SIGPIPE unless batch.
764 (emacs_backtrace): Output backtrace for the appropriate thread,
765 which is not necessarily the main thread.
766 * syssignal.h: Include <stdbool.h>.
767 (emacs_raise): New macro.
768 * xterm.c (x_connection_signal): Remove; no longer needed
769 now that we use sigaction.
770 (x_connection_closed): No need to mess with sigmask now.
771 (x_initialize): No need to reset SIGPIPE handler here, since
772 init_signals does this for us now.
773
7742012-09-23 Jan Djärv <jan.h.d@swipnet.se>
775
776 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
777 background rect may be larger (Bug#12245).
778
7792012-09-23 Chong Yidong <cyd@gnu.org>
780
781 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
782
7832012-09-22 Paul Eggert <eggert@cs.ucla.edu>
784
785 * .gdbinit: Just stop at fatal_error_backtrace.
786 See Stefan Monnier's request in
787 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
788 Remove no-longer-used query of system type.
789
7902012-09-22 Chong Yidong <cyd@gnu.org>
791
792 * search.c (Freplace_match): Doc fix (Bug#12325).
793
794 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
795
796 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
797 (Fline_end_position): Doc fix.
798
799 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
800
8012012-09-22 Chong Yidong <cyd@gnu.org>
802
803 * dispextern.h (struct image_type): Add new slot, storing a type
804 initialization function.
805
806 * image.c (define_image_type): Call the image initializer function
807 if it is defined. Arguments and return value changed.
808 (valid_image_p, make_image): Callers changed.
809 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
810 (gif_type, imagemagick_type, svg_type, gs_type):
811 Add initialization functions.
812 (Finit_image_library): Call lookup_image_type.
813 (CHECK_LIB_AVAILABLE): Macro deleted.
814 (lookup_image_type): Call define_image_type here, rather than via
815 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
816 (syms_of_image): Move define_image_type calls for xbm_type and
817 pbm_type to lookup_image_type.
818
8192012-09-22 Eli Zaretskii <eliz@gnu.org>
820
821 * keyboard.c (timer_check_2): Move calculation of 'timers' and
822 'idle_timers' from here ...
823 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
824 lists, to avoid infloops when the timer does something stupid,
825 like reinvoke itself with the same or smaller time-out.
826 (Bug#12447)
827
8282012-09-22 Martin Rudalics <rudalics@gmx.at>
829
830 * window.c (Fsplit_window_internal): Handle only Qt value of
831 Vwindow_combination_limit separately.
832 (Qtemp_buffer_resize): New symbol.
833 (Vwindow_combination_limit): New default value.
834 Rewrite doc-string.
835
8362012-09-22 Eli Zaretskii <eliz@gnu.org>
837
838 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
839 the new overlay string. (Bug#10159)
840
8412012-09-22 Paul Eggert <eggert@cs.ucla.edu>
842
843 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
844 or that fprintf is async-signal-safe. POSIX doesn't require
845 either assumption.
846
8472012-09-22 Chong Yidong <cyd@gnu.org>
848
849 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
850 (Bug#8207).
851
8522012-09-22 Kenichi Handa <handa@gnu.org>
853
854 * composite.c (composition_reseat_it): Handle the case that a
855 grapheme cluster is not covered by a single font (Bug#12352).
856
8572012-09-21 Chong Yidong <cyd@gnu.org>
858
859 * image.c (define_image_type): Avoid adding duplicate types to
860 image_types (Bug#12463). Suggested by Jörg Walter.
861
8622012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
863
864 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
865 (print_load_command_name): Add case LC_DATA_IN_CODE.
866 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
867
8682012-09-21 Glenn Morris <rgm@gnu.org>
869
870 * eval.c (Frun_hook_with_args_until_success)
871 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
872
8732012-09-21 Andreas Schwab <schwab@linux-m68k.org>
874
875 * fileio.c (Ffile_selinux_context): Only call freecon when
876 lgetfilecon succeeded.
877 (Fset_file_selinux_context): Likewise. (Bug#12444)
878
8792012-09-21 Eli Zaretskii <eliz@gnu.org>
880
881 * xdisp.c (try_window_reusing_current_matrix): Under bidi
882 reordering, locate the cursor by calling set_cursor_from_row; if
883 that fails, clear the desired glyph matrix before returning a
884 failure indication to the caller. Fixes leaving garbled display
885 when fast scrolling with a down-key. (Bug#12403)
886 (compute_stop_pos_backwards): Fix a typo that caused crashes while
887 scrolling through multibyte text.
888
8892012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
890
891 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
892 calling mark_vectorlike since that's the one that marks the window.
893 (mark_discard_killed_buffers): Mark the final cdr.
894 * window.h (struct window): Move prev/next_buffers to the
895 non-standard fields.
896 * window.c (make_window): Initialize prev/next_buffers manually.
897
8982012-09-20 Paul Eggert <eggert@cs.ucla.edu>
899
900 Omit unused arg EXPECTED from socket hooks.
901 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
902 * nsterm.m (ns_term_init):
903 * termhooks.h (struct terminal.read_socket_hook):
904 * w32inevt.c (w32_console_read_socket):
905 * w32term.c (w32_read_socket):
906 * xterm.c (XTread_socket):
907 Omit unused arg EXPECTED. All callers changed.
908 (store_user_signal_events): Return void, not int, since callers no
909 longer care about the return value. All uses changed.
910
9112012-09-20 Juanma Barranquero <lekktu@gmail.com>
912
913 * w32gui.h (XParseGeometry): Do not declare.
914
9152012-09-19 Paul Eggert <eggert@cs.ucla.edu>
916
917 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
918 Ignore 'expected'. See Eli Zaretskii in
919 <http://bugs.gnu.org/12471#8> (last line).
920
921 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
922 (XParseGeometry): Now static. Substitute extremal values for
923 values that are out of range.
924
9252012-09-19 Jan Djärv <jan.h.d@swipnet.se>
926
927 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
928
929 * nsfns.m (XParseGeometry): Remove.
930 (Fx_create_frame): Call x_set_offset to correctly interpret
931 top_pos in geometry.
932
933 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
934 (Fx_parse_geometry): If there is a space in string, call
935 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
936
9372012-09-17 Eli Zaretskii <eliz@gnu.org>
938
939 * search.c (scan_buffer): Use character positions in calls to
940 region_cache_forward and region_cache_backward, not byte
941 positions. (Bug#12196)
942
943 * w32term.c (w32_read_socket): Set pending_signals to 1, like
944 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
945
946 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
947 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
948 emacs_blocked_malloc, now deleted.
949
9502012-09-17 Paul Eggert <eggert@cs.ucla.edu>
951
952 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
953 The workaround was for improving performance on Solaris 2.4, but
954 is getting in the way now. Emacs will still work if someone is
955 still running Solaris 2.4 in a museum somewhere; Sun dropped
956 support for Solaris 2.4 in 2003.
957 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
958 * process.c (create_process) [HAVE_WORKING_VFORK]:
959 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
960 since Emacs no longer uses vfork on that platform.
961
9622012-09-17 Glenn Morris <rgm@gnu.org>
963
964 * emacs.c: Use COPYRIGHT.
965
9662012-09-16 Paul Eggert <eggert@cs.ucla.edu>
967
968 Remove configure's --without-sync-input option (Bug#12450).
969 When auditing signal-handling in preparation for cleaning it up,
970 I found that SYNC_INPUT has race conditions and would be a real
971 pain to fix. Since it's an undocumented and deprecated
972 configure-time option, now seems like a good time to remove it.
973 Also see <http://bugs.gnu.org/11080#16>.
974 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
975 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
976 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
977 (malloc_hysteresis):
978 (check_depth) [XMALLOC_OVERRUN_CHECK]:
979 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
980 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
981 (dont_register_blocks, bytes_used_when_reconsidered)
982 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
983 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
984 [!SYSTEM_MALLOC && !SYNC_INPUT]:
985 Remove. All uses removed.
986 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
987 implementation, one that depends on whether the new macro
988 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
989 is defined.
990 * atimer.c (run_timers, handle_alarm_signal):
991 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
992 (handle_async_input, process_pending_signals)
993 (handle_input_available_signal, init_keyboard):
994 * nsterm.m (ns_read_socket):
995 * process.c (wait_reading_process_output):
996 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
997 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
998 (emacs_write):
999 * xterm.c (XTread_socket):
1000 Assume SYNC_INPUT.
1001 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1002 * eval.c (handling_signal): Remove. All uses removed.
1003 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1004 All uses replaced with the SYNC_INPUT version.
1005 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1006 Remove decls.
1007 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1008 Now static.
1009
1010 * font.c (Ffont_shape_gstring): Remove unused local.
1011
10122012-09-16 Glenn Morris <rgm@gnu.org>
1013
1014 * Makefile.in (clean): No longer run nextstep's clean.
1015
1016 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1017 (ns_frag): Remove.
1018 (ns-app): Move here from ns.mk, and simplify.
1019 (clean): Simplify nextstep entry.
1020 * ns.mk: Remove file.
1021
10222012-09-17 Kenichi Handa <handa@gnu.org>
1023
1024 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1025 not covert the last few charactes.
1026
10272012-09-16 Kenichi Handa <handa@gnu.org>
1028
1029 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1030 here, but just check the validity of glyphs in the glyph-string.
1031
10322012-09-16 Martin Rudalics <rudalics@gmx.at>
1033
1034 * window.c (Fwindow_parameter, Fset_window_parameter):
1035 Accept any window as argument (Bug#12452).
1036
10372012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1038
1039 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1040 to ns_term_init to avoid memory leak.
1041
1042 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1043 explicit retain/release.
1044 (ns_term_init): Only allow one display. Initialize outerpool and
1045 ns_*_types.
1046
10472012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1048
1049 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1050 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1051 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1052 the Microsoft problem in a different way, by altering ../nt/config.nt.
1053
10542012-09-15 Eli Zaretskii <eliz@gnu.org>
1055
1056 * w32xfns.c:
1057 * w32uniscribe.c:
1058 * w32term.c:
1059 * w32select.c:
1060 * w32reg.c:
1061 * w32proc.c:
1062 * w32menu.c:
1063 * w32inevt.c:
1064 * w32heap.c:
1065 * w32font.c:
1066 * w32fns.c:
1067 * w32console.c:
1068 * w32.c:
1069 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1070 by lisp.h. This completes removal of setjmp.h inclusion
1071 erroneously announced in the previous commit. (Bug#12446)
1072
1073 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1074 more accurate.
1075
1076 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1077 not defined as a macro. The latter happens on MS-Windows.
1078 (Bug#12446)
1079
10802012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1081
1082 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1083 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1084 Some instances of '#include <setjmp.h>' removed, if the
1085 only reason for the instance was because "lisp.h" was included.
1086 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1087 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1088 and _longjmp with the new symbols. Emacs already uses _setjmp if
1089 available, so this change affects only POSIXish hosts that have
1090 sigsetjmp but not _setjmp, such as some versions of Solaris and
1091 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1092 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1093 (png_load_body) [HAVE_PNG]:
1094 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1095 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1096 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1097 since PNG requires jmp_buf. This is the only exception to the
1098 general rule that we now use sys_setjmp and sys_longjmp.
1099 This exception is OK since this code does not change the signal
1100 mask or longjmp out of a signal handler.
1101
11022012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1103
1104 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1105 Include "syssignal.h", for 'main_thread'.
1106
11072012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1108
1109 Avoid out-of-range marker position (Bug#12426).
1110 * insdel.c (replace_range, replace_range_2):
1111 Adjust markers before overlays, as suggested by comments.
1112 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1113 Remove redundant check before calling offset_intervals.
1114
11152012-09-14 Martin Rudalics <rudalics@gmx.at>
1116
1117 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1118 current buffer (Bug#12387).
1119
11202012-09-14 Juanma Barranquero <lekktu@gmail.com>
1121
1122 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1123
11242012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1125
1126 Use a more backwards-compatible timer format (Bug#12430).
1127 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1128 vector element, not from the 4th, since PSECS is now at the end.
1129 (Fcurrent_idle_time): Doc fix.
1130
11312012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1132
1133 Function to mark objects and remove killed buffers at once.
1134 * alloc.c (discard_killed_buffers): Rename to ...
1135 (mark_discard_killed buffers) ... new name. Add marking
1136 of remaining objects. Fix comment. Adjust users.
1137 (mark_object): Do not touch frame buffer lists here.
1138 * frame.c (delete_frame): Reset frame buffer lists here.
1139
11402012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1141
1142 Better workaround for GNOME bug when --enable-gcc-warnings.
1143 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1144 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1145 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1146
1147 Simplify SIGIO usage (Bug#12408).
1148 The code that dealt with SIGIO was crufty and confusing, e.g., it
1149 played tricks like "#undef SIGIO" but these tricks were not used
1150 consistently. Simplify mostly by not #undeffing standard symbols,
1151 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1152 or not as we please) rather than "defined SIGIO" (standard symbol
1153 that we probably shouldn't #undef).
1154 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1155 Modules that need it can include it.
1156 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1157 * dispextern.h (ignore_sigio): New decl.
1158 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1159 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1160 * emacs.c (shut_down_emacs):
1161 * keyboard.c (kbd_buffer_store_event_hold):
1162 Use ignore_sigio rather than invoking 'signal' directly.
1163 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1164 for FIONREAD.
1165 (FIONREAD, SIGIO): Do not #undef.
1166 (tty_read_avail_input): Use #error rather than a syntax error.
1167 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1168 for I_PIPE, used by SETUP_SLAVE_PTY.
1169 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1170 * sysdep.c (croak): Remove; no longer needed. This bit of
1171 temporary code, with Fred N. Fish's comment that it's temporary,
1172 has been in Emacs since at least 1992!
1173 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1174 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1175 * syssignal.h (croak): Remove decl.
1176 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1177 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1178 now that we're termios-only.
1179 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1180 * term.c (dissociate_if_controlling_tty): Use #error rather than
1181 a run-time error.
1182
1183 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1184 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1185 to work around GNOME bug 683906.
1186 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1187 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1188 This works around GCC bug 54561.
1189
11902012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1191
1192 More fixes for 'volatile' and setjmp/longjmp.
1193 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1194 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1195 (png_load_body) [HAVE_PNG]:
1196 (jpeg_load_body) [HAVE_JPEG]:
1197 New function, with most of the old parent function's body.
1198 (png_load) [HAVE_PNG]:
1199 (jpeg_load) [HAVE_JPEG]:
1200 Invoke the new function, to avoid longjmp munging our locals.
1201 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1202 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1203 longjmp is passed 2, as the C standard doesn't guarantee this.
1204 Instead, store the failure code into mgr->failure_code.
1205
12062012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1207
1208 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1209 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1210 (syms_of_keyboard): Remove support for unread-command-char.
1211
12122012-09-12 Eli Zaretskii <eliz@gnu.org>
1213
1214 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1215 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1216 violation. (Bug#12426)
1217
12182012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1219
1220 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1221
12222012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1223
1224 * eval.c: Add `inhibit-debugger'.
1225 (Qinhibit_debugger): New symbol.
1226 (call_debugger): Bind it instead of Qdebug_on_error.
1227 (maybe_call_debugger): Test Vinhibit_debugger.
1228 (syms_of_eval): Define inhibit-debugger.
1229 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1230 (syms_of_xdisp): Remove inhibit-debug-on-message.
1231
12322012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1233
1234 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1235 If a nonvolatile local variable is written before a _longjmp to
1236 the frame containing the variable, and is read after the _longjmp,
1237 the value read is indeterminate. Some local variables of type
1238 'struct handler' and 'struct catchtag' are used in this way, so
1239 mark each of their slots as volatile if the slot can be set before
1240 _longjmp and read afterwards.
1241 * lisp.h (struct handler): var and chosen_clause are now volatile.
1242 (struct catchtag): val, next, and pdlcount are now volatile.
1243
1244 * bidi.c (bidi_push_it, bidi_pop_it):
1245 * fns.c (copy_hash_table):
1246 * image.c (define_image_type):
1247 * keyboard.c (kbd_buffer_store_event_hold):
1248 * process.c (Fprocess_send_eof):
1249 * xfaces.c (x_create_gc) [HAVE_NS]:
1250 * xgselect.c (xg_select):
1251 Prefer assignment to memcpy when either will do.
1252
1253 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1254 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1255 time an item is removed. No need to mark this function 'inline';
1256 the compiler knows better than we do.
1257
12582012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1259
1260 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1261 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1262 to change_frame_size (Bug#12388).
1263 (windowDidResize:): Pass YES to updateFrameSize.
1264
1265 * nsterm.h: Add delay parameter to updateFrameSize.
1266
12672012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1268
1269 Discard killed buffers from deleted window and frame objects.
1270 This reduces an amount of references to killed buffers and
1271 helps GC to reclaim them faster.
1272 * alloc.c (discard_killed_buffers): New function.
1273 (mark_object): Use it for deleted windows and frames.
1274 (mark_object): If symbol's value is set up for a killed buffer
1275 or deleted frame, restore it's global binding.
1276 * data.c (swap_in_global_binding): Add GC notice.
1277 (swap_in_symval_forwarding): Use convenient set_blv_where.
1278 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1279 * window.h: ... to here.
1280
12812012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1282
1283 Convenient macro to check whether the buffer is live.
1284 * buffer.h (BUFFER_LIVE_P): New macro.
1285 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1286 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1287
12882012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1289
1290 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1291 composition cases (Bug#12364).
1292
1293 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1294 overhang of succeeding glyphs overlapping box cursor.
1295
1296 * w32term.c (x_draw_glyph_string): Likewise.
1297
12982012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1299
1300 Simplify, document, and port floating-point (Bug#12381).
1301 The porting part of this patch fixes bugs on non-IEEE platforms
1302 with frexp, ldexp, logb.
1303 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1304 Now static.
1305 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1306 support, by removing commented-out code and briefly listing the
1307 C89 functions excluded. The commented-out stuff was confusing
1308 maintenance, e.g., we thought we needed cbrt but it was commented out.
1309 (logb): Remove decl; no longer needed.
1310 (isfinite): New macro, if not already supplied.
1311 (isnan): Don't replace any existing macro.
1312 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1313 are present on all C89 platforms.
1314 (Ffrexp): Do not special-case zero, as frexp does the right thing
1315 for that case.
1316 (Flogb): Do not use logb, as it doesn't have the desired meaning
1317 on hosts that use non-base-2 floating point. Instead, stick with
1318 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1319 frexp, to avoid getting an unspecified result.
1320
1321 * xdisp.c (Qinhibit_debug_on_message): Now static.
1322
13232012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1324
1325 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1326 NSBezierPath (Bug#12131).
1327
13282012-09-10 Chong Yidong <cyd@gnu.org>
1329
1330 * fns.c (Fdelq, Fdelete): Doc fix.
1331
13322012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1333
1334 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1335 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1336
13372012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1338
1339 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1340 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1341 Use it.
1342
13432012-09-09 Eli Zaretskii <eliz@gnu.org>
1344
1345 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1346 left fringe if the window has a left margin. This avoids leaving
1347 traces of the cursor because its leftmost pixel is not drawn over.
1348
1349 * dispnew.c (update_window_line): When the left margin area of a
1350 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1351 that screen line. (Bug#12277)
1352
13532012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1354
1355 Assume C89 or later for math functions (Bug#12381).
1356 This simplifies the code, and makes it a bit smaller and faster,
1357 and (most important) makes it easier to clean up signal handling
1358 since we can stop worring about floating-point exceptions in
1359 library code. That was a problem before C89, but the problem
1360 went away many years ago on all practical Emacs targets.
1361 * data.c, image.c, lread.c, print.c:
1362 Don't include <math.h>; no longer needed.
1363 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1364 might be autoconfigured, as that never happens.
1365 * data.c (fmod):
1366 * doprnt.c (DBL_MAX_10_EXP):
1367 * print.c (DBL_DIG):
1368 Remove. C89 or later always defines these.
1369 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1370 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1371 (arith_error, domain_error, domain_error2):
1372 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1373 no longer needed -- we simply return what C returns. All uses removed.
1374 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1375 the wrapped code.
1376 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1377 Remove. All uses expanded, as these macros are no longer used
1378 more than once and are now more trouble than they're worth.
1379 (Ftan): Use tan, not sin / cos.
1380 (Flogb): Assume C89 frexp.
1381 (fmod_float): Assume C89 fmod.
1382 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1383 (init_floatfns): Remove. All uses removed.
1384
13852012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1386
1387 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1388 compositeToPoint for OSX < 10.6 (Bug#12390).
1389
13902012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1391
1392 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1393 This produces more-accurate results.
1394
13952012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1396
1397 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1398 changes (Bug#12088).
1399
14002012-09-08 Chong Yidong <cyd@gnu.org>
1401
1402 * syntax.c (Fstring_to_syntax): Doc fix.
1403
14042012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1405
1406 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1407 in the internal border.
1408 (x_set_window_size): Remove static variables and their usage.
1409 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1410 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1411 Remove fringe/internal border adjustment (Bug#11052).
1412 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1413 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1414 (ns_fix_rect_ibw): Remove.
1415 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1416 (ns_dumpglyphs_box_or_relief): Ditto.
1417 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1418 adjustment.
1419 (ns_dumpglyphs_image): Ditto.
1420 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1421 border adjustment.
1422 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1423 their usage. Add fringe_extended_p and its use as in other terms.
1424 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1425 scroll bar was removed.
1426 (updateFrameSize): New function.
1427 (windowDidResize): Move code to updateFrameSize and call it.
1428
1429 * nsterm.h (EmacsView): Add updateFrameSize.
1430
14312012-09-07 Chong Yidong <cyd@gnu.org>
1432
1433 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1434
1435 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1436
14372012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1438
1439 More signal-handler cleanup (Bug#12327).
1440 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1441 Problem introduced when merging patches. Noted by Eli Zaretskii in
1442 <http://bugs.gnu.org/12327#67>.
1443 * floatfns.c: Comment fix.
1444 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1445 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1446 and anyway the declaration is harmless even if SIGDANGER is not defined.
1447 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1448 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1449 source files not surprisingly expected syssignal.h to define, or
1450 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1451 Include <sys/ioctl.h>, for FIONREAD.
1452 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1453 This eliminates a problem whereby other files mysteriously had
1454 to include "syssignal.h" before including "systty.h" if they
1455 wanted to use "#ifdef SIGIO".
1456
14572012-09-07 Eli Zaretskii <eliz@gnu.org>
1458
1459 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1460
1461 * w32.c (sigemptyset): Empty the set.
1462 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1463
1464 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1465
14662012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1467
1468 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1469 (mark_object): Likewise for frame objects.
1470
14712012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1472
1473 * syssignal.h (handle_on_main_thread): Always declare,
1474 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1475 This ports to platforms without HAVE_PTHREAD.
1476
14772012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1478
1479 Signal-handler cleanup (Bug#12327).
1480 Emacs's signal handlers were written in the old 4.2BSD style with
1481 sigblock and sigmask and so forth, and this led to some
1482 inefficiencies and confusion. Rewrite these to use
1483 pthread_sigmask etc. without copying signal sets around. Also,
1484 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1485 'signal', and instead use functions that do not attempt to take
1486 over the system name space. This patch causes Emacs's text
1487 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1488 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1489 Do not include <signal.h> or "syssignal.h", as these
1490 modules do not use signals.
1491 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1492 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1493 Do not include <signal.h>, as "syssignal.h" does that for us now.
1494 * atimer.c (sigmask_atimers): New function.
1495 (block_atimers, unblock_atimers): New functions,
1496 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1497 All uses replaced.
1498 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1499 no longer needed here.
1500 * emacs.c (main): Inspect existing signal handler with sigaction,
1501 so that there's no need to block and unblock SIGHUP.
1502 * sysdep.c (struct save_signal): New member 'action', replacing
1503 old member 'handler'.
1504 (save_signal_handlers, restore_signal_handlers):
1505 Use sigaction instead of 'signal' to save and restore.
1506 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1507 New function. All users of 'signal' modified to use set_sighandler
1508 if they're writeonly, and to use sys_signal if they're read+write.
1509 (emacs_sigaction_init, forwarded_signal): New functions.
1510 (sys_signal): Remove. All uses replaced by calls to sigaction
1511 and emacs_sigaction_init, or by direct calls to 'signal'.
1512 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1513 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1514 all uses replaced by pthread_sigmask etc. calls.
1515 * syssignal.h: Include <signal.h>.
1516 (emacs_sigaction_init, forwarded_signal): New decls.
1517 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1518 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1519 (sigmask, sys_sigmask): Remove; no longer needed.
1520 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1521 (sigblock, sigunblock, sigfree):
1522 (sigsetmask) [!defined sigsetmask]:
1523 Remove. All uses replaced by pthread_sigmask.
1524 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1525 no longer need to be replaced, and its typical old uses
1526 are now done via emacs_sigaction_init and sigaction.
1527 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1528 (sys_sigdel): Remove; unused.
1529 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1530
15312012-09-06 Eli Zaretskii <eliz@gnu.org>
1532
1533 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1534 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1535
15362012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1537
1538 Explicitly mark buffer_defaults and buffer_local_symbols.
1539 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1540 mark_local_symbols here.
1541 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1542 since special buffers aren't marked here any more.
1543 (allocate_buffer): Chain new buffer with all_buffers here...
1544 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1545 not here.
1546 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1547 (syms_of_buffer): Remove staticpro of the above.
1548 (init_buffer_once): Set names for buffer_defaults and
1549 buffer_local_symbols.
1550
15512012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1552
1553 Use bool for booleans in font-related modules.
1554 * font.c (font_intern_prop, font_style_to_value)
1555 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1556 (generate_otf_features, font_check_otf_features, font_check_otf)
1557 (font_match_p, font_list_entities, font_at):
1558 * fontset.c (fontset_id_valid_p, reorder_font_vector
1559 (fontset_find_font, Fset_fontset_font)
1560 (face_suitable_for_char_p) [0]:
1561 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1562 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1563 (m17n_flt_initialized, ftfont_shape_by_flt):
1564 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1565 * nsfont.m (nsfont_draw):
1566 * w32font.c (w32font_draw):
1567 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1568 Use bool for booleans.
1569 * font.h: Adjust to above API changes.
1570 (struct font, struct font_driver, struct font_driver_list):
1571 Use bool for booleans.
1572 (struct font): Remove useless member encoding_type.
1573 All users removed.
1574 * fontset.c, xftfont.c: Omit unnecessary static decls.
1575
15762012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1577
1578 * alloc.c (mark_object): Revert window marking code
1579 since it's unsafe for the Fset_window_configuration.
1580
15812012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1582
1583 Fix race conditions with signal handlers and errno (Bug#12327).
1584 Be more systematic about preserving errno whenever a signal
1585 handler returns, even if it's not in the main thread. Do this by
1586 renaming signal handlers to distinguish between signal delivery
1587 and signal handling. All uses changed.
1588 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1589 * data.c (deliver_arith_signal): Rename from arith_error.
1590 * dispnew.c (deliver_window_change_signal): Rename from
1591 window_change_signal.
1592 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1593 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1594 * keyboard.c (deliver_input_available_signal): Rename from
1595 input_available_signal.
1596 (deliver_user_signal): Rename from handle_user_signal.
1597 (deliver_interrupt_signal): Rename from interrupt_signal.
1598 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1599 (deliver_child_signal): Rename from sigchld_handler.
1600 * atimer.c (handle_alarm_signal):
1601 * data.c (handle_arith_signal):
1602 * dispnew.c (handle_window_change_signal):
1603 * emacs.c (handle_fatal_signal, handle_danger_signal):
1604 * keyboard.c (handle_input_available_signal):
1605 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1606 * process.c (handle_pipe_signal, handle_child_signal):
1607 New functions, with the actual signal-handling code taken from the
1608 original respective signal handlers, sans the sporadic attempts to
1609 preserve errno, since that's now done by handle_on_main_thread.
1610 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1611 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1612 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1613 Move to sysdep.c.
1614 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1615 Move initialization of main_thread to sysdep.c's init_signals.
1616 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1617 our usage, and simplifies the mainline code.
1618 (record_child_status_change): New static function, as a helper
1619 for handle_child_signal, and with most of the old child handler's
1620 contents.
1621 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1622 (handle_child_signal): Use the above.
1623 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1624 Moved here from emacs.c.
1625 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1626 code moved here from emacs.c's main function.
1627 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1628 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1629 This lets callers save and restore errno properly.
1630
16312012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1632
1633 Remove redundant or unused things here and there.
1634 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1635 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1636 * editfns.c (Fcompare_buffer_substrings): Likewise.
1637 * frame.h (struct terminal, struct font_driver_list):
1638 Remove redundant declarations.
1639 * window.h (Qleft, Qright): Likewise.
1640
16412012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1642
1643 Do not mark objects from deleted buffers, windows and frames.
1644 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1645 (mark_object): Likewise for windows and frames.
1646
16472012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1648
1649 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1650 buffer_defaults and buffer_local_symbols as valid objects.
1651 Return special value to denote them.
1652
16532012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1654
1655 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1656 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1657 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1658 (file_name_absolute_p, Fsubstitute_in_file_name):
1659 (check_executable, check_writable, Ffile_accessible_directory_p)
1660 (Fset_file_selinux_context, Fdefault_file_modes)
1661 (Finsert_file_contents, choose_write_coding_system)
1662 (Fwrite_region, build_annotations, a_write, e_write)
1663 (Fdo_auto_save):
1664 * filelock.c (boot_time_initialized, get_boot_time)
1665 (get_boot_time_1, lock_file_1, within_one_second):
1666 * floatfns.c (in_float):
1667 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1668 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1669 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1670 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1671 * window.c (compare_window_configurations):
1672 Use bool for booleans.
1673 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1674 (Fdefault_file_modes): Now mode_t, not int, for modes.
1675 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1676 (internal_delete_file): Now returns void, not a (boolean) int,
1677 since nobody was looking at the return value.
1678 * lisp.h, window.h: Adjust to above API changes.
1679
1680 * xdisp.c (set_message): Simplify and reindent last change.
1681
16822012-09-05 Juanma Barranquero <lekktu@gmail.com>
1683
1684 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1685
16862012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1687
1688 * eval.c (call_debugger): Make the function non-static so that we
1689 can call it from set_message.
1690
1691 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1692 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1693
16942012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1695
1696 Give more-useful info on a fatal error (Bug#12328).
1697 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1698 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1699 of doing the work ourselves.
1700 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1701 do most of the work.
1702 (fatal_error_backtrace): New function, taken from the guts
1703 of the old fatal_error_signal, but with a new option to output
1704 a backtrace.
1705 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1706 info about the signal than just its number.
1707 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1708 * sysdep.c: Include <execinfo.h>
1709 (emacs_backtrace): New function, taken partly from the previous
1710 code of the 'die' function.
1711 (emacs_abort): Call fatal_error_backtrace rather than abort.
1712
17132012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1714
1715 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1716 eager (load-time) macro-expansion.
1717 * lisp.mk (lisp): Add macroexp.
1718
17192012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1720
1721 Simplify redefinition of 'abort' (Bug#12316).
1722 Do not try to redefine the 'abort' function. Instead, redo
1723 the code so that it calls 'emacs_abort' rather than 'abort'.
1724 This removes the need for the NO_ABORT configure-time macro
1725 and makes it easier to change the abort code to do a backtrace.
1726 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1727 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1728 Remove; sysdep.c's emacs_abort now takes its place.
1729 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1730 'abort' changed to use 'emacs_abort'.
1731 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1732 (abort) [!defined abort]: Rename to ...
1733 (emacs_abort): ... new name.
1734 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1735 the place of the old 'abort' in emacs.c.
1736 * w32.c, w32fns.c (abort): Do not #undef.
1737 * w32.c (emacs_abort): Rename from w32_abort.
1738
17392012-09-04 Eli Zaretskii <eliz@gnu.org>
1740
1741 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1742 offsets[j].dv, since the y axis of the screen coordinates points
1743 down, while the y axis of the font definition coordinates points
1744 up. This fixes display of Arabic diacritics such as KASRA and
1745 KASRATAN. (Bug#11860)
1746
17472012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1748
1749 Be more systematic about _setjmp vs setjmp.
1750 * alloc.c (test_setjmp, mark_stack):
1751 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1752 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1753 (png_load, my_error_exit, jpeg_load):
1754 * process.c (send_process_trap, send_process):
1755 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1756 The underscored versions are up to 30x faster on some hosts.
1757 Formerly, the code used setjmp+longjmp sometimes and
1758 _setjmp+_longjmp at other times, with no particular reason to
1759 prefer setjmp+longjmp.
1760
17612012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1762
1763 Fix minor problem found by static checking.
1764 * buffer.c (Fdelete_all_overlays): Return nil.
1765
17662012-09-03 Martin Rudalics <rudalics@gmx.at>
1767
1768 * buffer.c (Fdelete_all_overlays): New function.
1769
17702012-09-03 Chong Yidong <cyd@gnu.org>
1771
1772 * gtkutil.c: Add extern decl for Qxft.
1773
17742012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1775
1776 * emacs.c, eval.c: Use bool for boolean.
1777 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1778 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1779 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1780 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1781 (main, decode_env_path, Fdaemon_initialized):
1782 * eval.c (call_debugger, Finteractive_p, interactive_p):
1783 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1784 (maybe_call_debugger, Fbacktrace):
1785 * process.c (read_process_output, exec_sentinel):
1786 Use bool for booleans.
1787 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1788 All callers changed.
1789 * eval.c (interactive_p): Omit always-true boolean argument
1790 EXCLUDE_SUBRS_P. All callers changed.
1791 * dispextern.h, lisp.h: Reflect above API changes.
1792 * firstfile.c (dummy): Use the address of 'main', whose signature
1793 won't change, instead of the address of 'initialize', whose
1794 signature just changed from int to bool.
1795 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1796 * msdos.c (fatal_error_in_progress): ... from here.
1797 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1798 of incrementing it.
1799 (redisplay_internal, unwind_redisplay): Simply clear
1800 REDISPLAYING_P when unwinding, instead of saving its previous,
1801 always-false value and then restoring it.
1802
1803 Clean up some extern decls.
1804 Mostly, this hoists extern decls out of .c files and into .h files.
1805 That way, we're more likely to catch errors if the interfaces change.
1806 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1807 declare xg_mark_data.
1808 * dispextern.h (x_frame_parm_handlers):
1809 * font.h (Qxft):
1810 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1811 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1812 (Qultra_bold, Qoblique, Qitalic):
1813 Move extern decl here from .c file.
1814 * alloc.c (xg_mark_data) [USE_GTK]:
1815 * doc.c (Qclosure):
1816 * eval.c (Qlexical_binding):
1817 * fns.c (time) [!HAVE_UNISTD_H]:
1818 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1819 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1820 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1821 * lread.c (Qinternal_interpreter_environment):
1822 * minibuf.c (Qbuffer):
1823 * process.c (QCfamily, QCfilter):
1824 * widget.c (free_frame_faces):
1825 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1826 * xfont.c (x_clear_errors):
1827 * xterm.c (x_frame_parm_handlers):
1828 Remove now-redundant extern decls.
1829 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1830 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1831 Now static.
1832 * xfaces.c: Remove unnecessary static decls.
1833 * xterm.c (updating_frame): Remove decl of nonexistent object.
1834
1835 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1836 when building globals.h, as the objects that are not built on
1837 this host are not needed to compile C files on this host.
1838
18392012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1840
1841 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1842
1843 * frame.h: Add missing prototype for x_wm_set_size_hint.
1844
18452012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1846
1847 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1848 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1849 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1850 (Fsubstitute_command_keys):
1851 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1852 (save_excursion_save, save_excursion_restore)
1853 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1854 (format_time_string, general_insert_function)
1855 (make_buffer_string, make_buffer_string_both)
1856 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1857 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1858 (copy_text, insert_1, insert_1_both, insert_from_string)
1859 (insert_from_string_before_markers, insert_from_string_1)
1860 (insert_from_buffer, insert_from_buffer_1, replace_range)
1861 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1862 (del_range_2, modify_region):
1863 * intervals.c (intervals_equal, balance_possible_root_interval)
1864 (adjust_intervals_for_insertion, merge_properties_sticky)
1865 (graft_intervals_into_buffer, lookup_char_property)
1866 (adjust_for_invis_intang, set_point_both)
1867 (get_property_and_range, compare_string_intervals)
1868 (set_intervals_multibyte_1, set_intervals_multibyte):
1869 * keyboard.c (decode_timer):
1870 Use bool for boolean.
1871 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1872 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1873
18742012-09-02 Chong Yidong <cyd@gnu.org>
1875
1876 * keymap.c (push_key_description): Print M-TAB as C-M-i
1877 (Bug#11758).
1878
18792012-09-02 Juanma Barranquero <lekktu@gmail.com>
1880
1881 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1882 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1883 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1884 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1885 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1886 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1887 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1888
18892012-09-01 Eli Zaretskii <eliz@gnu.org>
1890
1891 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1892 more than one grapheme cluster passed to the shaper: compute the
1893 offset adjustment values separately for each cluster. (Bug#11860)
1894
1895 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1896 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1897 about implicit conversions from integer to pointer.
1898
18992012-09-01 Daniel Colascione <dancol@dancol.org>
1900
1901 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1902 system used too early.
1903
19042012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1905
1906 Better seed support for (random).
1907 * emacs.c (main): Call init_random.
1908 * fns.c (Frandom): Set the seed from a string argument, if given.
1909 Remove long-obsolete Gentzel cruft.
1910 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1911 (init_random): New function.
1912
19132012-09-01 Daniel Colascione <dancol@dancol.org>
1914
1915 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1916 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1917 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1918 x_wm_set_size_hint, x_query_colors, x_real_positions,
1919 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1920 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1921 all of which have been moved to common code.
1922
1923 * xfaces.c: Include TERM_HEADER instead of listing all possible
1924 window-system headers.
1925
1926 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1927 to match header.
1928
1929 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1930 directly accessing frame internals.
1931
1932 * w32font.h: Include font.h. Define syms_of_w32font and
1933 globals_of_w32font.
1934
1935 * process.c: Include TERM_HEADER instead of listing all possible
1936 window-system headers.
1937
1938 * nsterm.h: Remove declarations now in frame.h.
1939 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
1940
1941 * menu.c: Include TERM_HEADER instead of listing all possible
1942 window-system headers.
1943
1944 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1945 window system.
1946
1947 * keyboard.c: Include TERM_HEADER instead of listing all possible
1948 window-system headers.
1949
1950 * image.c: Include TERM_HEADER instead of listing all possible
1951 window-system headers. Declare Vlibrary_cache when compiling for
1952 Windows.
1953
1954 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1955 window system declarations.
1956
1957 * frame.h: Move common functions here: set_frame_menubar,
1958 x_set_window_size, x_sync, x_get_focus_frame,
1959 x_set_mouse_position, x_set_mouse_pixel_position,
1960 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1961 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1962 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1963 x_activate_menubar, x_real_positions, x_bitmap_icon,
1964 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1965 and x_query_colors.
1966
1967 * frame.c: Include TERM_HEADER instead of listing all possible
1968 window-system headers.
1969
1970 * font.c: Include TERM_HEADER instead of listing all possible
1971 window-system headers.
1972
1973 * emacs.c: Include TERM_HEADER.
1974
1975 * dispnew.c: Include TERM_HEADER instead of listing all possible
1976 window-system headers.
1977
1978 * ccl.h: Include character.h.
1979
1980 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1981 the current window system; include in list of objects to link into
1982 Emacs.
1983
19842012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1985
1986 Remove mark_ttys function and fix tty_display_info initialization.
1987 * lisp.h (mark_ttys): Remove prototype.
1988 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1989 to mark_ttys because all possible values of 'top_frame' slot are
1990 the frames which are reachable from Vframe_list.
1991 * term.c (mark_ttys): Remove.
1992 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1993
19942012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1995
1996 Change struct frame bitfields from unsigned char to unsigned.
1997 * frame.h (struct frame): Change type of 'display_preempted',
1998 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1999 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2000 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2001 bitfields from unsigned char to unsigned.
2002
20032012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2004
2005 Remove unused member of struct x_output and struct w32_output.
2006 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2007 * w32term.h (struct w32_output): Likewise.
2008
20092012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2010
2011 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2012 does not become zero (Bug#12234).
2013
20142012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2015
2016 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2017 for GCC 4.7.1 x86-64.
2018
20192012-08-30 Glenn Morris <rgm@gnu.org>
2020
2021 * lread.c (init_lread): For out-of-tree builds, only add the
2022 source directory's site-lisp dir to the load-path if it exists,
2023 consistent with in-tree builds. (Bug#12302)
2024
20252012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2026
2027 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2028 button_values to NULL. Call setStykeMask so dialogs get a close button.
2029 (windowShouldClose:): Set window_closed.
2030 (dealloc): New member, free button_values.
2031 (process_dialog:): Make member function. Remove window argument,
2032 replace window with self. Count buttons and allocate and store values
2033 in button_values.
2034 (addButton:value:row:): value is int with the name tag. Call setTag
2035 with tag. Remove return self, declare return value as void.
2036 (addString:row:): Remove return self, declare return value as void.
2037 (addSplit): Remove return self, declare return value as void.
2038 (clicked:): Remove return self, declare return value as void.
2039 Set dialog_return to button_values[seltag]. Code formatting change.
2040 (initFromContents:isQuestion:): Adjust call to process_dialog.
2041 Code formatting change.
2042 (timeout_handler:): Set timer_fired to YES.
2043 (runDialogAt:): Set timer_fired to NO.
2044 Handle click on close button as quit.
2045
2046 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2047 Add window_closed and button_values. Add void as return value for
2048 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2049 Add process_dialog as new member.
2050
20512012-08-28 Eli Zaretskii <eliz@gnu.org>
2052
2053 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2054 is not one of the heaps we manage. (Bug#12242)
2055
20562012-08-28 Glenn Morris <rgm@gnu.org>
2057
2058 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2059
20602012-08-28 Martin Rudalics <rudalics@gmx.at>
2061
2062 * window.c (Fset_window_configuration): Remove handling of
2063 auto-buffer-name window parameter. Install revision of reverted
2064 fix.
2065
20662012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2067
2068 Do not allow to set major mode for a dead buffer.
2069 * buffer.c (Fset_buffer_major_mode): Signal an error
2070 if the buffer is dead.
2071 (Fother_buffer, other_buffer_safely): Remove redundant
2072 nested declaration.
2073
20742012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2075
2076 Always use set_buffer_if_live to restore original buffer at unwind.
2077 * buffer.h (record_unwind_current_buffer): New function.
2078 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2079 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2080 * undo.c, window.c: Adjust users.
2081 * buffer.c (set_buffer_if_live): Fix comment.
2082
20832012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2084
2085 Fix usage of set_buffer_internal.
2086 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2087 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2088 * coding.c (decode_coding): Omit redundant test.
2089 * fileio.c (decide_coding_unwind): Likewise.
2090 * fns.c (secure_hash): Likewise.
2091 * insdel.c (modify_region): Likewise.
2092 * keyboard.c (command_loop_1): Likewise.
2093 * print.c (PRINTFINISH): Likewise.
2094 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2095
20962012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2097
2098 * dispnew.c: Use bool for boolean.
2099 (frame_garbaged, display_completed, delayed_size_change)
2100 (fonts_changed_p, add_window_display_history)
2101 (add_frame_display_history, verify_row_hash)
2102 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2103 (row_equal_p, realloc_glyph_pool)
2104 (allocate_matrices_for_frame_redisplay)
2105 (showing_window_margins_p)
2106 (adjust_frame_glyphs_for_frame_redisplay)
2107 (build_frame_matrix_from_leaf_window, make_current)
2108 (mirrored_line_dance, mirror_line_dance, update_frame)
2109 (update_window_tree, update_single_window)
2110 (check_current_matrix_flags, update_window, update_text_area)
2111 (update_window_line, set_window_update_flags, scrolling_window)
2112 (update_frame_1, scrolling, buffer_posn_from_coords)
2113 (do_pending_window_change, change_frame_size)
2114 (change_frame_size_1, sit_for):
2115 Use bool for boolean.
2116 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2117 and remove last int (actually boolean) argument, which was always 0.
2118 All callers changed.
2119 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2120 * dispextern.h (struct composition_it): Use bool for boolean.
2121 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2122 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2123 * dired.c (file_name_completion):
2124 Use bool for boolean. (This was missed in an earlier change.)
2125
21262012-08-27 Martin Rudalics <rudalics@gmx.at>
2127
2128 * window.c (Fset_window_configuration): Revert first part of
2129 last change.
2130
21312012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2132
2133 * nsterm.h (NSPanel): New class variable dialog_return.
2134
2135 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2136 Initialize dialog_return.
2137 (windowShouldClose:): Use stop instead of stopModalWithCode.
2138 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2139 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2140 event.
2141 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2142 modal loop returns.
2143
21442012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2145
2146 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2147 * composite.c (find_composition, composition_gstring_p)
2148 (composition_reseat_it, find_automatic_composition):
2149 * data.c (let_shadows_buffer_binding_p)
2150 (let_shadows_global_binding_p, set_internal, make_blv)
2151 (Fmake_variable_buffer_local, Fmake_local_variable)
2152 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2153 (cons_to_signed, arith_driver):
2154 * dbusbind.c (xd_in_read_queued_messages):
2155 * dired.c (directory_files_internal, file_name_completion):
2156 Use bool for booleans.
2157 * dired.c (file_name_completion):
2158 * process.h (fd_callback):
2159 Omit int (actually boolean) argument. It wasn't being used.
2160 All uses changed.
2161 * composite.h, lisp.h: Reflect above API changes.
2162
2163 * cmds.c, coding.c: Use bool for booleans.
2164 * cmds.c (move_point, Fself_insert_command):
2165 * coding.h (struct composition status, struct coding_system):
2166 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2167 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2168 (emacs_mule_char, decode_coding_emacs_mule)
2169 (encode_coding_emacs_mule, detect_coding_iso_2022)
2170 (decode_coding_iso_2022, encode_invocation_designation)
2171 (encode_designation_at_bol, encode_coding_iso_2022)
2172 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2173 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2174 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2175 (encode_coding_raw_text, detect_coding_charset)
2176 (decode_coding_charset, encode_coding_charset, detect_eol)
2177 (detect_coding, get_translation_table, produce_chars)
2178 (consume_chars, reused_workbuf_in_use)
2179 (make_conversion_work_buffer, code_conversion_save)
2180 (decode_coding_object, encode_coding_object)
2181 (detect_coding_system, char_encodable_p)
2182 (Funencodable_char_position, code_convert_region)
2183 (code_convert_string, code_convert_string_norecord)
2184 (Fset_coding_system_priority):
2185 * fileio.c (Finsert_file_contents):
2186 Use bool for booleans.
2187 * coding.h, lisp.h: Reflect above API changes.
2188 * coding.c: Remove unnecessary static function decls.
2189 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2190 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2191 not a boolean 'int', since callers never look at the return value.
2192 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2193 * coding.h (decoding_buffer_size, encoding_buffer_size)
2194 (emacs_mule_string_char): Remove unused extern decls.
2195 (struct iso_2022_spec, struct coding_system):
2196 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2197 (struct emacs_mule_spec): Remove unused field 'full_support'.
2198 All initializations removed.
2199 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2200
22012012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2202
2203 Fix spare memory change (Bug#12286).
2204 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2205 (valid_lisp_object_p): Likewise.
2206
22072012-08-27 Martin Rudalics <rudalics@gmx.at>
2208
2209 * window.c (Fset_window_configuration): Record any window's old
2210 buffer if it's replaced (see Bug#8789). If the new current
2211 buffer doesn't appear in the selected window, go to its old
2212 point (Bug#12208).
2213
22142012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2215
2216 Special MEM_TYPE_SPARE to denote reserved memory.
2217 * alloc.c (enum mem_type): New memory type.
2218 (refill_memory_reserve): Use new type for spare memory.
2219 This prevents live_cons_p and live_string_p from incorrect
2220 detection of uninitialized objects from spare memory as live.
2221
22222012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2223
2224 Spelling fixes.
2225 * Makefile.in (.PHONY): versioclean -> versionclean.
2226
2227 Remove unused external symbols.
2228 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2229 * window.c (Qwindow_valid_p, decode_valid_window):
2230 Now static, not extern.
2231 * data.c (Qinterval): Remove; unused.
2232 (syms_of_data): Do not define 'interval'.
2233 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2234 * window.h (decode_valid_window):
2235 Remove decls.
2236
2237 * character.c, charset.c, chartab.c: Use bool for booleans.
2238 * character.c (lisp_string_width, string_count_byte8)
2239 (string_escape_byte8):
2240 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2241 (load_charset_map_from_file, map_charset_chars)
2242 (Fdefine_charset_internal, define_charset_internal)
2243 (Fdeclare_equiv_charset, find_charsets_in_text)
2244 (Ffind_charset_region, char_charset, Fiso_charset):
2245 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2246 (sub_char_table_set, sub_char_table_set_range)
2247 (char_table_set_range, optimize_sub_char_table)
2248 (map_sub_char_table):
2249 Use bool for boolean.
2250 * character.c (str_to_unibyte): Omit last boolean argument; it was
2251 always 0. All callers changed.
2252 * character.h, charset.h: Adjust to match previous changes.
2253 * character.h (char_printable_p): Remove decl of nonexistent function.
2254 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2255 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2256 are all boolean, so make them single-bit bitfields.
2257
2258 * lisp.h (ASET): Remove attempt to detect side effects.
2259 It was meant to be temporary and it often doesn't work,
2260 because when IDX has side effects the behavior of IDX==IDX
2261 is undefined. See Stefan Monnier in
2262 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2263
22642012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2265
2266 * lisp.h (functionp): New function (extracted from Ffunctionp).
2267 (FUNCTIONP): Use it.
2268 * eval.c (Ffunctionp): Use it.
2269
22702012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2271
2272 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2273 as that's faster and simpler than static storage. Don't bother
2274 with the g_main_context_query overhead if g_main_context_pending
2275 says no events are pending.
2276 (gfds, gfds_size): Remove these static vars.
2277 (xgselect_initialize): Remove; no longer needed.
2278 All uses and decls removed.
2279
2280 * emacs.c (fatal_error_signal_hook): Remove.
2281 All uses removed. This leftover from old code was always 0.
2282
2283 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2284 * casefiddle.c (casify_object, casify_region):
2285 * casetab.c (set_case_table):
2286 * category.c, category.h (word_boundary_p):
2287 * category.h (CHAR_HAS_CATEGORY):
2288 Use bool for booleans, instead of int.
2289
22902012-08-25 Eli Zaretskii <eliz@gnu.org>
2291
2292 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2293
22942012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2295
2296 On assertion failure, print backtrace if available.
2297 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2298 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2299 * Makefile.in (LIB_EXECINFO): New macro.
2300 (LIBES): Use it.
2301
2302 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2303 * bytecode.c (exec_byte_code):
2304 * callint.c (check_mark, Fcall_interactively):
2305 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2306 (getenv_internal, sync_process_alive, call_process_exited):
2307 * lisp.h (USE_SAFE_ALLOCA):
2308 Use bool for booleans, instead of int.
2309 * lisp.h, process.h: Adjust prototypes to match above changes.
2310 * callint.c (Fcall_interactively): Don't assume the mark's
2311 offset fits in 'int'.
2312
23132012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2314
2315 * buffer.c, buffer.h: Use bool for boolean.
2316 * buffer.c (reset_buffer_local_variables)
2317 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2318 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2319 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2320 (overlay_touches_p, overlay_strings, Foverlay_put)
2321 (report_overlay_modification, call_overlay_mod_hooks):
2322 (mmap_enlarge, mmap_set_vars):
2323 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2324 Use bool for booleans, instead of int.
2325 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2326 since the 1-or-0 return value is always ignored anyway.
2327 (mmap_initialized_p):
2328 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2329 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2330
23312012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2332
2333 * bidi.c: Use bool for boolean.
2334 This is a bit more readable, and makes the text segment of bidi.o
2335 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2336 Presumably it's faster too.
2337 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2338 Now bool.
2339 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2340 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2341 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2342 (bidi_explicit_dir_char, bidi_level_of_next_char)
2343 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2344 Use bool for booleans, instead of int.
2345 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2346 (bidi_unshelve_cache): Adjust decls to match code.
2347
23482012-08-23 Martin Rudalics <rudalics@gmx.at>
2349
2350 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2351 argument.
2352
23532012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2354
2355 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2356 * atimer.h: Include <stdbool.h>.
2357
23582012-08-22 Dan Nicolaescu <dann@gnu.org>
2359
2360 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2361 compile time tests instead of run time tests on systems that do
2362 not use them.
2363 (FRAME_MAC_P): Remove leftover from deleted code.
2364 * frame.c (syms_of_frame): Remove leftover from deleted code.
2365
23662012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2367
2368 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2369
23702012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2371
2372 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2373 Otherwise, the compiler complains about (A?B:C) where B is void
2374 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2375 (fontset_add): Return void, for FONTSET_ADD.
2376
23772012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2378
2379 * alloc.c: Use bool for booleans.
2380 (gc_in_progress, abort_on_gc)
2381 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2382 (dont_register_blocks) [GC_MALLOC_CHECK]:
2383 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2384 (check_string_bytes, make_specified_string, memory_full)
2385 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2386 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2387 (mark_stack, valid_pointer_p, make_pure_string)
2388 (Fgarbage_collect, survives_gc_p, gc_sweep):
2389 Use bool for booleans, instead of int.
2390 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2391 Remove unused local.
2392 * alloc.c (PURE_POINTER_P):
2393 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2394 * editfns.c (Fformat):
2395 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2396 (Fdo_auto_save):
2397 * fns.c (sweep_weak_table):
2398 * lisp.h (suppress_checking, push_message, survives_gc_p)
2399 (make_pure_string, gc_in_progress, abort_on_gc):
2400 * lread.c (readchar, read1):
2401 * print.c (Fprin1_to_string):
2402 * xdisp.c (push_message):
2403 Use bool for booleans affected directly or indirectly by
2404 alloc.c's changes.
2405
2406 Make recently-introduced setters macros.
2407 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2408 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2409 (set_fontset_default, set_fontset_fallback): Rename from their
2410 upper-case counterparts, and make them functions rather than macros.
2411 This is more consistent with the other recently-introduced setters.
2412 These don't need to be inline, since they're local.
2413
24142012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2415
2416 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2417 the loop (Bug#12247).
2418
24192012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2420
2421 * lisp.h (vcopy): Use memcpy rather than our own loop.
2422 This fixes a performance regression introduced by the recent
2423 addition of vcopy. This means 'vcopy' will need to be modified
2424 for a copying collector, but that's OK. Also, tighten the
2425 checking in the assertion.
2426
24272012-08-21 Eli Zaretskii <eliz@gnu.org>
2428
2429 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2430 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2431 non-base glyph for the width of the base character, according to
2432 what x_draw_composite_glyph_string_foreground expects.
2433 Generate WADJUST value according to composition_gstring_width's
2434 expectations, to produce correct width of the composed character.
2435 Reverse the sign of the DU offset produced by ScriptPlace.
2436
24372012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2438
2439 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2440
24412012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2442
2443 Avoid direct writes to contents member of struct Lisp_Vector.
2444 * lisp.h (vcopy): New function to copy data into vector.
2445 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2446 * fns.c (Ffillarray): Use ASET.
2447 * keyboard.c (timer_check_2): Use AREF and ASET.
2448 (append_tool_bar_item, Frecent_keys): Use vcopy.
2449 * lread.c (read_vector): Use ASET.
2450 * msdos.c (Frecent_doskeys): Use vcopy.
2451 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2452 (Finternal_merge_in_global_face): Use ASET and vcopy.
2453 * xfont.c (xfont_list_pattern): Likewise.
2454
24552012-08-21 Martin Rudalics <rudalics@gmx.at>
2456
2457 * window.c (Fwindow_point): For the selected window always return
2458 the position of its buffer's point.
2459 (Fset_window_point): For the selected window always go in its
2460 buffer to the specified position.
2461
24622012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2463
2464 Setter macros for fontsets.
2465 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2466 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2467 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2468 Adjust users.
2469
24702012-08-20 Glenn Morris <rgm@gnu.org>
2471
2472 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2473 Don't assume that `ln -f' works.
2474
24752012-08-20 Eli Zaretskii <eliz@gnu.org>
2476
2477 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2478 and later about non-assignments with no effect. See discussion at
2479 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2480 details.
2481
24822012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2483
2484 Inline setter functions for Lisp_Objects slots of struct specbinding.
2485 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2486 Adjust users.
2487
24882012-08-20 Martin Rudalics <rudalics@gmx.at>
2489
2490 * window.c (select_window): Always make selected window's buffer
2491 current.
2492
24932012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2494
2495 Use AREF and ASET for docstrings of category tables.
2496 * category.h (CATEGORY_DOCSTRING): Use AREF.
2497 (SET_CATEGORY_DOCSTRING): Use ASET.
2498 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2499
25002012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2501
2502 Inline setter functions for hash table members.
2503 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2504 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2505 (set_hash_key_and_value, set_hash_index, set_hash_next)
2506 (set_hash_hash): New functions.
2507 * charset.c, fns.c: Adjust users.
2508
25092012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2510
2511 Inline getter and setter functions for per-buffer values.
2512 * buffer.h (per_buffer_default, set_per_buffer_default)
2513 (per_buffer_value, set_per_buffer_value): New functions.
2514 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2515 * buffer.c, data.c: Adjust users.
2516
25172012-08-20 Juanma Barranquero <lekktu@gmail.com>
2518
2519 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2520
25212012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2522
2523 Rely on <config.h> + <unistd.h> to declare 'environ',
2524 as gnulib does this if the system doesn't.
2525 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2526 Remove declaration. MS-Windows declares it on stdlib.h which is
2527 included by conf_post.h.
2528 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2529 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2530 * vm-limit.c: Include <unistd.h>, for 'environ'.
2531
2532 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2533 (start_of_data): Remove decl; mem-limits.h provides it.
2534
2535 * xdisp.c (handle_invisible_prop): Make it a bit faster
2536 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2537
25382012-08-19 Chong Yidong <cyd@gnu.org>
2539
2540 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2541 ends (Bug#3874).
2542
25432012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2544
2545 * .gdbinit: Use call instead of set when calling a function in the
2546 inferior.
2547
2548 * data.c (set_internal): Don't use set_blv_found.
2549 (Fkill_local_variable): Likewise.
2550
25512012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2552
2553 * nsfont.m (ns_ascii_average_width): Ensure the string
2554 ascii_printable is initialized with a null-terminated character
2555 array. Otherwise, it can contain undesired extra characters.
2556
25572012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2558
2559 port new setting code to Sun C 5.8 2005/10/13
2560 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2561 Return void, not Lisp_Object. Otherwise, the compiler
2562 complains about (A?B:C) where B is void and C is Lisp_Object
2563 when compiling CHAR_TABLE_SET, due to the recent change to
2564 the API of sub_char_table_set_contents.
2565
25662012-08-18 Chong Yidong <cyd@gnu.org>
2567
2568 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2569 for the string case (Bug#3874).
2570
25712012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2572
2573 * buffer.h (BSET): Remove (Bug#12215).
2574 Replace all uses with calls to new setter functions.
2575 (bset_bidi_paragraph_direction, bset_case_canon_table)
2576 (bset_case_eqv_table, bset_directory, bset_display_count)
2577 (bset_display_time, bset_downcase_table)
2578 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2579 (bset_last_selected_window, bset_local_var_alist)
2580 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2581 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2582 (bset_width_table):
2583 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2584 (bset_auto_fill_function, bset_auto_save_file_format)
2585 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2586 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2587 (bset_cache_long_line_scans, bset_case_fold_search)
2588 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2589 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2590 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2591 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2592 (bset_header_line_format, bset_indicate_buffer_boundaries)
2593 (bset_indicate_empty_lines, bset_invisibility_spec)
2594 (bset_left_fringe_width, bset_major_mode, bset_mark)
2595 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2596 (bset_name, bset_overwrite_mode, bset_pt_marker)
2597 (bset_right_fringe_width, bset_save_length)
2598 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2599 (bset_scroll_up_aggressively, bset_selective_display)
2600 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2601 (bset_word_wrap, bset_zv_marker):
2602 * category.c (bset_category_table):
2603 * syntax.c (bset_syntax_table):
2604 New setter functions.
2605
2606 * process.h (PSET): Remove (Bug#12215).
2607 Replace all uses with calls to new setter functions.
2608 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2609 (PROCESS_INLINE): New macro.
2610 (pset_childp): New setter function.
2611 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2612 * process.c (PROCESS_INLINE):
2613 Define to EXTERN_INLINE, so that the corresponding functions
2614 are compiled into code.
2615 (pset_buffer, pset_command, pset_decode_coding_system)
2616 (pset_decoding_buf, pset_encode_coding_system)
2617 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2618 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2619 (pset_type, pset_write_queue): New setter functions.
2620
2621 * window.h (WSET): Remove (Bug#12215).
2622 Replace all uses with calls to new setter functions.
2623 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2624 (WINDOW_INLINE): New macro.
2625 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2626 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2627 (wset_total_lines, wset_vertical_scroll_bar)
2628 (wset_window_end_pos, wset_window_end_valid)
2629 (wset_window_end_vpos): New setter functions.
2630 * window.c (WINDOW_INLINE):
2631 Define to EXTERN_INLINE, so that the corresponding functions
2632 are compiled into code.
2633 (wset_combination_limit, wset_dedicated, wset_display_table)
2634 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2635 (wset_new_normal, wset_new_total, wset_next_buffers)
2636 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2637 (wset_prev_buffers, wset_right_fringe_width)
2638 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2639 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2640 (wset_window_parameters):
2641 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2642 (wset_column_number_displayed, wset_region_showing):
2643 New setter functions.
2644
2645 * termhooks.h (TSET): Remove (Bug#12215).
2646 Replace all uses with calls to new setter functions.
2647 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2648 (TERMHOOKS_INLINE): New macro.
2649 (tset_charset_list, tset_selection_alist): New setter functions.
2650 * terminal.c (TERMHOOKS_INLINE):
2651 Define to EXTERN_INLINE, so that the corresponding functions
2652 are compiled into code.
2653 (tset_param_alist): New setter function.
2654
26552012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2656
2657 * keyboard.h (KSET): Remove (Bug#12215).
2658 Replace all uses with calls to new setter functions.
2659 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2660 (KEYBOARD_INLINE): New macro.
2661 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2662 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2663 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2664 New setter functions.
2665 * keyboard.c (KEYBOARD_INLINE):
2666 Define to EXTERN_INLINE, so that the corresponding functions
2667 are compiled into code.
2668 (kset_echo_string, kset_kbd_queue)
2669 (kset_keyboard_translate_table, kset_last_prefix_arg)
2670 (kset_last_repeatable_command, kset_local_function_key_map)
2671 (kset_overriding_terminal_local_map, kset_real_last_command)
2672 (kset_system_key_syms): New setter functions.
2673
2674 * frame.h (FSET): Remove (Bug#12215).
2675 Replace all uses with calls to new setter functions.
2676 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2677 (FRAME_INLINE): New macro.
2678 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2679 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2680 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2681 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2682 (fset_param_alist, fset_root_window, fset_scroll_bars)
2683 (fset_selected_window, fset_title, fset_tool_bar_items)
2684 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2685 * frame.c (FRAME_INLINE):
2686 Define to EXTERN_INLINE, so that the corresponding functions
2687 are compiled into code.
2688 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2689
2690 A few more naming-convention fixes for getters and setters.
2691 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2692 and rename from buffer_overlays_set_before.
2693 (set_buffer_overlays_after): Move here from buffer.h, and rename
2694 from buffer_overlays_set_after.
2695 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2696 All uses changed.
2697 (set_buffer_intervals): Rename from buffer_set_intervals.
2698 * intervals.c (set_interval_object): Move here from intervals.h,
2699 and rename from interval_set_object.
2700 (set_interval_left): Move here from intervals.h, and rename from
2701 interval_set_left.
2702 (set_interval_right): Move here from intervals.h, and rename from
2703 interval_set_right.
2704 (copy_interval_parent): Move here from intervals.h, and rename from
2705 interval_copy_parent.
2706 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2707 (set_interval_plist): Rename from interval_set_plist.
2708 Return void, not Lisp_Object, since no caller uses the result.
2709 * lisp.h (string_intervals): Rename from string_get_intervals.
2710 (set_string_intervals): Rename from string_set_intervals.
2711
2712 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2713 (set_char_table_contents): Rename from char_table_set_contents.
2714 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2715 All uses changed. See the end of
2716 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2717
2718 * lisp.h (CSET): Remove (Bug#12215).
2719 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2720 (set_char_table_purpose): New functions,
2721 replacing CSET. All uses changed. For example, replace
2722 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2723 "set_char_table_parent (char_table, parent);".
2724 The old version was confusing because it used the same name
2725 'parent' for two different things.
2726
27272012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2728
2729 Functions to get and set Lisp_Object fields of buffer-local variables.
2730 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2731 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2732 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2733 * data.c, eval.c, frame.c: Adjust users.
2734
27352012-08-17 Chong Yidong <cyd@gnu.org>
2736
2737 * xfaces.c (merge_face_vectors): If the target font specfies a
2738 font spec, make the font's attributes take precedence over
2739 directly-specified attributes.
2740 (merge_face_ref): Recognize :font.
2741
27422012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2743
2744 Do not use memcpy for copying intervals.
2745 * intervals.c (reproduce_interval): New function.
2746 (reproduce_tree, reproduce_tree_obj): Use it.
2747 (reproduce_tree_obj): Remove prototype.
2748
27492012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2750
2751 * lisp.h (duration_to_sec_usec): Remove unused decl.
2752
27532012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2754
2755 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2756 to an allocated instance of NSString, not to the class itself.
2757
27582012-08-17 Juanma Barranquero <lekktu@gmail.com>
2759
2760 * makefile.w32-in (C_CTYPE_H): New macro.
2761 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2762 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2763 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2764
27652012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2766
2767 Use ASCII tests for character types.
2768 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2769 * xfns.c, xterm.c:
2770 Don't include <ctype.h>; was not needed.
2771 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2772 * sysdep.c, xfaces.c:
2773 Include <c-ctype.h> instead of <ctype.h>.
2774 * nsterm.m: Include <c-ctype.h>.
2775 * charset.c (read_hex):
2776 * doc.c (Fsnarf_documentation):
2777 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2778 (DRIVE_LETTER) [DOS_NT]:
2779 (Ffile_name_directory, Fexpand_file_name)
2780 (Fsubstitute_in_file_name):
2781 * font.c (font_parse_xlfd, font_parse_fcname):
2782 * frame.c (x_set_font_backend):
2783 * gtkutil.c (xg_get_font):
2784 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2785 * nsimage.m (hexchar):
2786 * nsterm.m (ns_xlfd_to_fontname):
2787 * sysdep.c (system_process_attributes):
2788 * xfaces.c (hash_string_case_insensitive):
2789 Use C-locale tests instead of locale-specific tests for character
2790 types, since we want the ASCII interpretation here, not the
2791 interpretation suitable for whatever happens to be the current locale.
2792
27932012-08-16 Martin Rudalics <rudalics@gmx.at>
2794
2795 Consistently check windows for validity/liveness
2796 (Bug#11984, Bug#12025, Bug#12026).
2797 * lisp.h (CHECK_VALID_WINDOW): New macro.
2798 * window.c (decode_window): Rename to decode_live_window.
2799 (decode_valid_window, Fwindow_valid_p): New functions.
2800 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2801 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2802 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2803 (Fwindow_prev_sibling, Fwindow_combination_limit)
2804 (Fset_window_combination_limit, Fwindow_use_time)
2805 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2806 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2807 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2808 (Fwindow_hscroll, Fset_window_hscroll)
2809 (Fwindow_redisplay_end_trigger)
2810 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2811 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2812 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2813 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2814 (Fwindow_end, Fset_window_point, Fset_window_start)
2815 (Fpos_visible_in_window_p, Fwindow_line_height)
2816 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2817 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2818 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2819 (Fset_window_parameter, Fwindow_display_table)
2820 (Fset_window_display_table, Fdelete_other_windows_internal)
2821 (Fset_window_buffer, Fset_window_new_total)
2822 (Fset_window_new_normal, Fdelete_window_internal)
2823 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2824 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2825 (Fwindow_scroll_bars): Check whether argument window is a valid or
2826 live window. Update doc-strings.
2827 (syms_of_window): New symbol Qwindow_valid_p.
2828 * keyboard.c (Fposn_at_x_y): Check whether argument
2829 frame_or_window denotes a valid window.
2830
28312012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2832
2833 Fix previous char table change.
2834 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2835 * chartab.c (optimize_sub_char_table): Likewise.
2836
28372012-08-16 Chong Yidong <cyd@gnu.org>
2838
2839 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2840
2841 * xfont.c (xfont_open):
2842 * xftfont.c (xftfont_open): Set the font's max_width field.
2843
2844 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2845 min_width to space_width and average_width to the average over
2846 printable ASCII characters.
2847 (ns_char_width): Code cleanup.
2848 (ns_ascii_average_width): New utility function.
2849
2850 * font.h (struct font): Update comments.
2851
28522012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2853
2854 Simple interface to set Lisp_Object fields of character tables.
2855 * lisp.h (CSET): New macro.
2856 (char_table_set_extras, char_table_set_contents)
2857 (sub_char_table_set_contents): New function.
2858 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2859 * syntax.c: Adjust users.
2860
28612012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2862
2863 * eval.c (eval_sub): Bind lexical-binding.
2864 * lread.c (Qlexical_binding): Make non-static.
2865
28662012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2867
2868 * nsmenu.m (popupSession): Remove.
2869 (pop_down_menu): Remove endModalSession.
2870 (timeout_handler:): New method.
2871 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2872 Call runModalForWindow. Check timer_fired when it returns.
2873 If not set, cancel timer and break out of loop.
2874 Otherwise loop again, with a new timeout.
2875
2876 * nsterm.m: Include fcntl.h if present.
2877 (fd_entry, t_readfds, inNsSelect): Remove.
2878 (select_writefds, select_valid, select_timeout, selfds)
2879 (select_mutex, apploopnr): Add.
2880 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2881 Otherwise call kbd_buffer_store_event.
2882 (ns_send_appdefined): Remove release of fd_entry.
2883 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2884 Increment and decrement apploopnr.
2885 (ns_select): If no file descriptors, just do a NSTimer.
2886 Otherwise copy read/write masks and start select thread (fd_handler).
2887 Start main loop and wait for application defined event.
2888 Inform select thread to stop selecting after main loop is exited.
2889 (ns_term_init): Create selfds pipe and set non-blocking.
2890 Initialize select_mutex. Start the select thread (fd_handler).
2891 (fd_handler:): Loop forever, wait for info from the main thread
2892 to either start or stop selecting. When select returns, send
2893 and appdefined event.
2894 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2895 If not call kbd_buffer_store_event.
2896
2897 * nsterm.h (EmacsApp): fd_handler takes id argument.
2898 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2899
2900 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2901
29022012-08-15 Eli Zaretskii <eliz@gnu.org>
2903
2904 * region-cache.c (move_cache_gap): Update gap_len using the actual
2905 growth of the boundaries array. Do not change cache_len.
2906 (Bug#12196)
2907
29082012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2909
2910 Generalize and cleanup font subsystem checks.
2911 * font.h (FONT_DEBUG, font_assert): Remove.
2912 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2913 Change font_assert to eassert. Use eassert where appropriate.
2914
29152012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2916
2917 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2918
29192012-08-15 Chong Yidong <cyd@gnu.org>
2920
2921 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2922 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2923 extract the font descriptor instead of just the font name.
2924 In that case, return a font spec instead of a string.
2925 (x_last_font_name): Move to this file from xfns.c.
2926
2927 * xfns.c (Fx_select_font): The return value can also be a font
2928 spec. Move x_last_font_name management to gtkutil.c.
2929
2930 * xfaces.c: Make font weight and style symbols non-static.
2931
29322012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2933
2934 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2935 (bug#12117).
2936
29372012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2938
2939 * alloc.c (Fgarbage_collect): Use plural form consistently.
2940
29412012-08-14 Eli Zaretskii <eliz@gnu.org>
2942
2943 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2944 iteration through the command loop. Fixes a problem whereby mouse
2945 movements are ignored until the first mouse click.
2946
29472012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2948
2949 Use bool, not int, for Lisp booleans.
2950 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2951 makes Emacs a bit smaller and presumably a bit faster.
2952 * lisp.h: Include <stdbool.h>.
2953 (struct Lisp_Boolfwd, defvar_bool):
2954 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2955 * regex.c [!emacs]: Include <stdbool.h>.
2956 (false, true): Remove; <stdbool.h> does this for us now.
2957
29582012-08-14 Chong Yidong <cyd@gnu.org>
2959
2960 * character.c (Fcharacterp): Doc fix (Bug#12076).
2961
2962 * data.c (Findirect_variable): Doc fix (Bug#11040).
2963
2964 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2965
2966 * editfns.c (Fformat): Doc fix (Bug#12059).
2967 (Fsave_current_buffer): Doc fix (Bug#11542).
2968
29692012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2970
2971 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2972 (bug#12022).
2973
29742012-08-14 Martin Rudalics <rudalics@gmx.at>
2975
2976 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2977 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2978 * minibuf.c (choose_minibuf_frame, read_minibuf):
2979 * w32fns.c (x_create_tip_frame):
2980 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2981 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2982
29832012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2984
2985 * intervals.c (offset_intervals): Remove obsolete comment.
2986
29872012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2988
2989 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2990
29912012-08-14 Gergely Risko <gergely@risko.hu>
2992
2993 * coding.c (decode_coding): Record buffer modification before
2994 disabling undo_list (Bug#11773).
2995
29962012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2997
2998 Revert and cleanup some recent overlay changes.
2999 * buffer.h (enum overlay_type): Remove.
3000 (buffer_get_overlays, buffer_set_overlays): Likewise.
3001 (buffer_set_overlays_before, buffer_set_overlays_after):
3002 New function. Adjust users.
3003 (unchain_both): Add eassert.
3004
30052012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3006
3007 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3008
30092012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3010
3011 * gtkutil.c (xg_mark_data): Don't assume C99.
3012
30132012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3014
3015 * gtkutil.c (xg_frame_tb_info): New struct.
3016 (TB_INFO_KEY): New define.
3017 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3018 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3019 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3020 if not present.
3021 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3022 is up to date. Otherwise store new data.
3023 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3024
30252012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3026
3027 Use KSET for write access to Lisp_Object members of struct kboard.
3028 * keyboard.h (KSET): New macro.
3029 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3030 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3031 * xterm.c: Adjust users.
3032
30332012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3034
3035 Use BSET for write access to Lisp_Object members of struct buffer.
3036 * buffer.h (BSET): New macro.
3037 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3038 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3039 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3040 * window.c, xdisp.c, xfns.c: Adjust users.
3041
30422012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3043
3044 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3045
30462012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3047
3048 * nsterm.m (not_in_argv): New function.
3049 (application:openFile, application:openTempFile:):
3050 (application:openFileWithoutUI:, application:openFiles:): Open file
3051 if not_in_argv returns non-zero (bug#12171).
3052
3053 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3054 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3055 Define for Gtk+ versions less than 3.2.
3056 (xg_get_font_name): Use those functions/macros here.
3057 Reported by Frans Oilinki <moilinki@gmail.com>.
3058
30592012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3060
3061 * unexmacosx.c (copy_data_segment): Copy initialized data in
3062 statically linked libraries from input file rather than memory.
3063
3064 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3065 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3066 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3067
30682012-08-10 Glenn Morris <rgm@gnu.org>
3069
3070 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3071 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3072
30732012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3074
3075 Fix last change to allow compilation with low optimization levels.
3076 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3077 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3078
30792012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3080
3081 Use common inline syntax in intervals.h.
3082 * intervals.h (INTERVALS_INLINE): New macro.
3083 Change all users from LISP_INLINE.
3084
30852012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3086
3087 Define Qnone once for all platforms.
3088 * frame.c (Qnone): Define here.
3089 (syms_of_frame): DEFSYM it.
3090 * lisp.h (Qnone): New declaration.
3091 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3092 * xfns.c: Remove duplication. Adjust users.
3093
30942012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3095
3096 Remove unused macros from intervals.h.
3097 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3098 * intervals.c: Adjust comment.
3099
31002012-08-10 Eli Zaretskii <eliz@gnu.org>
3101
3102 * w32fns.c <w32_unicode_gui>: New static variable.
3103 (globals_of_w32fns): Initialize it according to os_subtype.
3104 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3105 testing os_subtype.
3106
31072012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
3108 Eli Zaretskii <eliz@gnu.org>
3109
3110 Fix bug #10299 with Unicode characters sent by customized
3111 keyboards created by MSKLC.
3112 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3113 (w32_init_class): Use it to initialize the Emacs class with either
3114 ANSI or Unicode API calls.
3115 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3116 later.
3117 (w32_wnd_proc): If the character code sent by WM_CHAR or
3118 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3119 original message. Call DefWindowProcW on NT and later.
3120
31212012-08-10 Glenn Morris <rgm@gnu.org>
3122
3123 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3124
3125 * lisp.h (DIRECTORY_SEP): Let configure set it.
3126
31272012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3128
3129 Use TSET for write access to Lisp_Object slots of struct terminal.
3130 * termhooks.h (TSET): New macro.
3131 * coding.c, terminal.c, xselect.c: Adjust users.
3132
31332012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3134
3135 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3136 the failing expression, include them in the error message.
3137 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3138 * lisp.h (internal_condition_case_n): Update declaration.
3139
31402012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3141
3142 Inline functions to examine and change buffer overlays.
3143 * buffer.c (unchain_both): New function.
3144 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3145 (buffer_has_overlays): New function.
3146 (enum overlay_type): New enum.
3147 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3148 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3149
31502012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3151
3152 Inline functions to examine and change buffer intervals.
3153 * alloc.c (mark_interval_tree): Remove.
3154 (MARK_INTERVAL_TREE): Simplify.
3155 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3156 * intervals.c (buffer_balance_intervals): New function.
3157 (graft_intervals_into_buffer): Adjust indentation.
3158 (set_intervals_multibyte): Simplify.
3159 * buffer.h (BUF_INTERVALS): Remove.
3160 (buffer_get_intervals, buffer_set_intervals): New function.
3161 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3162 * intervals.c, textprop.c: Adjust users.
3163
31642012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3165
3166 Inline functions to examine and change string intervals.
3167 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3168 (string_get_intervals, string_set_intervals): New function.
3169 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3170 * lread.c, print.c, textprop.c: Adjust users.
3171
31722012-08-08 Glenn Morris <rgm@gnu.org>
3173
3174 * lisp.mk (lisp): Remove language/persian.elc.
3175
31762012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3177
3178 Cleanup intervals.
3179 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3180 (NULL_INTERVAL_P): Likewise. Adjust users.
3181 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3182 Adjust comment. Move under #if 0.
3183 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3184 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3185
31862012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3187
3188 Check total length of intervals with eassert.
3189 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3190 * intervals.c: Change all users to eassert.
3191
31922012-08-07 Eli Zaretskii <eliz@gnu.org>
3193
3194 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3195 Rename fields to match removal of FGET and WGET and disuse of
3196 INTERNAL_FIELD in Lisp_Cons.
3197
31982012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3199
3200 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3201 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3202 name since all xname users are fixed long time ago. Do not
3203 use INTERNAL_FIELD.
3204 (set_symbol_name, set_symbol_function, set_symbol_plist):
3205 (set_symbol_next, set_overlay_plist): New function.
3206 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3207 (struct Lisp_Overlay): Likewise.
3208 (CVAR, MVAR, SVAR): Remove.
3209 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3210 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3211 * xterm.c: Adjust users.
3212 * .gdbinit: Change to use name field of struct Lisp_Symbol
3213 where appropriate.
3214
32152012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3216
3217 Basic functions to set Lisp_Object and pointer slots of intervals.
3218 * intervals.h (interval_set_parent, interval_set_object):
3219 (interval_set_left, interval_set_right, interval_set_plist):
3220 (interval_copy_parent): New function.
3221 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
3222 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3223 Adjust indentation.
3224 (INTERVAL_SIZE): Remove. Adjust users.
3225 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3226
32272012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3228
3229 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3230 * process.h (PGET): Remove.
3231 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3232 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3233
32342012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3235
3236 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3237 * window.h (WGET): Remove.
3238 (struct window): Do not use INTERNAL_FIELD.
3239 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3240 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3241 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3242 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3243 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3244 Adjust users.
3245
32462012-08-07 Chong Yidong <cyd@gnu.org>
3247
3248 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3249 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3250 (Fdelete_window_internal): Signal an error if the window is not on
3251 a live frame (Bug#12025).
3252
32532012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3254
3255 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3256 * frame.h (FGET): Remove.
3257 (struct frame): Do not use INTERNAL_FIELD.
3258 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3259 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3260 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3261 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3262
32632012-08-06 Juanma Barranquero <lekktu@gmail.com>
3264
3265 * w32.c: Silence compiler warnings.
3266 (map_w32_filename): Remove unused variable `is_fat'.
3267 (chase_symlinks): Add parentheses around expression.
3268
32692012-08-06 Glenn Morris <rgm@gnu.org>
3270
3271 * sysdep.c: Respect BROKEN_GETWD.
3272
3273 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3274 Let configure handle it.
3275 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3276
32772012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3278
3279 Use GCALIGNMENT where appropriate.
3280 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3281 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3282 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3283
32842012-08-06 Eli Zaretskii <eliz@gnu.org>
3285
3286 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3287 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3288
32892012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3290
3291 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3292 that should be sufficient for everyone.
3293
32942012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3295
3296 * keyboard.c (timer_check_2): Add break so timer_check returns next
3297 timeout.
3298
32992012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3300
3301 Fix Windows build errors introduced after converting to WGET and WSET.
3302 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3303 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3304
33052012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3306
3307 * nsterm.m (ns_frame_rehighlight): Use FSET.
3308
3309 * nsmenu.m (ns_update_menubar): Use FSET.
3310
33112012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3312
3313 Separate read and write access to Lisp_Object slots of Lisp_Process.
3314 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3315 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3316
33172012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3318
3319 Separate read and write access to Lisp_Object slots of struct window.
3320 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3321 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3322 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3323 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3324 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3325 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3326 Adjust users.
3327
33282012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3329
3330 Fix Windows build errors introduced after converting to FGET and FSET.
3331 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3332 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3333 (w32_judge_scroll_bars): Change to use FSET.
3334 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3335
33362012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3337
3338 Fix replacement typo.
3339 * window.c (replace_window): Set root_window instead of
3340 selected_window. This fixes a total window subsystem
3341 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3342
33432012-08-06 Glenn Morris <rgm@gnu.org>
3344
3345 * lisp.mk (lisp): Add language/persian.elc.
3346
33472012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3348
3349 Separate read and write access to Lisp_Object slots of struct frame.
3350 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3351 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3352 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3353 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3354 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3355
33562012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3357
3358 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3359
33602012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3361
3362 Generalize common compile-time constants.
3363 * lisp.h (header_size, bool_header_size, word_size): Now here.
3364 (struct Lisp_Vector): Add comment.
3365 (struct Lisp_Bool_Vector): Move up to define handy constants.
3366 (VECSIZE, PSEUDOVECSIZE): Simplify.
3367 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3368 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3369 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3370 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3371 * xfont.c, xmenu.c: Use word_size where appropriate.
3372
33732012-08-05 Lawrence Mitchell <wence@gmx.li>
3374
3375 * search.c (Freplace_match): Treat \? in the replacement text
3376 literally (Bug#8161).
3377
33782012-08-05 Chong Yidong <cyd@gnu.org>
3379
3380 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3381 * frame.c (Vdelete_frame_functions):
3382 * emacs.c (Vkill_emacs_hook): Doc fix.
3383
33842012-08-04 Eli Zaretskii <eliz@gnu.org>
3385
3386 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3387 --with-x-toolkit=no builds.
3388 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3389
33902012-08-04 Chong Yidong <cyd@gnu.org>
3391
3392 * syntax.c (Fmodify_syntax_entry): Doc fix.
3393
33942012-08-04 Eli Zaretskii <eliz@gnu.org>
3395
3396 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3397 * w32.c (init_environment): Change the default values of many
3398 environment variables in dflt_envvars[] to NULL, to avoid pushing
3399 them into environment when they were not already defined.
3400 Remove the code that deletes site-lisp subdirectories from the default
3401 value of EMACSLOADPATH, as it is no longer needed.
3402 (check_windows_init_file): Now external, not static.
3403 Use Vload_path as is, without adding anything, as this function is now
3404 called when Vload_path is already set up.
3405
3406 * w32.h (check_windows_init_file): Add prototype.
3407
3408 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3409 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3410 compatibility with Posix platforms.
3411 (main): Move the call to check_windows_init_file to here from
3412 w32.c.
3413 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3414 any, in the DEFALT argument into the root of the Emacs build or
3415 installation tree, as appropriate.
3416
3417 * callproc.c (init_callproc_1): Call decode_env_path instead of
3418 doing its equivalent by hand.
3419 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3420 the code that sets Vexec_path run on MS-Windows.
3421
3422 * lread.c (init_lread): Add comments to #ifdef's.
3423
3424 * msdos.c (dos_set_window_size, IT_update_begin)
3425 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3426 instead of direct references.
3427
34282012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3429
3430 Export DEFAULT_REHASH_* to GDB.
3431 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3432 Now constants, not macros.
3433
34342012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3435
3436 Remove unnecessary casts involving pointers.
3437 These casts are no longer needed now that we assume C89 or later,
3438 since they involve casting to or from void *.
3439 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3440 (make_pure_float, make_pure_vector):
3441 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3442 * macros.c (Fstart_kbd_macro):
3443 * menu.c (find_and_return_menu_selection):
3444 * minibuf.c (read_minibuf_noninteractive):
3445 * sysdep.c (closedir):
3446 * xdisp.c (x_produce_glyphs):
3447 * xfaces.c (compare_fonts_by_sort_order):
3448 * xfns.c (x_real_positions, select_visual):
3449 * xselect.c (x_stop_queuing_selection_requests)
3450 (x_get_window_property, x_get_window_property_as_lisp_data):
3451 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3452 Remove unnecessary pointer casts.
3453 * alloc.c (record_xmalloc): New function.
3454 * lisp.h (record_xmalloc): New decl.
3455 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3456 more like a function. This is because the pointer cast is not
3457 needed. All uses changed.
3458 * print.c (print_string, print_error_message): Avoid length recalc.
3459
3460 Improve fix for macroexp crash with debugging (Bug#12118).
3461 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3462 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3463 not supposed to be invoked from the garbage collector.
3464 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3465 (gc_aset): New function, which is like ASET but can be
3466 used in the garbage collector.
3467 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3468 (set_hash_index): Use it instead of ASET.
3469
34702012-08-03 Eli Zaretskii <eliz@gnu.org>
3471
3472 Support symlinks on latest versions of MS-Windows.
3473 * w32.c: Include winioctl.h and aclapi.h.
3474 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3475 (revert_to_self): Forward declarations of static functions.
3476 <static BOOL g_b_init_get_security_info>:
3477 <g_b_init_create_symbolic_link>: New static flags.
3478 (globals_of_w32): Initialize them to zero.
3479 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3480 (map_w32_filename): Improve commentary. Simplify switch.
3481 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3482 headers (most versions of MinGW w32api don't).
3483 (get_security_info, create_symbolic_link)
3484 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3485 New functions.
3486 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3487 in the argument file name.
3488 (sys_access): Call unc_volume_file_attributes only if
3489 GetFileAttributes fails with network-related error codes.
3490 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3491 have the required privileges.
3492 (get_file_security_desc_by_name): Rename from
3493 get_file_security_desc.
3494 (stat_worker): New function, with most of the guts of 'stat', and
3495 with addition of handling of symlinks and support for 'lstat'.
3496 If possible, get file's attributes and security information by
3497 handle, not by name. Produce S_IFLNK bit for symlinks, when
3498 called from 'lstat'.
3499 (stat, lstat): New functions, call 'stat_worker'.
3500 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3501 symlinks when the underlying filesystem supports them.
3502
35032012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3504
3505 Fix macroexp crash on Windows with debugging (Bug#12118).
3506 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3507 checking subscripts; problem introduced with the recent
3508 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3509 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3510 since it's used in non-static inline functions now.
3511
3512 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3513 Don't assume buffer size fits in 'int'. Remove unused local.
3514
3515 Use C99-style 'extern inline' if available.
3516 * buffer.h (BUFFER_INLINE):
3517 * category.h (CATEGORY_INLINE):
3518 * character.h (CHARACTER_INLINE):
3519 * charset.h (CHARSET_INLINE):
3520 * composite.h (COMPOSITE_INLINE):
3521 * dispextern.h (DISPEXTERN_INLINE):
3522 * lisp.h (LISP_INLINE):
3523 * systime.h (SYSTIME_INLINE):
3524 New macro, replacing 'static inline' in this header.
3525 * buffer.h, category.h, character.h, charset.h, composite.h:
3526 * dispextern.h, lisp.h, systime.h:
3527 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3528 * alloc.c (LISP_INLINE):
3529 * buffer.c (BUFFER_INLINE):
3530 * category.c (CATEGORY_INLINE):
3531 * character.c (CHARACTER_INLINE):
3532 * charset.c (CHARSET_INLINE):
3533 * composite.c (COMPOSITE_INLINE):
3534 * dispnew.c (DISPEXTERN_INLINE):
3535 * sysdep.c (SYSTIME_INLINE):
3536 Define to EXTERN_INLINE, so that the corresponding functions
3537 are compiled into code.
3538 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3539 (INLINE_HEADER_END): New macros.
3540 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3541 since it's used in non-static inline functions now.
3542 (VALMASK) [!USE_LSB_TAG]: Likewise.
3543
35442012-08-02 Glenn Morris <rgm@gnu.org>
3545
3546 * s/: Remove empty directory.
3547
3548 * s/ms-w32.h: Move to ../nt/inc.
3549 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3550 Update for new ms-w32.h location.
3551
35522012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3553
3554 Port to Solaris 8.
3555 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3556
35572012-08-02 Glenn Morris <rgm@gnu.org>
3558
3559 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3560 hard-coding the path separator.
3561
35622012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3563
3564 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3565 This how ASET and AREF are supposed to work, and makes
3566 it easier to think about future improvements. See
3567 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3568 * charset.h (set_charset_attr): New function.
3569 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3570 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3571 (aref_addr): New function. All uses of &AREF(...) changed.
3572 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3573 (set_hash_index): New functions. All lvalue-style uses of
3574 HASH_KEY etc. changed.
3575 * keyboard.c (set_prop): New function. All lvalue-style uses
3576 of PROP changed.
3577
35782012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3579
3580 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3581 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3582 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3583 * nsfns.m (ns_set_name_as_filename): Likewise.
3584 * nsmenu.m (ns_update_menubar): Likewise.
3585 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3586
35872012-08-01 Eli Zaretskii <eliz@gnu.org>
3588
3589 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3590 Adapt to latest changes in field names of the corresponding Lisp
3591 objects.
3592
3593 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3594
35952012-08-01 Glenn Morris <rgm@gnu.org>
3596
3597 * s/msdos.h: Remove file.
3598 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3599 * Makefile.in (S_FILE): Remove.
3600 (config_h): Remove S_FILE.
3601
36022012-08-01 Juanma Barranquero <lekktu@gmail.com>
3603
3604 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3605 Remove; moved to nt/config.nt.
3606
36072012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3608
3609 Use INTERNAL_FIELD for conses and overlays.
3610 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3611 Remove obsolete comment.
3612 (MVAR): New macro.
3613 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3614 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3615
36162012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3617
3618 Use INTERNAL_FIELD for symbols.
3619 * lisp.h (SVAR): New macro. Adjust users.
3620 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3621 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3622
36232012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3624
3625 Use INTERNAL_FIELD for processes.
3626 * process.h (PVAR): New macro. Adjust style.
3627 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3628 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3629
36302012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3631
3632 Use INTERNAL_FIELD for windows.
3633 * window.h (WVAR): New macro.
3634 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3635 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3636 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3637 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3638 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3639 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3640
36412012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3642
3643 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3644
36452012-08-01 Glenn Morris <rgm@gnu.org>
3646
3647 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3648 Move to configure.ac.
3649
36502012-08-01 Juanma Barranquero <lekktu@gmail.com>
3651
3652 * makefile.w32-in (CONFIG_H): Update dependencies.
3653 (CONF_POST_H): New macro.
3654
3655 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3656
36572012-07-31 Glenn Morris <rgm@gnu.org>
3658
3659 * Makefile.in (S_FILE): No longer set by configure.
3660
3661 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3662 is available.
3663 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3664
3665 * process.h (NULL_DEVICE):
3666 * emacs.c (SEPCHAR):
3667 * editfns.c (USER_FULL_NAME): Let configure set them.
3668
3669 * s/README, s/template.h: Remove files.
3670
3671 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3672
3673 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3674 Move to configure.ac.
3675
36762012-07-31 Eli Zaretskii <eliz@gnu.org>
3677
3678 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3679 resulting renaming of 'struct frame' members.
3680
3681 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3682
3683 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3684 after introduction of FVAR.
3685
36862012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3687
3688 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3689
3690 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3691 instead of compositeToPoint.
3692 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3693
3694 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3695
36962012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3697
3698 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3699 * lisp.h (INTERNAL_FIELD): New macro.
3700 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3701 (BVAR): Change to use INTERNAL_FIELD.
3702 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3703 (KVAR): Change to use INTERNAL_FIELD.
3704 * frame.h (FVAR): New macro.
3705 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3706 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3707 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3708 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3709 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3710
37112012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3712
3713 Miscellaneous fixes for non-default X toolkits.
3714 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3715 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3716 Move under #ifdef USE_LUCID.
3717 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3718 definition and usage to avoid warnings.
3719
37202012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3721
3722 * nsterm.m (openFiles): Fix previous checkin.
3723
37242012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3725
3726 * indent.c (compute_motion): Remove unused local.
3727
37282012-07-31 Glenn Morris <rgm@gnu.org>
3729
3730 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3731
3732 * conf_post.h [USG5_4]:
3733 Move remaining contents of s/usg5-4-common.h here.
3734 * s/usg5-4-common.h: Remove file.
3735
3736 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3737 * s/irix6-5.h: Remove file.
3738
3739 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3740 * s/darwin.h: Remove file.
3741
3742 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3743 * s/hpux10-20.h: Remove file, which is now empty.
3744
37452012-07-30 Glenn Morris <rgm@gnu.org>
3746
3747 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3748 * Makefile.in (config_h): Add conf_post.h.
3749 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3750
37512012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3752
3753 * nsterm.m (ns_do_open_file): New variable.
3754 (ns_term_init): Set ns_do_open_file to YES after run returns.
3755 (openFile, openTempFile, openFileWithoutUI, openFiles):
3756 Open files only if ns_do_open_file.
3757
37582012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3759
3760 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3761 This no-op macro hasn't been needed for many years.
3762 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3763
3764 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3765 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3766 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3767 gdb_make_enums_visible.
3768 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3769 (DIRECTORY_SEP): Now a constant, not a macro.
3770
37712012-07-30 Eli Zaretskii <eliz@gnu.org>
3772
3773 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3774 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3775
3776 * w32term.c <w32_keyboard_codepage>: Renamed from
3777 keyboard_codepage and now external. All users changed.
3778
3779 * w32term.h: Add declaration of w32_keyboard_codepage.
3780
3781 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3782 the codepage to translate keys to Unicode. If this argument is
3783 -1, use the value returned by GetConsoleCP. All callers changed.
3784
37852012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3786
3787 Update .PHONY listings in makefiles.
3788 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3789 bootstrap-clean, distclean, maintainer-clean, versioclean,
3790 extraclean, frc.
3791
3792 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3793 This is a bit clearer. Fix some commentary typos.
3794
37952012-07-30 Glenn Morris <rgm@gnu.org>
3796
3797 * s/netbsd.h: Let configure include signal.h if needed.
3798 Remove file, which is now empty.
3799
3800 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3801 Let configure set them.
3802 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3803 No more need to undefine.
3804
38052012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3806
3807 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3808 non-single-byte char when adding meta modifier. (Bug#12090)
3809
38102012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3811
3812 Convert safe_call to use variable number of arguments.
3813 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3814 (safe_call2): Fix comment.
3815 * lisp.h (safe_call): Adjust prototype.
3816 * coding.c (encode_coding_object): Change to use safe_call2.
3817 * xfaces.c (merge_face_heights): Change to use safe_call1.
3818
38192012-07-30 Glenn Morris <rgm@gnu.org>
3820
3821 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3822 does that unconditionally. Remove file, which is now empty.
3823
3824 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3825 Remove empty files.
3826
38272012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3828
3829 Export to GDB most of lisp.h's remaining object-like macros.
3830 * lisp.h (min, max): Move earlier, because they're used earlier now.
3831 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3832 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3833 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3834 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3835 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3836 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3837 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3838 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3839 Now constants, for GDB. They need not be macros.
3840 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3841 Now constants, for GDB, as well as macros, for static initializers.
3842 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3843 Move to after the definition of struct Lisp_Char_Table,
3844 since the former now needs that type defined.
3845 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3846 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3847 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3848 New enums, for gdb_make_enums_visible.
3849 (GLYPH_MODE_LINE_FACE): Remove; unused.
3850 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3851 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3852 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3853 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3854 enum maxargs, enum MAX_ALLOCA.
3855 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3856 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3857 no longer needed, now that they are done in lisp.h.
3858
38592012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3860
3861 Cleanup string bytes checking.
3862 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3863 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3864 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3865 (check_sblock, compact_small_strings): Simplify.
3866
38672012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3868
3869 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3870 These macros are confusing and no longer need to be defined, as
3871 the enum values now suffice. All uses replaced with definiens.
3872 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3873
38742012-07-29 Juanma Barranquero <lekktu@gmail.com>
3875
3876 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3877 ($(BLD)/w32console.$(O)): Update dependencies.
3878
38792012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3880
3881 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3882 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3883 time. Adjust users.
3884 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3885
38862012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3887
3888 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3889 setting sitelisp (Bug#12010).
3890
38912012-07-29 Eli Zaretskii <eliz@gnu.org>
3892
3893 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3894
3895 * w32heap.c (cache_system_info):
3896 * w32.c (sys_rename):
3897 * w32proc.c (find_child_console, sys_kill): All users changed.
3898
38992012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3900
3901 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3902
39032012-07-29 Eli Zaretskii <eliz@gnu.org>
3904
3905 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3906
39072012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3908
3909 Cleanup statistics calculation in Fgarbage_collect.
3910 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3911 Fix zombies percentage calculation. Simplify elapsed time calculation.
3912
39132012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3914
3915 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3916 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3917 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3918 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3919 (replace_range, replace_range_2, del_range_2): Change to eassert.
3920 * marker.c (byte_char_debug_check): Adjust style.
3921
39222012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3923
3924 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3925 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3926 long-ago-commented-out code that talks about "WIN32".
3927 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3928 All uses changed.
3929
39302012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3931
3932 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3933 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3934 Simplify by using alignof.
3935 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3936 * lisp.h: Include <stdalign.h>.
3937 (GCALIGNMENT): New macro and constant.
3938 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3939 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3940 (stdalign): New macro, if not already defined.
3941
39422012-07-28 Eli Zaretskii <eliz@gnu.org>
3943
3944 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3945 * w32inevt.c: Include w32inevt.h.
3946 (w32_read_console_input): New inline function, calls either
3947 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3948 w32_console_unicode_input.
3949 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3950 (w32_kbd_patch_key, key_event): Use the codepage returned by
3951 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3952 (key_event): use uChar.UnicodeChar only if
3953 w32_console_unicode_input is non-zero.
3954
3955 * w32console.c: Include w32heap.h.
3956 <w32_console_unicode_input>: New global variable.
3957 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3958 family of Windows, zero otherwise.
3959
3960 * w32inevt.h: Declare w32_console_unicode_input.
3961
3962 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3963 --without-x. (Bug#11742)
3964
39652012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3966
3967 Adjust GDB to reflect pvec_type changes (Bug#12036).
3968 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3969 2012-07-04 changes to pseudovector representation.
3970 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3971
39722012-07-27 Michael Albinus <michael.albinus@gmx.de>
3973
3974 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3975 bus address.
3976 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3977
39782012-07-27 Eli Zaretskii <eliz@gnu.org>
3979
3980 * alloc.c (listn): Fix the order the arguments are consed onto the
3981 list.
3982
3983 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3984 enumeration constants, as PURE and HEAP are too general, and clash
3985 with other headers and sources, such as gmalloc.c and the
3986 MS-Windows system headers. All users changed.
3987
39882012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3989
3990 Revert last save_excursion_save and save_excursion_restore changes.
3991 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3992 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3993
39942012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3995
3996 Fix recently-introduced typos in Windows port.
3997 Reported by Martin Rudalics <rudalics@gmx.at>.
3998 * w32.c (init_environment): Replace comma with semicolon.
3999 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4000
40012012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4002
4003 Improve GDB symbol export (Bug#12036).
4004 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4005 arms of an 'if', not using conditional expressions; otherwise GDB
4006 complains about the types in the unevaluated arm when the argument
4007 is an integer literal.
4008 (xgetint): Simplify expression.
4009 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4010 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4011 Zaretskii in <http://bugs.gnu.org/12036#13>.
4012 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4013 needed now that we have gdb_make_enums_visible.
4014 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4015 (enum enum_USE_LSB_TAG):
4016 New enum types, packaging up enums that need to be exported to GDB.
4017
40182012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4019
4020 Utility function to make a list from specified amount of objects.
4021 * lisp.h (enum constype): New datatype.
4022 (listn): New prototype.
4023 * alloc.c (listn): New function.
4024 (Fmemory_use_count, syms_of_alloc): Use it.
4025 * buffer.c (syms_of_buffer): Likewise.
4026 * callint.c (syms_of_callint): Likewise.
4027 * charset.c (define_charset_internal): Likewise.
4028 * coding.c (syms_of_coding): Likewise.
4029 * keymap.c (syms_of_keymap): Likewise.
4030 * search.c (syms_of_search): Likewise.
4031 * syntax.c (syms_of_syntax): Likewise.
4032 * w32.c (init_environment): Likewise.
4033 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4034 * xdisp.c (syms_of_xdisp): Likewise.
4035 * xfns.c (syms_of_xfns): Likewise.
4036
40372012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4038
4039 Fast save_excursion_save and save_excursion_restore.
4040 * lisp.h (struct Lisp_Excursion): New data type.
4041 (PVEC_EXCURSION): New pseudovector type.
4042 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4043 to deal with it. Adjust comments.
4044 (init_marker, attach_marker): New prototype.
4045 (unchain_marker): Adjust prototype.
4046 * marker.c (attach_marker): Change to global.
4047 (init_marker): New function.
4048 * alloc.c (Fmake_marker, build_marker): Use it.
4049 (build_marker): More easserts.
4050 (mark_object): Handle struct Lisp_Excursion.
4051 * editfns.c (save_excursion_save, save_excursion_restore):
4052 Reimplement to use struct Lisp_Excursion. Add comments.
4053
40542012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4055
4056 Fix export of symbols to GDB (Bug#12036).
4057 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4058 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4059 emacs.c, as this is a more-suitable home. Had this been done earlier
4060 the fix for 12036 would have avoided some of the problems noted in
4061 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4062 would have been more obvious.
4063 * emacs.c: Do not include <verify.h>; no longer needed.
4064 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4065 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4066 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4067 Remove; now done in lisp.h.
4068 * lisp.h (PUBLISH_TO_GDB): New macro.
4069 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4070 (DATA_SEG_BITS): Use it.
4071 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4072 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4073 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4074 not be usable in #if. This simplifies things.
4075
40762012-07-26 Juanma Barranquero <lekktu@gmail.com>
4077
4078 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4079
40802012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4081
4082 Simplify export of symbols to GDB (Bug#12036).
4083 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4084 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4085 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4086 Adjust to changes in lisp.h and emacs.c, by using
4087 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4088 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4089 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4090 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4091 instead of gdb_valbits.
4092 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4093 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4094 instead of gdb_array_mark_flag.
4095 (xboolvector): Get size from $->size, not $->header.size.
4096 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4097 (xreload, hook-run, hookpost-run): Remove.
4098 * emacs.c: Include <verify.h>.
4099 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4100 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4101 Remove.
4102 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4103 (gdb_USE_LSB_TAG): New enum constants.
4104 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4105 Also define these as enum constants, so they're visible to GDB.
4106 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4107 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4108 as constants, so they're visible to GDB.
4109 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4110 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4111 Now enum constants, not macros, so they're visible to GDB.
4112 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4113 more convenient now. All uses changed.
4114 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4115 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4116
41172012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4118
4119 Explicitly free restriction data that are not needed anymore.
4120 * editfns.c (save_restriction_restore): Free restriction data.
4121
41222012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4123
4124 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4125 add argument, tune behavior, and adjust all callers.
4126
41272012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4128
4129 Use typedef for EMACS_INT, EMACS_UINT.
4130 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4131 than macros. This simplifies debugging in the usual case, since
4132 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4133 and it allows expressions involving EMACS_INT casts.
4134 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4135
41362012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4137
4138 * nsterm.m (ns_read_socket): Return early if there is a modal
4139 window (Bug#12043).
4140
41412012-07-25 Martin Rudalics <rudalics@gmx.at>
4142
4143 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4144 that FOCUS-FRAME can be omitted.
4145
41462012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4147
4148 Adjust buffer text indirection counters at the end of Fkill_buffer.
4149 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4150 buffer is definitely dead. This should really fix an issue reported
4151 by Christoph Scholtes again. (Bug#12007).
4152 (init_buffer_once): Initialize indirection counters of
4153 buffer_defaults and buffer_local_symbols (for sanity and safety).
4154
41552012-07-24 Eli Zaretskii <eliz@gnu.org>
4156
4157 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4158 and continuation glyphs on tooltip frames, leave them at zero.
4159 Avoids continued lines in tooltips. (Bug#11832)
4160
41612012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4162
4163 Simplify copy_overlay.
4164 * buffer.c (copy_overlay): Simplify. Use build_marker.
4165 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4166
41672012-07-23 Eli Zaretskii <eliz@gnu.org>
4168
4169 * print.c (print_object): Don't crash when a frame's name is nil
4170 or invalid. (Bug#12025)
4171
4172 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4173 it signals an error when a tooltip frame is being created.
4174
41752012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4176
4177 Cleanup miscellaneous objects allocation and initialization.
4178 * alloc.c (allocate_misc): Change to static. Add argument to
4179 specify the subtype. Adjust comment and users.
4180 (build_overlay): New function.
4181 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4182 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4183 (allocate_misc): Remove prototype.
4184 (build_overlay): Add prototype.
4185
41862012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4187
4188 Swap buffer text indirection counters in Fbuffer_swap_text.
4189 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4190 This avoids crash reported by Christoph Scholtes at
4191 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4192
41932012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4194
4195 * nsmenu.m (Popdown_data): New struct.
4196 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4197 free Popdown_data.
4198 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4199 (initWithContentRect): Make imgView and contentView non-static
4200 and autorelease them. Also autorelease img and matrix (Bug#12005).
4201 (dealloc): Remove (Bug#12005).
4202
42032012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4204
4205 Adjust consing_since_gc when objects are explicitly freed.
4206 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4207 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4208 (free_cons, free_misc): Subtract object size from consing_since_gc.
4209
42102012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4211
4212 Simplify and cleanup markers positioning code.
4213 * marker.c (attach_marker): More useful eassert.
4214 (live_buffer, set_marker_internal): New function.
4215 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4216 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4217
42182012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4219
4220 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4221 as it's limited by the amount of memory, not by INT_MAX.
4222
42232012-07-21 Eli Zaretskii <eliz@gnu.org>
4224
4225 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4226 in special-event-map. See the discussion at
4227 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4228 for the reasons.
4229
4230 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4231 info.dwItemData. Fixes crashes on 64-bit Windows.
4232 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4233
42342012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4235
4236 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4237 (conversationIdentifier): Return value is NSInteger.
4238 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4239
42402012-07-21 Chong Yidong <cyd@gnu.org>
4241
4242 * window.c (decode_any_window): Signal an error if the window is
4243 on a dead frame (Bug#11984).
4244
42452012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4246
4247 Add indirection counting to speed up Fkill_buffer.
4248 * buffer.h (struct buffer): New member.
4249 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4250 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4251 base buffer indirection counter.
4252 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4253 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4254 through buffer list if indirection counter is 0.
4255
42562012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4257
4258 Extend the value returned by Fgarbage_collect with heap statistics.
4259 * alloc.c (Qheap): New symbol.
4260 (syms_of_alloc): DEFSYM it.
4261 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4262 (Fmemory_free): Remove.
4263 (syms_of_alloc): Don't defsubr it.
4264 * buffer.c (Fcompact_buffer): Remove.
4265 (syms_of_buffer): Don't defsubr it.
4266
42672012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4268
4269 Make maybe_gc inline.
4270 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4271 * lisp.h (consing_since_gc, gc_relative_threshold)
4272 (memory_full_cons_threshold): Revert declaration.
4273 (maybe_gc): Remove prototype, define as inline.
4274 * alloc.c: Remove old commented-out code.
4275 (consing_since_gc, gc_relative_threshold)
4276 (memory_full_cons_threshold): Revert to global.
4277 (maybe_gc): Remove.
4278
42792012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4280
4281 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4282 * lisp.h (build_unibyte_string): New function.
4283 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4284 * sysdep.c, w32fns.c, xfns.c: Use it.
4285 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4286 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4287 Adjust users accordingly.
4288 * font.h (font_open_by_name): Adjust prototype.
4289
42902012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4291
4292 Cleanup calls to Fgarbage_collect.
4293 * lisp.h (maybe_gc): New prototype.
4294 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4295 Remove declarations.
4296 * alloc.c (maybe_gc): New function.
4297 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4298 Make them static.
4299 * bytecode.c (MAYBE_GC): Use maybe_gc.
4300 * eval.c (eval_sub, Ffuncall): Likewise.
4301 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4302 to avoid dependency from auto-save feature.
4303
43042012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4305
4306 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4307 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4308 'for_each_per_buffer_object_at'.
4309 All uses changed. It's better to use upper-case for macros that
4310 cannot be implemented as functions, to give the reader a clue
4311 that they're special.
4312
43132012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4314
4315 * alloc.c (Fgarbage_collect): Tweak docstring.
4316
43172012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4318
4319 Tweak the value returned from Fgarbage_collect again.
4320 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4321 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4322 Adjust documentation.
4323 (total_vector_bytes): Rename to total_vector_slots, adjust
4324 accounting.
4325 (total_free_vector_bytes): Rename to total_free_vector_slots,
4326 adjust accounting.
4327 (Qstring_bytes, Qvector_slots): New symbols.
4328 (syms_of_alloc): DEFSYM them.
4329
43302012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4331
4332 Buffer compaction primitive which may be used from Lisp.
4333 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4334 (syms_of_buffer): Register Fcompact_buffer.
4335 * alloc.c (Fgarbage_collect): Use compact_buffer.
4336 * buffer.h (compact_buffer): New prototype.
4337 (struct buffer_text): New member.
4338
43392012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4340
4341 New macro to iterate over all buffers, miscellaneous cleanups.
4342 * lisp.h (all_buffers): Remove declaration.
4343 * buffer.h (all_buffers): Add declaration, with comment.
4344 (for_each_buffer): New macro.
4345 * alloc.c (Fgarbage_collect, mark_object): Use it.
4346 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4347 (init_buffer): Likewise.
4348 * data.c (Fset_default): Likewise.
4349 * coding.c (code_conversion_restore): Remove redundant check
4350 for dead buffer.
4351 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4352
43532012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4354
4355 Fix bug that created negative-length intervals.
4356 * intervals.c (merge_interval_right, merge_interval_left):
4357 Do not zero out this interval if it is absorbed by its children,
4358 as this interval's total length doesn't change in that case. See
4359 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4360
43612012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4362
4363 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4364 when invoking (make-bool-vector N t) and N is a positive
4365 multiple of 8 -- the last 8 bits were mistakenly cleared.
4366
4367 Remove some struct layout assumptions in bool vectors.
4368 * alloc.c (bool_header_size): New constant.
4369 (header_size, word_size): Move earlier, as they're now used earlier.
4370 Use 'word_size' in a few more places, where it's appropriate.
4371 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4372 padding before the data member of a bool vector.
4373 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4374 than doing the check by hand with an abort ().
4375
43762012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4377
4378 * eval.c (Fdefvar): Don't check constants since we only set the var if
4379 it's not yet defined anyway (bug#11904).
4380
4381 * lisp.h (last_undo_boundary): Declare new var.
4382 * keyboard.c (command_loop_1): Set it.
4383 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4384 were auto-added by the command loop (bug#11774).
4385
43862012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4387
4388 * w32font.c (Qsymbol): Remove local definition.
4389 (syms_of_w32font): Don't DEFSYM it.
4390
43912012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4392
4393 Fix sweep_vectors to handle large bool vectors correctly.
4394 * alloc.c (sweep_vectors): Account total_vector_bytes for
4395 bool vectors larger than VBLOCK_BYTES_MAX.
4396
43972012-07-18 Chong Yidong <cyd@gnu.org>
4398
4399 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4400 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4401
44022012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4403
4404 Return more descriptive data from Fgarbage_collect.
4405 Suggested by Stefan Monnier in
4406 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4407 * alloc.c (bounded_number): New function.
4408 (total_buffers, total_vectors): New variable.
4409 (total_string_size): Rename to total_string_bytes, adjust users.
4410 (total_vector_size): Rename to total_vector_bytes, adjust users.
4411 (sweep_vectors): Account total_vectors and total_vector_bytes.
4412 (Fgarbage_collect): New return value. Adjust documentation.
4413 (gc_sweep): Account total_buffers.
4414 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4415 (VECTOR_SIZE): Remove.
4416 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4417 (Qinterval, Qmisc): New symbols.
4418 (syms_of_data): Initialize them.
4419 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4420 (Qcons, Qbuffer): New declarations.
4421
44222012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4423
4424 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4425 Round up, not down. Improve doc.
4426
44272012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4428
4429 Restore old code in allocate_string_data to avoid Faset breakage.
4430 Reported by Julien Danjou <julien@danjou.info> in
4431 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4432 * alloc.c (allocate_string_data): Restore old code with minor
4433 adjustments, fix comment to explain this subtle issue.
4434
44352012-07-17 Eli Zaretskii <eliz@gnu.org>
4436
4437 Remove FILE_SYSTEM_CASE.
4438 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4439
4440 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4441 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4442 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4443 call-process-region passes it through expand-file-name.
4444
4445 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4446
44472012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4448
4449 Fix crash when creating indirect buffer (Bug#11917)
4450 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4451 Don't handle unbound variables specially if non-zero.
4452 (Fbuffer_local_variables): Pass zero.
4453 (clone_per_buffer_values): Pass non-zero.
4454
44552012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4456
4457 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4458 to make the loop interruptible.
4459
44602012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4461
4462 * gnutls.c (emacs_gnutls_handshake): Only retry if
4463 GNUTLS_E_INTERRUPTED.
4464
44652012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4466
4467 Cleanup and convert miscellaneous checks to eassert.
4468 * alloc.c (mark_interval): Fix comment, partially rephrase
4469 old comment from intervals.h (see below).
4470 * intervals.c (find_interval, adjust_intervals_for_insertion)
4471 (delete_interval, adjust_intervals_for_deletion)
4472 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4473 Convert to eassert.
4474 (adjust_intervals_for_insertion, make_new_interval):
4475 Remove obsolete and unused code.
4476 * intervals.h (struct interval): Remove obsolete comment.
4477 * textprotp.c (erase_properties): Remove unused code.
4478 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4479 (Fremove_list_of_text_properties): Convert to eassert.
4480
44812012-07-17 Chong Yidong <cyd@gnu.org>
4482
4483 * editfns.c (Finsert_char): Doc fix.
4484
44852012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4486
4487 Fix previous change to make Fmemory_free always accurate.
4488 * alloc.c (make_interval): Update total_free_intervals.
4489 (make_float): Likewise for total_free_floats.
4490 (free_cons, Fcons): Likewise for total_free_conses.
4491 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4492 Likewise for total_free_vector_bytes.
4493 (Fmake_symbol): Likewise for total_free_symbols.
4494 (bytes_free): Remove.
4495
44962012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4497
4498 Simple free memory accounting feature.
4499 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4500 (sweep_vectors): Accumulate size of free vectors.
4501 (Fgarbage_collect): Setup bytes_free.
4502 (Fmemory_free): New function.
4503 (syms_of_alloc): Register it.
4504
45052012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4506
4507 Cleanup overlays checking.
4508 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4509 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4510 eassert and OVERLAYP.
4511 (sort_overlays): Change to use OVERLAYP.
4512
45132012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4514
4515 * editfns.c (Finsert_char): Make it interactive, and make the
4516 second arg optional. Copy interactive spec and docstring from
4517 ucs-insert.
4518
45192012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4520
4521 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4522 Unlike the other wrapped functions, fabs has an unspecified
4523 effect on errno.
4524
45252012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4526
4527 * nsterm.m (keyDown): Interpret flags without left/right bits
4528 as the left key (Bug#11670).
4529
45302012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4531
4532 Remove empty and useless init functions.
4533 * lisp.h (init_character_once, init_fns, init_image)
4534 (init_filelock, init_sound): Remove prototype.
4535 * character.c (init_character_once): Remove.
4536 * filelock.c (init_filelock): Likewise.
4537 * fns.c (init_fns): Likewise.
4538 * image.c (init_image): Likewise.
4539 * sound.c (init_sound): Likewise.
4540 * emacs.c (main): Adjust accordingly.
4541
45422012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4543
4544 * gtkutil.h: Tiny cleanups.
4545 (use_old_gtk_file_dialog): Remove useless declaration.
4546 (xg_uses_old_file_dialog): Add suggested const attribute.
4547
45482012-07-15 Eli Zaretskii <eliz@gnu.org>
4549
4550 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4551 (bidi_paragraph_init): Use it to limit search forward for a strong
4552 directional character in abnormally large paragraphs full of
4553 neutral or weak characters. (Bug#11943)
4554
45552012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4556
4557 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4558 the toolbar (Bug#9451).
4559 (xg_make_tool_item): Give the widget event box a transparent
4560 background.
4561
45622012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4563
4564 Cleanup basic allocation variables and functions.
4565 * alloc.c (ignore_warnings, init_intervals, init_float)
4566 (init_cons, init_symbol, init_marker): Remove.
4567 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4568 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4569 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4570 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4571 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4572 (staticidx, init_alloc_once, init_strings, free_ablock):
4573 Remove redundant initialization.
4574 * fns.c (init_weak_hash_tables): Remove.
4575 * lisp.h (init_weak_hash_tables): Remove prototype.
4576
45772012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4578
4579 Use zero_vector where appropriate.
4580 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4581 accordingly.
4582 * lisp.h (zero_vector): New declaration.
4583 * font.c (null_vector): Remove.
4584 (syms_of_font): Remove initialization and staticpro.
4585 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4586 * keymap.c (Faccessible_keymaps): Likewise.
4587
45882012-07-15 Leo Liu <sdl.web@gmail.com>
4589
4590 * fringe.c: Fix typo in comments.
4591
45922012-07-14 Leo Liu <sdl.web@gmail.com>
4593
4594 * fringe.c: Add a new bitmap exclamation-mark.
4595
45962012-07-14 Eli Zaretskii <eliz@gnu.org>
4597
4598 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4599
4600 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4601 (HAVE_MENUS): Don't define, defined by editing config.in with
4602 msdos/sed2v2.inp.
4603 (GMALLOC_INHIBIT_VALLOC): Don't define.
4604 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4605
46062012-07-14 Juanma Barranquero <lekktu@gmail.com>
4607
4608 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4609
46102012-07-14 Glenn Morris <rgm@gnu.org>
4611
4612 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4613 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4614 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4615
46162012-07-13 Glenn Morris <rgm@gnu.org>
4617
4618 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4619
4620 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4621 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4622
46232012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4624
4625 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4626 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4627 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4628 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4629 where appropriate.
4630 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4631 as boolean expression.
4632 (x_set_window_size): Remove unused variable toolbar.
4633 (ns_get_color_default, ns_mod_to_lisp): Remove.
4634 (ns_mouse_position): Remove unused variables xchar and ychar.
4635 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4636 (ns_set_vertical_scroll_bar): Remove unused variable count.
4637 (ns_delete_terminal): Remove unused variable i.
4638 (ns_term_init): Remove unused variables r, g and b.
4639 (mouseDown): Remove unused variable window.
4640 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4641 (initFrameFromEmacs): Remove unused variable vbextra.
4642 (mouseEntered): Remove unused variables p and dpyinfo.
4643 (mouseExited): Remove unused variables p and r.
4644 (ns_define_frame_cursor, ns_clear_frame_area)
4645 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4646 (menuDown): Assign [sender tag] to variable and cast the variable.
4647
4648 * nsterm.h (menuDown): Add id as type to argument sender.
4649 (ns_display_info_for_name): Add Lisp_Object argument.
4650 (ns_term_init): Add Lisp_Object argument.
4651 (ns_map_event_to_object): Add void argument.
4652 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4653 prototype with arguments and only declare if __OBJC__.
4654 (nxatoms_of_nsselect): Add void argument.
4655 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4656 (ns_alloc_autorelease_pool): Add void argument.
4657 (ns_release_autorelease_pool): Add void* argument.
4658 (ns_get_defaults_value): Add const char* argument.
4659
4660 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4661 (initFromContents): Use SSDATA where appropriate.
4662 (ns_update_menubar): Add braces to ambigous if-else.
4663 (initWithTitle): Put () around assignment in if statement.
4664 (ns_menu_show): Remove unused variables window and keymap.
4665 (update_frame_tool_bar): Remove unused variable selected_p.
4666 (initWithContentRect): Remove unused variable this_cmd_name.
4667
4668 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4669 appropriate.
4670 (setXBMColor): Remove unused variable len.
4671 (setPixmapData): Put () around assignment in loop statement.
4672
4673 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4674 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4675 where appropriate.
4676 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4677 around assignment in loop statement.
4678 (nsfont_open): Remove unused variable i.
4679 (nsfont_open): Remove unused variable len.
4680 (nsfont_draw): Remove unused variable cs.
4681
4682 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4683 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4684 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4685 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4686 (Fns_font_name, Fns_perform_service)
4687 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4688 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4689 (ns_set_name): Remove unused variable view.
4690 (x_set_menu_bar_lines): Remove unused variable olines.
4691 (x_set_tool_bar_lines): Remove unused variable root_window.
4692 (Fns_list_colors): Put () around assignment in while statement.
4693 (Fns_perform_service): Remove unused variable len.
4694 (Fns_display_usable_bounds): Remove unused variable top.
4695 (syms_of_nsfns): Remove unused variable i.
4696
4697 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4698 memcpy (Bug#11907).
4699
47002012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4701
4702 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4703 and free it with DestroyExceptionInfo (Bug#11558).
4704
47052012-07-13 Juanma Barranquero <lekktu@gmail.com>
4706
4707 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4708 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4709 Set here, not in nt/config.nt.
4710
47112012-07-13 Eli Zaretskii <eliz@gnu.org>
4712
4713 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4714 cursor overflow into the last glyph on display line when the right
4715 fringe is off. (Bug#11832)
4716
47172012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4718
4719 * xdisp.c (produce_special_glyphs): Now static.
4720 * dispextern.h (produce_special_glyphs): Remove decl.
4721
47222012-07-13 Glenn Morris <rgm@gnu.org>
4723
4724 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4725 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4726
4727 * s/usg5-4-common.h (USG, USG5):
4728 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4729 * s/sol2-6.h (SOLARIS2):
4730 * s/irix6-5.h (IRIX6_5):
4731 * s/hpux10-20.h (USG, USG5, HPUX):
4732 * s/gnu-linux.h (USG, GNU_LINUX):
4733 * s/freebsd.h (BSD_SYSTEM):
4734 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4735 * s/cygwin.h (CYGWIN):
4736 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4737 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4738
47392012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4740
4741 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4742
47432012-07-13 Glenn Morris <rgm@gnu.org>
4744
4745 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4746
4747 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4748
4749 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4750 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4751
47522012-07-12 Glenn Morris <rgm@gnu.org>
4753
4754 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4755
4756 * process.c (init_process_emacs): Rename from init_process.
4757 The old name is also the name of a Mach system call.
4758 * lisp.h, emacs.c: Update for this name change.
4759 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4760 longer needed.
4761
47622012-07-12 Eli Zaretskii <eliz@gnu.org>
4763
4764 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4765 memmove call that removes glyphs covered by the left truncation
4766 glyph. Improve commentary.
4767 (display_line): Fix display of continuation glyphs on GUI frames
4768 when the right fringe is turned off and variable-size fonts are
4769 used in the window. Move the code that appends a stretch glyph to
4770 produce_special_glyphs, so that it could be used for truncation
4771 and continuation glyphs alike.
4772 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4773 glyph of a suitably computed width, to align the special glyphs at
4774 the window margin. Code moved from display_line. (Bug#11832)
4775
47762012-07-12 Glenn Morris <rgm@gnu.org>
4777
4778 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4779
4780 * s/gnu-linux.h, s/hpux10-20.h:
4781 Do not unconditionally define HAVE_XRMSETDATABASE.
4782
4783 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4784
47852012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4786
4787 Fix typos that broke OS X build.
4788 Reported by Randal L. Schwartz in
4789 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4790 * nsterm.m (ns_timeout): Add missing local decl.
4791 (ns_get_color): snprintf -> sprintf, to fix typo.
4792
47932012-07-12 Glenn Morris <rgm@gnu.org>
4794
4795 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4796 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4797 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4798 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4799
4800 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4801 Move PTY_OPEN to configure.
4802
4803 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4804 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4805 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4806
48072012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4808
4809 Use empty_unibyte_string where applicable.
4810 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4811 * lread.c (read1): Likewise.
4812 * xsettings.c (syms_of_xsettings): Likewise.
4813
48142012-07-12 Glenn Morris <rgm@gnu.org>
4815
4816 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4817 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4818 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4819 * s/hpux10-20.h (RUN_TIME_REMAP):
4820 * s/bsd-common.h (TABDLY): Move to configure.
4821
4822 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4823
4824 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4825
4826 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4827 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4828
4829 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4830
4831 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4832 * s/template.h: Move NARROWPROTO to configure.
4833
48342012-07-11 Glenn Morris <rgm@gnu.org>
4835
4836 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4837 unused since 2011-01-17 change to systty.h.
4838
4839 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4840 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4841 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4842
48432012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4844
4845 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4846
48472012-07-11 Glenn Morris <rgm@gnu.org>
4848
4849 * s/darwin.h, s/gnu-linux.h, s/template.h:
4850 Move INTERRUPT_INPUT to configure.
4851
48522012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4853
4854 Minor adjustments to interning code.
4855 * lisp.h (intern, intern_c_string): Redefine as static inline
4856 wrappers for intern_1 and intern_c_string_1, respectively.
4857 (intern_1, intern_c_string_1): Rename prototypes.
4858 * lread.c (intern_1, intern_c_string_1, oblookup):
4859 Simplify Vobarray checking.
4860 * font.c (font_intern_prop): Likewise. Adjust comment.
4861 * w32font.c (intern_font_name): Likewise.
4862
48632012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4864
4865 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4866
4867 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4868 of Fcar/Fcdr if possible.
4869 * font.c (check_otf_features): Likewise.
4870 * fontset.c (Fnew_fontset): Likewise.
4871 * gnutls.c (Fgnutls_boot): Likewise.
4872 * minibuf.c (read_minibuf): Likewise.
4873 * msdos.c (IT_set_frame_parameters): Likewise.
4874 * xmenu.c (Fx_popup_dialog): Likewise.
4875 * w32menu.c (Fx_popup_dialog): Likewise.
4876
48772012-07-11 Glenn Morris <rgm@gnu.org>
4878
4879 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4880 since nothing has defined it on these platforms.
4881
4882 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4883 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4884
4885 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4886 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4887 Move CLASH_DETECTION to configure.
4888
4889 * s/gnu.h: Remove file, which is now empty.
4890
4891 * s/gnu.h, s/gnu-linux.h:
4892 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4893
48942012-07-11 John Wiegley <johnw@newartisans.com>
4895
4896 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4897 function attribute, so we only use it if it exists in the
4898 compiler.
4899
49002012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4901
4902 Avoid call to strlen in fast_c_string_match_ignore_case.
4903 * search.c (fast_c_string_match_ignore_case): Change to use
4904 length argument. Adjust users accordingly.
4905 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4906
49072012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4908
4909 Assume mkdir, rmdir.
4910 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4911 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4912
4913 Assume rename.
4914 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4915
4916 Assume perror.
4917 * s/hpux10-20.h (HAVE_PERROR): Remove.
4918 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4919 Remove dummy definition, as this problem was obsolete long ago.
4920
4921 Assume strerror.
4922 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4923
49242012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4925
4926 Avoid calls to strlen in font processing functions.
4927 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4928 (font_open_by_name): Change to use length argument.
4929 Adjust users accordingly.
4930 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4931 Adjust prototypes.
4932 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4933 Change to return ptrdiff_t.
4934 (xfont_list_pattern, xfont_match): Use length returned by
4935 xfont_decode_coding_xlfd.
4936 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4937
49382012-07-11 Glenn Morris <rgm@gnu.org>
4939
4940 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4941 Move DONT_REOPEN_PTY to configure.
4942
4943 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4944 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4945
49462012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4947
4948 Remove "#define unix" that is no longer needed (Bug#11905).
4949 * s/aix4-2.h (unix): Remove; no longer needed.
4950
4951 EMACS_TIME simplification (Bug#11875).
4952 This replaces macros (which typically do not work in GDB)
4953 with functions, typedefs and enums, making the code easier to debug.
4954 The functional style also makes code easier to read and maintain.
4955 * systime.h: Include <sys/time.h> on all hosts, not just if
4956 WINDOWSNT, since 'struct timeval' is needed in general.
4957 (EMACS_TIME): Now a typedef, not a macro.
4958 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4959 not macros.
4960 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4961 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4962 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4963 (EMACS_TIME_LE): Now functions, not macros.
4964 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4965 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4966 which are not functions. All uses rewritten to use:
4967 (make_emacs_time): New function.
4968 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4969 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4970 not functions. All uses rewritten to use the following, respectively:
4971 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4972 (add_emacs_time, sub_emacs_time): New functions.
4973 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4974 * fileio.c (Fcopy_file):
4975 * xterm.c (XTflash): Get the current time closer to when it's used.
4976 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4977
4978 * bytecode.c (targets): Suppress -Woverride-init warnings.
4979
4980 Simplify by avoiding confusing use of strncpy etc.
4981 * doc.c (Fsnarf_documentation):
4982 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4983 * frame.c (Fmake_terminal_frame):
4984 * gtkutil.c (get_utf8_string):
4985 * lread.c (openp):
4986 * nsmenu.m (ns_update_menubar):
4987 * regex.c (regerror):
4988 Prefer memcpy to strncpy and strncat when either will do.
4989 * fileio.c (Fsubstitute_in_file_name):
4990 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4991 (menu_separator_name_p):
4992 * nsmenu.m (ns_update_menubar):
4993 Prefer memcmp to strncmp when either will do.
4994 * nsterm.m: Include <ftoastr.h>.
4995 (ns_get_color):
4996 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4997 Prefer snprintf to strncpy.
4998 * nsterm.m (ns_term_init):
4999 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5000 * nsterm.m (ns_term_init):
5001 Avoid the need for strncpy, by using build_string or
5002 make_unibyte_string directly. Use dtoastr, not snprintf.
5003 * process.c (Fmake_network_process): Diagnose service names that
5004 are too long, rather than silently truncating them or creating
5005 non-null-terminated names.
5006 (Fnetwork_interface_info): Likewise, for interface names.
5007 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5008 Prefer sprintf to strncat.
5009 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5010 Prefer vsnprintf to vsprintf + strncpy.
5011
50122012-07-10 Glenn Morris <rgm@gnu.org>
5013
5014 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5015 Clarify fallback case.
5016
50172012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5018
5019 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5020 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5021 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5022 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5023 where argument type is known to be a Lisp_Cons.
5024
50252012-07-10 Tom Tromey <tromey@redhat.com>
5026
5027 * bytecode.c (BYTE_CODE_THREADED): New macro.
5028 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5029 (enum byte_code_op): New type.
5030 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5031 (exec_byte_code): Use them. Use token threading when applicable.
5032
50332012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5034
5035 Optimize pure C strings initialization.
5036 * lisp.h (make_pure_string): Fix prototype.
5037 (build_pure_c_string): New function, defined as static inline. This
5038 provides a better opportunity to optimize away calls to strlen when
5039 the function is called with compile-time constant argument.
5040 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5041 argument, adjust users accordingly. Use build_pure_c_string where
5042 appropriate.
5043 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5044 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5045 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5046
50472012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5048
5049 Avoid calls to strlen in miscellaneous functions.
5050 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5051 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5052 * lread.c (openp): Likewise.
5053
50542012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5055
5056 Avoid calls to strlen in path processing functions.
5057 * fileio.c (file_name_as_directory): Add comment. Change to add
5058 srclen argument and return the length of result. Adjust users
5059 accordingly.
5060 (directory_file_name): Fix comment. Change to add srclen argument,
5061 swap 1st and 2nd arguments to obey the common convention.
5062 Adjust users accordingly.
5063 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5064
50652012-07-10 Glenn Morris <rgm@gnu.org>
5066
5067 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5068 Move PENDING_OUTPUT_COUNT definition to configure.
5069
5070 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5071 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5072 * s/gnu.h (DATA_START): Move definitions to configure.
5073
5074 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5075 We include usg5-4-common.h, which defines them both.
5076
5077 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5078 O_RDONLY already includes it).
5079
5080 Stop ns builds setting the EMACSLOADPATH environment variable.
5081 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5082 Now it does not set EMACSLOADPATH, just returns the load-path string.
5083 * nsterm.h: Update accordingly.
5084 * lread.c [HAVE_NS]: Include nsterm.h.
5085 (init_lread) [HAVE_NS]: Use ns_load_path.
5086 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5087
50882012-07-09 Glenn Morris <rgm@gnu.org>
5089
5090 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5091 since the included bsd-common.h does so.
5092
5093 Stop ns builds setting the EMACSPATH environment variable.
5094 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5095 (ns_init_paths): Do not set EMACSPATH.
5096 * nsterm.h (ns_exec_path): Add it.
5097 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5098 Use ns_exec_path.
5099
5100 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5101
51022012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5103
5104 * process.c (wait_reading_process_output): 'waitchannels' was unset
5105 when read_kbd || !NILP (wait_for_cell); fix this.
5106
5107 Add GCC-style 'const' attribute to functions that can use it.
5108 * character.h (char_resolve_modifier_mask):
5109 * keyboard.h (make_ctrl_char):
5110 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5111 (init_character_once, next_almost_prime, init_fns, init_image)
5112 (flush_pending_output, init_sound):
5113 * mem-limits.h (start_of_data):
5114 * menu.h (finish_menu_items):
5115 Add ATTRIBUTE_CONST.
5116 * emacs.c (DEFINE_DUMMY_FUNCTION):
5117 Declare the dummy function with ATTRIBUTE_CONST.
5118 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5119 Add decls with ATTRIBUTE_CONST.
5120
5121 Minor improvements to make_formatted_string.
5122 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5123 where int is good enough, as vsprintf returns an int.
5124 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5125
51262012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5127
5128 Use make_formatted_string to avoid double length calculation.
5129 * lisp.h (make_formatted_string): New prototype.
5130 * alloc.c (make_formatted_string): New function.
5131 * buffer.c (Fgenerate_new_buffer_name): Use it.
5132 * dbus.c (syms_of_dbusbind): Likewise.
5133 * editfns.c (Fcurrent_time_zone): Likewise.
5134 * filelock.c (get_boot_time): Likewise.
5135 * frame.c (make_terminal_frame, set_term_frame_name)
5136 (x_report_frame_params): Likewise.
5137 * image.c (gs_load): Likewise.
5138 * minibuf.c (get_minibuffer): Likewise.
5139 * msdos.c (dos_set_window_size): Likewise.
5140 * process.c (make_process): Likewise.
5141 * xdisp.c (ensure_echo_area_buffers): Likewise.
5142 * xsettings.c (apply_xft_settings): Likewise.
5143
51442012-07-09 Glenn Morris <rgm@gnu.org>
5145
5146 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5147 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5148 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5149 * nsterm.h (ns_etc_directory): Add it.
5150 * callproc.c [HAVE_NS]: Include nsterm.h.
5151 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5152
51532012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5154
5155 Move marker debugging code under MARKER_DEBUG.
5156 * marker.c (MARKER_DEBUG): Move marker debugging code under
5157 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5158 for bootstrap with --enable-checking (~3x slowdown reported
5159 by Juanma Barranquero <lekktu@gmail.com>).
5160 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5161
51622012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5163
5164 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5165 See <http://bugs.gnu.org/11825#29>.
5166
51672012-07-08 Eli Zaretskii <eliz@gnu.org>
5168
5169 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5170 has no font, use the frame's font. (Bug#11813)
5171 (display_line): Add commentary about displaying truncation glyphs
5172 on GUI frames.
5173 (produce_special_glyphs): Move here from term.c.
5174
5175 * term.c (produce_special_glyphs): Move to xdisp.c.
5176
5177 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5178 section.
5179
51802012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5181
5182 * xdisp.c (display_line): Avoid warning about implicit declaration
5183 of FRAME_FONT.
5184
5185 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5186
5187 * lisp.h: Remove empty conditional.
5188
51892012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5190
5191 * lread.c (load_path_check): Now static.
5192
5193 Fix some minor --with-ns problems found by static checking.
5194 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5195 (x_set_font) [!HAVE_X_WINDOWS]:
5196 * image.c (xpm_load_image) [HAVE_NS]:
5197 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5198 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5199 Remove unused local.
5200 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5201 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5202 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5203 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5204 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5205 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5206 Fix pointer signedness problem.
5207 * xfaces.c (FRAME_X_FONT_TABLE):
5208 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5209
52102012-07-07 Glenn Morris <rgm@gnu.org>
5211
5212 * lread.c (load_path_check): New function, split from init_lread.
5213 (init_lread): Reorganize. Motivation:
5214 If EMACSLOADPATH is set, check/warn about that rather than the
5215 defaults, which we are not going to use. Hence we can remove
5216 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5217 Don't warn if site-lisp directories are missing.
5218 If not installed, start from a blank load-path, since
5219 PATH_LOADSEARCH refers to the eventual installation directories.
5220
52212012-07-07 Eli Zaretskii <eliz@gnu.org>
5222
5223 Support truncation and continuation glyphs on GUI frames, when
5224 fringes are disabled. (Bug#11832)
5225 * xdisp.c (init_iterator): Get dimensions of truncation and
5226 continuation glyphs even if on GUI frames.
5227 Adjust it->last_visible_x on GUI frames when the left or right fringes,
5228 or both, are absent.
5229 (start_display, move_it_in_display_line_to): Handle the case of a
5230 GUI frame without a fringe to display continuation or truncation
5231 glyphs.
5232 (insert_left_trunc_glyphs): Support GUI frames: make sure
5233 truncation glyphs overwrite enough glyphs from the current line to
5234 have sufficient space in pixels.
5235 (display_line): Support truncation and continuation glyphs on GUI
5236 frames. If some spare pixels are left on the line after inserting
5237 the truncation glyphs, fill that space with a stretch glyph of a
5238 suitably computed width.
5239
5240 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5241 produce_glyphs, to support GUI sessions.
5242
52432012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5244
5245 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5246
5247 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5248
5249 Do not require float-time's arg to fit in time_t (Bug#11825).
5250 This works better on hosts where time_t is unsigned, and where
5251 float-time is applied to the (negative) difference between two times.
5252 * editfns.c (decode_time_components): Last arg is now double *,
5253 not int *, and means to store all the result as a double, without
5254 worrying about whether the seconds part fits in time_t.
5255 All callers changed.
5256 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5257 All callers changed.
5258 (Ffloat_time): Do not fail merely because the specified time falls
5259 outside of time_t range.
5260
52612012-07-07 Glenn Morris <rgm@gnu.org>
5262
5263 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5264 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5265 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5266
52672012-07-07 Juanma Barranquero <lekktu@gmail.com>
5268
5269 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5270 Update dependencies.
5271
5272 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5273
52742012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5275
5276 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5277 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5278 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5279 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5280 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5281 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5282
5283 * xfont.c (compare_font_names): Redo to omit the need for casts.
5284
52852012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5286
5287 * xfns.c (Fx_change_window_property): Doc fix.
5288 * w32fns.c (Fx_change_window_property): Doc fix.
5289
5290 * w32fns.c (Fx_window_property): Accept the same arguments as the
5291 X Windows version. Doc fix.
5292 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5293
52942012-07-06 Juanma Barranquero <lekktu@gmail.com>
5295 Eli Zaretskii <eliz@gnu.org>
5296
5297 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5298 Windows-specific code from nt/config.nt moved here.
5299 Obsolete settings removed.
5300
53012012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5302
5303 * process.c: Avoid unnecessary calls to gettime.
5304 (wait_reading_process_output): Don't get the time of day
5305 when gobbling data immediately and not waiting, as there's no need
5306 for it in that case. This removes a FIXME.
5307
53082012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5309
5310 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5311 is defined (Bug#11768).
5312
53132012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5314
5315 Fix marker debugging code.
5316 * marker.c (byte_char_debug_check): Do not perform the check
5317 if buffer is not multibyte.
5318 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5319 Call byte_char_debug_check with correct arguments.
5320
53212012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5322
5323 Compile marker debugging code only if ENABLE_CHECKING is defined.
5324 * marker.c (byte_char_debug_check, count_markers):
5325 Use only if ENABLE_CHECKING is defined.
5326 (byte_debug_flag): Remove.
5327 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5328 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5329
53302012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5331
5332 Avoid code repetition in marker-related functions.
5333 * marker.c (attach_marker): New function.
5334 (Fset_marker, set_marker_restricted, set_marker_both)
5335 (set_marker_restricted_both): Use it.
5336 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5337 Consistently rename charno to charpos.
5338 (marker_position): Add eassert.
5339 (marker_byte_position): Convert to eassert.
5340
53412012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5342
5343 Simplify list operations in unchain_overlay and unchain_marker.
5344 * buffer.c (unchain_overlay): Simplify. Add comment.
5345 * marker.c (unchain_marker): Simplify. Fix comments.
5346
53472012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5348
5349 Introduce fast path for the widely used marker operation.
5350 * alloc.c (build_marker): New function.
5351 * lisp.h (build_marker): New prototype.
5352 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5353 * composite.c (autocmp_chars): Likewise.
5354 * editfns.c (buildmark): Remove.
5355 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5356 (save_restriction_save): Use build_marker.
5357 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5358 * window.c (save_window_save): Likewise.
5359
53602012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5361
5362 Do not use Fdelete_overlay in delete_all_overlays
5363 to avoid redundant calls to unchain_overlay.
5364 * buffer.c (drop_overlay): New function.
5365 (delete_all_overlays, Fdelete_overlay): Use it.
5366 * minibuf.c (get_minibuffer): Fix comment.
5367
53682012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5369
5370 Port to OpenBSD 5.1 amd64.
5371 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5372 This is needed for OpenBSD, and should be harmless on all BSD systems.
5373 Also, include <sys/sysctl.h>, as it should be available on all
5374 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5375 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5376 use p_pid member, not kp_proc.pid.
5377
53782012-07-06 Glenn Morris <rgm@gnu.org>
5379
5380 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5381
53822012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5383
5384 More xmalloc and related cleanup.
5385 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5386 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5387 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5388 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5389 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5390 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5391 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5392 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5393 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5394 * xterm.c:
5395 Omit needless casts involving void * pointers and allocation.
5396 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5397 as the former is more robust if P's type is changed.
5398 Prefer xzalloc to xmalloc + memset 0.
5399 Simplify malloc-or-realloc to realloc.
5400 Don't worry about xmalloc returning a null pointer.
5401 Prefer xstrdup to xmalloc + strcpy.
5402 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5403 growing it.
5404 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5405 alloca of a constant.
5406
54072012-07-05 Eli Zaretskii <eliz@gnu.org>
5408
5409 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5410 hscroll is larger than the line width. Fixes long and futile
5411 looping inside extend_face_to_end_of_line (on a TTY) producing
5412 glyphs that are not needed and thrown away.
5413
54142012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5415
5416 * marker.c (set_marker_restricted_both): Simplify by using
5417 clip_to_bounds.
5418
54192012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5420
5421 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5422
54232012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5424
5425 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5426 not defined (Bug#11768).
5427 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5428 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5429 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5430 followed by gtk_box_set_homogeneous (Bug#11768).
5431 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5432 (update_theme_scrollbar_width, xg_create_scroll_bar):
5433 Use gtk_scrollbar_new (Bug#11768).
5434 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5435 (is_box_type): New function (Bug#11768).
5436 (xg_tool_item_stale_p): Call is_box_type.
5437 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5438 with default display (Bug#11768).
5439
54402012-07-05 Eli Zaretskii <eliz@gnu.org>
5441
5442 * xdisp.c (window_hscroll_limited): New function.
5443 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5444 coordinates when window's hscroll is set to insanely large
5445 values. (Bug#11857)
5446
54472012-07-05 Juanma Barranquero <lekktu@gmail.com>
5448
5449 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5450 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5451
54522012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5453
5454 Cleanup xmalloc.
5455 * lisp.h (xzalloc): New prototype. Omit needless casts.
5456 * alloc.c (xzalloc): New function. Omit needless casts.
5457 * charset.c: Omit needless casts. Convert all calls to
5458 xmalloc with following memset to xzalloc.
5459 * dispnew.c: Likewise.
5460 * fringe.c: Likewise.
5461 * image.c: Likewise.
5462 * sound.c: Likewise.
5463 * term.c: Likewise.
5464 * w32fns.c: Likewise.
5465 * w32font.c: Likewise.
5466 * w32term.c: Likewise.
5467 * xfaces.c: Likewise.
5468 * xfns.c: Likewise.
5469 * xterm.c: Likewise.
5470 * atimer.c: Omit needless casts.
5471 * buffer.c: Likewise.
5472 * callproc.c: Likewise.
5473 * ccl.c: Likewise.
5474 * coding.c: Likewise.
5475 * composite.c: Likewise.
5476 * doc.c: Likewise.
5477 * doprnt.c: Likewise.
5478 * editfns.c: Likewise.
5479 * emacs.c: Likewise.
5480 * eval.c: Likewise.
5481 * filelock.c: Likewise.
5482 * fns.c: Likewise.
5483 * gtkutil.c: Likewise.
5484 * keyboard.c: Likewise.
5485 * lisp.h: Likewise.
5486 * lread.c: Likewise.
5487 * minibuf.c: Likewise.
5488 * msdos.c: Likewise.
5489 * print.c: Likewise.
5490 * process.c: Likewise.
5491 * region-cache.c: Likewise.
5492 * search.c: Likewise.
5493 * sysdep.c: Likewise.
5494 * termcap.c: Likewise.
5495 * terminal.c: Likewise.
5496 * tparam.c: Likewise.
5497 * w16select.c: Likewise.
5498 * w32.c: Likewise.
5499 * w32reg.c: Likewise.
5500 * w32select.c: Likewise.
5501 * w32uniscribe.c: Likewise.
5502 * widget.c: Likewise.
5503 * xdisp.c: Likewise.
5504 * xmenu.c: Likewise.
5505 * xrdb.c: Likewise.
5506 * xselect.c: Likewise.
5507
55082012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5509
5510 * fileio.c (time_error_value): Check the right error number.
5511 Problem reported by Troels Nielsen in
5512 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5513
55142012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5515
5516 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5517 This should be fixed in a better way; see Eli Zaretskii in
5518 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5519 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5520
5521 * fileio.c (time_error_value): Rename from special_mtime.
5522 The old name's problems were noted by Eli Zaretskii in
5523 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5524
5525 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5526 This variable's comment says Emacs needs at least one GDB-visible
5527 symbol of type enum pvec_type, to work around GDB problems.
5528 The symbol's value doesn't matter.
5529
5530 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5531 that causes compilation to fail on pre-C99 compilers.
5532
55332012-07-04 Juanma Barranquero <lekktu@gmail.com>
5534
5535 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5536 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5537
55382012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5539
5540 * buffer.c (init_buffer_once): Fix initialization of
5541 headers for buffer_defaults and buffer_local_symbols.
5542 Reported by Juanma Barranquero <lekktu@gmail.com>.
5543
55442012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5545
5546 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5547 * lisp.h (enum pvec_type): Use fewer bits.
5548 (PSEUDOVECTOR_SIZE_BITS): New constant.
5549 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5550 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5551 change in pvec_type.
5552 (PSEUDOVECTOR_TYPEP): New macro.
5553 (TYPED_PSEUDOVECTORP): Use it.
5554 * fns.c (internal_equal): Adapt code to extract pvectype.
5555 * emacs.c (gdb_pvec_type): Update type.
5556 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5557 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5558 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5559 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5560 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5561 abusing vector->header.next.nbytes.
5562 (live_vector_p): Use PVEC_TYPE.
5563 (mark_object): Adapt code to extract pvectype. Use switch.
5564
55652012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5566
5567 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5568 Tighten new eassert a bit.
5569
55702012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5571
5572 Fix compilation with --enable-gcc-warnings and -O1
5573 optimization level.
5574 * doprnt.c (doprnt): Change type of tem to int, initialize
5575 to avoid compiler warning. Add eassert.
5576 * search.c (simple_search): Initialize match_byte to avoid
5577 compiler warning. Add eassert.
5578
55792012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5580
5581 Avoid weird behavior with large horizontal scrolls.
5582 Without this change, for example, large hscroll values would
5583 mess up Emacs's display on Fedora 15 x86, presumably due to
5584 overflows in int calculations in the display code.
5585 Also, if buffers had long lines, Emacs would freeze.
5586 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5587 (set_window_hscroll): New function, containing the old guts of
5588 Fset_window_hscroll. Return the clipped value.
5589 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5590 This avoids the need to check against PTRDIFF_MAX.
5591
5592 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5593
55942012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5595
5596 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5597
55982012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5599
5600 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5601 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5602 since GCC 4.4.6 issues a bogus warning for them.
5603
5604 Fix bugs in file timestamp newness comparisons.
5605 * fileio.c (Ffile_newer_than_file_p):
5606 * lread.c (Fload): Use full timestamp resolution of files,
5607 not just the 1-second resolution, so that files that are only
5608 slightly newer still count as newer.
5609 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5610 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5611
56122012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5613
5614 * fileio.c: Improve handling of file time marker. (Bug#11852)
5615 (special_mtime): New function.
5616 (Finsert_file_contents, Fverify_visited_file_modtime):
5617 Use it to set special mtime values consistently.
5618
56192012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5620
5621 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5622 marker for non-existing file. (Bug#11852)
5623
56242012-07-03 Glenn Morris <rgm@gnu.org>
5625
5626 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5627 and did not make it into globals.h).
5628
56292012-07-03 Tom Tromey <tromey@redhat.com>
5630
5631 * window.c (Fset_window_margins, Fset_window_fringes)
5632 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5633 * textprop.c (Fprevious_property_change): No longer static.
5634 * syntax.c (Fsyntax_table_p): No longer static.
5635 * process.c (Fget_process, Fprocess_datagram_address): No longer
5636 static.
5637 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5638 * keyboard.c (Fcommand_execute): No longer static.
5639 Remove EXFUN.
5640 * insdel.c (Fcombine_after_change_execute): No longer static.
5641 * image.c (Finit_image_library): No longer static.
5642 * fileio.c (Fmake_symbolic_link): No longer static.
5643 * eval.c (Ffetch_bytecode): No longer static.
5644 * editfns.c (Fuser_full_name): No longer static.
5645 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5646 No longer static.
5647 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5648 static.
5649 * dired.c (Ffile_attributes): No longer static.
5650 * composite.c (Fcomposition_get_gstring): No longer static.
5651 * callproc.c (Fgetenv_internal): No longer static.
5652
5653 * ccl.h: Remove EXFUNs.
5654 * buffer.h: Remove EXFUNs.
5655 * dispextern.h: Remove EXFUNs.
5656 * intervals.h: Remove EXFUNs.
5657 * fontset.h: Remove EXFUN.
5658 * font.h: Remove EXFUNs.
5659 * dosfns.c (system_process_attributes): Remove EXFUN.
5660 * keymap.h: Remove EXFUNs.
5661 * lisp.h: Remove EXFUNs.
5662 * w32term.h: Remove EXFUNs.
5663 * window.h: Remove EXFUNs.
5664 * xsettings.h: Remove EXFUN.
5665 * xterm.h: Remove EXFUN.
5666
56672012-07-03 Glenn Morris <rgm@gnu.org>
5668
5669 * lisp.h (Frandom): Make it visible to C.
5670 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5671 buffer for invisible buffers. (Bug#1229)
5672
56732012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5674
5675 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5676 values which aren't power of 2.
5677 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5678 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5679 accordingly.
5680
56812012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5682
5683 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5684
5685 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5686
56872012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5688
5689 * alloc.c (allocate_vector_block): Remove redundant
5690 calls to mallopt if DOUG_LEA_MALLOC is defined.
5691 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5692 avoid calls to mallopt if zero_vector is returned.
5693
56942012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5695
5696 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5697 is enabled, avoid dereferencing NULL current_sblock if
5698 running undumped.
5699
57002012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5701
5702 Cleanup basic buffer management.
5703 * buffer.h (struct buffer): Change layout to use generic vector
5704 marking code. Fix some comments. Change type of 'clip_changed'
5705 to bitfield. Remove unused #ifndef old.
5706 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5707 (GET_OVERLAYS_AT): Fix indentation.
5708 (for_each_per_buffer_object_at): New macro.
5709 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5710 (Fbuffer_local_variables): Use it.
5711 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5712 * alloc.c (allocate_buffer): Adjust to match new layout of
5713 struct buffer. Fix comment.
5714 (mark_overlay): New function.
5715 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5716 Lisp area of struct buffer.
5717 (mark_object): Use it. Adjust marking of misc objects
5718 and related comments.
5719
57202012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5721
5722 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5723 wrapper that is not needed because the wrapped code is a no-op (zero
5724 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5725 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5726
57272012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5728
5729 * alloc.c (mark_buffer): Simplify. Remove prototype.
5730 (mark_object): Add comment. Reorganize marking of vector-like
5731 objects. Use CHECK_LIVE for all vector-like objects except buffers
5732 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5733 Avoid redundant calls to mark_vectorlike for bool vectors.
5734
57352012-06-30 Glenn Morris <rgm@gnu.org>
5736
5737 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5738
5739 * epaths.in (PATH_SITELOADSEARCH): New.
5740 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5741 This is rather than relying on --enable-locallisppath elements
5742 having "site-lisp" in their names. (Bug#10208#25, 11658)
5743
57442012-06-30 Eli Zaretskii <eliz@gnu.org>
5745
5746 * w32proc.c (sys_select): Accept and ignore one more argument.
5747
5748 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5749
5750 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5751 (pselect) [!MS_DOS]: Redirect to sys_select.
5752
5753 * sysdep.c: Don't include dos.h and dosfns.h.
5754
5755 * process.c (sys_select):
5756 * msdos.c (sys_select): Accept one more argument and ignore it.
5757
5758 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5759 adapt data types and code to that.
5760
5761 * dosfns.c:
5762 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5763 which clashes with the gnulib function of the same name.
5764
57652012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5766
5767 * font.c (font_style_to_value, font_style_symbolic)
5768 (font_prop_validate_style): Add type checks for values in
5769 font_style_table.
5770
5771 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5772 argument.
5773 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5774 uses.
5775
57762012-06-29 Eli Zaretskii <eliz@gnu.org>
5777
5778 * xdisp.c (try_window_id): Undo last change.
5779
5780 * w32.c (getwd): Adjust commentary about startup_dir.
5781 (init_environment): Always call sys_access, even in non-MSVC
5782 builds. Don't chdir to the directory of the Emacs executable.
5783 This undoes code from 1997 which was justified by the need to
5784 "avoid conflicts when removing and renaming directories". But its
5785 downside was that every relative file name was being interpreted
5786 relative to the directory of the Emacs executable, which can never
5787 be TRT. In particular, it broke sys_access when called with
5788 relative file names.
5789 (sys_access): Map GetLastError to errno.
5790
57912012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5792
5793 * window.h (struct window): Change type of 'fringes_outside_margins'
5794 to bitfield. Fix comment. Adjust users accordingly.
5795 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5796 Adjust comment.
5797 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5798 to ptrdiff_t.
5799
58002012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5801
5802 * gnutls.c (emacs_gnutls_handshake):
5803 Add QUIT to make the loop interruptible.
5804
58052012-06-29 Glenn Morris <rgm@gnu.org>
5806
5807 * charset.c (init_charset): Make lack of etc/charsets fatal.
5808
58092012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5810
5811 * editfns.c (region_limit): Fix type mismatch.
5812
58132012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5814
5815 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5816 undefined. Convert from xassert to eassert.
5817 * nsmenu.m: Convert from xassert to eassert.
5818 * nsterm.m: Likewise.
5819
58202012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5821
5822 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5823
58242012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5825
5826 Avoid integer overflow on scroll-left and scroll-right.
5827 * window.c (HSCROLL_MAX): New macro.
5828 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5829 overflow when requested scroll falls outside ptrdiff_t range.
5830
58312012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5832
5833 * window.h (struct window): Change type of 'hscroll',
5834 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5835 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5836 Adjust users accordingly.
5837 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5838 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5839 from EMACS_INT to ptrdiff_t.
5840 (make_window): Omit redundant initialization.
5841
58422012-06-28 Juanma Barranquero <lekktu@gmail.com>
5843
5844 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5845
58462012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5847
5848 * window.h (struct window): Change type of 'use_time' and
5849 'sequence_number' from Lisp_Object to int.
5850 * frame.c (make_frame): Adjust users accordingly.
5851 * print.c (print_object): Likewise.
5852 * window.c (select_window, Fwindow_use_time, make_parent_window)
5853 (make_window): Likewise.
5854
58552012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5856
5857 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5858 enabled with --enable-checking=[all,glyphs] configure option.
5859 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5860 adjust comments accordingly.
5861 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5862 undefined, adjust comments accordingly.
5863 * image.c: Likewise.
5864 * scroll.c: Likewise.
5865 * w32fns.c: Likewise.
5866 * w32term.c: Likewise.
5867 * xdisp.c: Likewise.
5868 * xfaces.c: Likewise.
5869 * xfns.c: Likewise.
5870 * xterm.c: Likewise.
5871
58722012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5873
5874 Generalize run-time debugging checks.
5875 * dispextern.h (XASSERTS): Remove.
5876 * fontset.c (xassert): Remove.
5877 Convert from xassert to eassert.
5878 * alloc.c: Convert from xassert to eassert.
5879 * bidi.c: Likewise.
5880 * dispnew.c: Likewise.
5881 * fns.c: Likewise.
5882 * fringe.c: Likewise.
5883 * ftfont.c: Likewise.
5884 * gtkutil.c: Likewise.
5885 * image.c: Likewise.
5886 * keyboard.c: Likewise.
5887 * menu.c: Likewise.
5888 * process.c: Likewise.
5889 * scroll.c: Likewise.
5890 * sound.c: Likewise.
5891 * term.c: Likewise.
5892 * w32console.c: Likewise.
5893 * w32fns.c: Likewise.
5894 * w32term.c: Likewise.
5895 * window.c: Likewise.
5896 * xdisp.c: Likewise.
5897 * xfaces.c: Likewise.
5898 * xfns.c: Likewise.
5899 * xselect.c: Likewise.
5900 * xterm.c: Likewise.
5901
59022012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5903
5904 * fns.c (maybe_resize_hash_table): Output message when growing the
5905 purify-hashtable.
5906
59072012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5908
5909 * alloc.c (allocate_string_data): Remove dead code.
5910 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5911 avoid GCC warning about unused macro.
5912
59132012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5914
5915 * alloc.c (allocate_string): Omit intervals initialization.
5916 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5917 as in make_pure_string and make_pure_c_string.
5918
59192012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5920
5921 * alloc.c (allocate_string): Fix last change.
5922
59232012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5924
5925 * alloc.c (allocate_string): Remove two redundant calls
5926 to memset, add explicit initialization where appropriate.
5927
59282012-06-27 Glenn Morris <rgm@gnu.org>
5929
5930 * lisp.mk (lisp): Remove paths.elc.
5931
59322012-06-27 Chong Yidong <cyd@gnu.org>
5933
5934 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5935
59362012-06-26 John Wiegley <johnw@newartisans.com>
5937
5938 * unexmacosx.c (copy_data_segment): Add two section names used
5939 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5940
5941 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5942 when building with Clang.
5943
59442012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5945
5946 * eval.c (Fapply): Allow calling it with a single argument.
5947
59482012-06-26 Eli Zaretskii <eliz@gnu.org>
5949
5950 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5951 _stricmp and _strnicmp.
5952 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5953
59542012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5955
5956 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5957 allocated window.
5958 (allocate_process): Likewise for new process.
5959 (allocate_terminal): Change to use offsetof.
5960 (allocate_frame): Likewise.
5961 * frame.c (make_frame): Omit redundant initialization.
5962 * window.c (make_parent_window): Use memset.
5963 (make_window): Omit redundant initialization.
5964 * process.c (make_process): Omit redundant initialization.
5965 * terminal.c (create_terminal): Likewise.
5966
59672012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5968
5969 * term.c (delete_tty): Remove redundant call to memset.
5970
59712012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5972
5973 * alloc.c: Remove build_string.
5974 * lisp.h: Define build_string as static inline. This provides
5975 a better opportunity to optimize away calls to strlen when the
5976 function is called with compile-time constant argument.
5977 * image.c (imagemagick_error): Convert to build_string.
5978 * w32proc.c (sys_spawnve): Likewise.
5979 * xterm.c (x_term_init): Likewise.
5980
59812012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5982
5983 Use sprintf return value instead of invoking strlen on result.
5984 In the old days this wasn't portable, since some sprintf
5985 implementations returned char *. But they died out years ago and
5986 Emacs already assumes sprintf returns int.
5987 Similarly for float_to_string.
5988 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5989 * ccl.c (ccl_driver):
5990 * character.c (string_escape_byte8):
5991 * data.c (Fnumber_to_string):
5992 * doprnt.c (doprnt):
5993 * print.c (print_object):
5994 * xdisp.c (message_dolog):
5995 * xfns.c (syms_of_xfns):
5996 Use sprintf or float_to_string result to avoid need to call strlen.
5997 * data.c (Fnumber_to_string):
5998 Use make_unibyte_string, since the string must be ASCII.
5999 * lisp.h, print.c (float_to_string): Now returns int length.
6000 * term.c (produce_glyphless_glyph):
6001 Use sprintf result rather than recomputing it.
6002
6003 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6004 * Makefile.in (ALL_CFLAGS):
6005 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6006 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6007
60082012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6009
6010 * dispextern.h (xstrcasecmp): Define to library function
6011 strcasecmp if available.
6012 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6013
60142012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6015
6016 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6017 Avoid comma operator.
6018 * menu.c (push_submenu_start, push_submenu_end)
6019 (push_left_right_boundary, push_menu_pane): Likewise.
6020 * msdos.c (dos_rawgetc): Likewise.
6021
60222012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6023
6024 * xfns.c (xic_create_fontsetname): Remove redundant calls
6025 to memset.
6026
60272012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6028
6029 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6030 sprintf already null-terminates its output.
6031
6032 * xfns.c (x_window): Remove redundant cast.
6033
60342012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6035
6036 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6037 `const char *' to `char *' to avoid compiler warning.
6038
60392012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6040
6041 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6042 instead of truncating it to 63 (admittedly a generous limit).
6043
6044 * process.c: Fix spelling and caps in comments.
6045
60462012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6047
6048 * emacs.c (setpgrp): Remove definition, unused.
6049 * sysdep.c (setpgrp): Remove definition, not used in this file.
6050
60512012-06-24 Juanma Barranquero <lekktu@gmail.com>
6052
6053 * makefile.w32-in: Update dependencies.
6054
60552012-06-24 Eli Zaretskii <eliz@gnu.org>
6056
6057 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6058 (SYSTIME_H): Add nt/inc/sys/time.h.
6059
6060 * systime.h [WINDOWSNT]: Include sys/time.h.
6061
6062 * s/ms-w32.h (struct timespec): Definition moved from
6063 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6064
60652012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6066
6067 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6068 * buffer.h (buffer_slot_type_mismatch):
6069 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6070 * eval.c (unwind_to_catch):
6071 * image.c (my_png_error, my_error_exit):
6072 * keyboard.c (quit_throw_to_read_char, user_error)
6073 (Fexit_recursive_edit, Fabort_recursive_edit):
6074 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6075 (wrong_type_argument, buffer_overflow, __executable_start)
6076 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6077 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6078 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6079 (fatal):
6080 (child_setup) [!DOS_NT]:
6081 * lread.c (end_of_file_error, invalid_syntax):
6082 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6083 * puresize.h (pure_write_error):
6084 * search.c (matcher_overflow):
6085 * sound.c (sound_perror, alsa_sound_perror):
6086 * sysdep.c, syssignal.h (croak):
6087 * term.c (maybe_fatal, vfatal):
6088 * textprop.c (text_read_only):
6089 * undo.c (user_error):
6090 * unexmacosx.c (unexec_error):
6091 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6092 Use _Noreturn rather than NO_RETURN.
6093 No need for separate decl merely because of _Noreturn.
6094 * sound.c (sound_warning, parse_sound):
6095 Remove unnecessary forward decls.
6096
60972012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6098
6099 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6100 * lisp.h (WAIT_READING_MAX): New macro.
6101 * dispnew.c (Fsleep_for, sit_for):
6102 * keyboard.c (kbd_buffer_get_event):
6103 * process.c (Faccept_process_output):
6104 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6105 This improves on the previous patch, which introduced a bug
6106 when time_t is unsigned and as wide as intmax_t.
6107 See <http://bugs.gnu.org/9000#51>.
6108
61092012-06-23 Eli Zaretskii <eliz@gnu.org>
6110
6111 * dispnew.c (sit_for, Fsleep_for):
6112 * keyboard.c (kbd_buffer_get_event):
6113 * process.c (Faccept_process_output): Avoid compiler warnings when
6114 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6115
61162012-06-23 Juanma Barranquero <lekktu@gmail.com>
6117
6118 * makefile.w32-in: Update dependencies.
6119
6120 * w32.c (ltime): Add return type and declare static.
6121 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6122
61232012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6124
6125 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6126 Privately reported by Herbert J. Skuhra.
6127 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6128 All uses changed.
6129 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6130 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6131
61322012-06-23 Eli Zaretskii <eliz@gnu.org>
6133
6134 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6135 last argument of make_unibyte_string.
6136
6137 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6138 language ID in the event parameters.
6139
6140 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6141 event.code, not the obscure "character set ID".
6142
61432012-06-23 Chong Yidong <cyd@gnu.org>
6144
6145 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6146
61472012-06-23 Eli Zaretskii <eliz@gnu.org>
6148
6149 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6150 * w32.c (fdutimens): New function.
6151
6152 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6153
6154 * s/ms-w32.h (pselect): Redirect to sys_select.
6155
6156 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6157
6158 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6159 in the logic of incrementing and decrementing the value of
6160 use_relocatable_buffers.
6161
61622012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6163
6164 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6165 Privately reported by Herbert J. Skuhra.
6166 [__FreeBSD__]: Remove "*/" typo after "#include".
6167 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6168 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6169 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6170 Don't assume EMACS_TIME and struct timeval are the same type.
6171
61722012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6173
6174 Support higher-resolution time stamps (Bug#9000).
6175 The time stamps are only nanosecond-resolution at the C level,
6176 since that's the best that any real-world system supports now.
6177 But they are picosecond-resolution at the Lisp level, as that's
6178 easy, and leaves room for future OS improvements.
6179
6180 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6181 (LIBES): Use it.
6182
6183 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6184 Don't get current time unless it's needed.
6185
6186 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6187 now provides it if it's absent.
6188 (start_atimer): Port to higher-res time stamps.
6189 Check for time stamp overflow. Don't get current time more
6190 often than is needed.
6191
6192 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6193 Include systime.h, not time.h.
6194 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6195
6196 * dired.c: Include stat-time.h.
6197 (Ffile-attributes): File times now have higher resolution.
6198
6199 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6200 (struct image): Timestamp now has higher resolution.
6201
6202 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6203 has at least microseconds now. All uses removed.
6204 (update_frame, update_single_window, update_window, update_frame_1)
6205 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
6206 (duration_to_sec_usec): Remove; no longer needed.
6207
6208 * editfns.c (time_overflow): Now extern.
6209 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6210 (float-time, Fformat_time_string, Fcurrent_time_string)
6211 (Fcurrent_time_zone): Accept and generate higher-resolution
6212 time stamps.
6213 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6214 (decode_time_components, lisp_seconds_argument): New functions.
6215 (make_time): Now static.
6216 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6217 Report an error if the time is invalid, rather than having the caller
6218 do that.
6219
6220 * fileio.c: Include <stat-time.h>
6221 (Fcopy_file): Copy higher-resolution time stamps.
6222 Prefer to set the time stamp via a file descriptor if that works.
6223 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6224 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6225 (Fvisited_file_modtime, Fset_visited_file_modtime):
6226 Support higher-resolution time stamps.
6227
6228 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6229
6230 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6231
6232 * image.c (prepare_image_for_display, clear_image_cache)
6233 (lookup_image): Port to higer-resolution time stamps.
6234
6235 * keyboard.c (start_polling, bind_polling_period):
6236 Check for time stamp overflow.
6237 (read_char, kbd_buffer_get_event, timer_start_idle)
6238 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6239 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6240 Port to higher-resolution time stamps. Do not assume time_t is signed.
6241 (decode_timer): New function. Timers are now vectors of length 9,
6242 not 8, to accommodate the picosecond component.
6243 (timer_check_2): Use it.
6244
6245 * nsterm.m (select_timeout, timeval_subtract): Remove.
6246 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6247 as they're a bit more accurate and handle overflow better.
6248 (ns_select): Change prototype to be compatible with pselect.
6249 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6250 * nsterm.h (ns_select): Adjust prototype.
6251
6252 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6253 us-resolution time stamps.
6254 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6255
6256 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6257
6258 * lisp.h (time_overflow): New decl.
6259 (wait_reading_process_output): First arg is now intmax_t, not int,
6260 to accommodate larger waits.
6261
6262 * process.h (struct Lisp_Process.read_output_delay):
6263 Now counts nanoseconds, not microseconds.
6264 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6265 EMACS_HAS_USECS.
6266 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6267 (wait_reading_process_output):
6268 Port to ns-resolution time stamps.
6269 (Faccept_process_output, wait_reading_process_output):
6270 Check for time stamp overflow. Do not assume time_t is signed.
6271 (select_wrapper): Remove; we now use pselect.
6272 (Fprocess_attributes): Now generates ns-resolution time stamps.
6273
6274 * sysdep.c: Include utimens.h. Don't include utime.h
6275 or worry about struct utimbuf; gnulib does that for us now.
6276 (gettimeofday): Remove; gnulib provides a substitute.
6277 (make_timeval): New function.
6278 (set_file_times): Now sets ns-resolution time stamps.
6279 New arg FD; all uses changed.
6280 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6281 (system_process_attributes):
6282 Now returns ns-resolution time stamp. All uses changed.
6283 Check for time stamp overflow.
6284
6285 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6286 provides a substitute now.
6287
6288 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6289 since it guarantees struct timespec.
6290 (EMACS_TIME): Now struct timespec, so that we can support
6291 ns-resolution time stamps.
6292 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6293 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6294 (EMACS_USECS): Remove.
6295 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6296 so multiply the arg by 1000 before storing it.
6297 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6298 New macros.
6299 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6300 Port to ns-resolution time stamps.
6301 (EMACS_TIME_NEG_P): Remove; replaced by....
6302 (EMACS_TIME_SIGN): New macro.
6303 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6304 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6305 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6306 (make_timeval, make_lisp_time, decode_time_components): New decls.
6307 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6308 that it mishandled time_t overflow. You can't compare by subtracting!
6309 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6310 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6311
6312 * term.c: Include <sys/time.h>.
6313 (timeval_to_Time): New function, for proper overflow wraparound.
6314 (term_mouse_position, term_mouse_click): Use it.
6315
6316 * undo.c (record_first_change): Support higher-resolution time stamps
6317 in the undo buffer.
6318 (Fprimitive_undo): Use them when restoring time stamps.
6319
6320 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6321 (w32_get_internal_run_time):
6322 Port to higher-resolution Emacs time stamps.
6323 (ltime): Now accepts single 64-bit integer, as that's more convenient
6324 for callers.
6325
6326 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6327
6328 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6329 for compatibility with pselect. Support ns-resolution time stamps.
6330
6331 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6332
6333 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6334 Check for time stamp overflow, and support ns-resolution time stamps.
6335
6336 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6337 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6338 (timeval_subtract): Remove; no longer needed.
6339 (XTflash, XTring_bell, x_wait_for_event):
6340 Port to ns-resolution time stamps. Don't assume time_t is signed.
6341
63422012-06-22 Chong Yidong <cyd@gnu.org>
6343
6344 * xdisp.c (x_consider_frame_title): Revert last change.
6345
63462012-06-22 Eli Zaretskii <eliz@gnu.org>
6347
6348 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6349 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6350 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6351 staticidx goes up to 1597 out of 1600 = 0x640.)
6352
63532012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6354
6355 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6356 Otherwise, the umask might be mistakenly 0 while handling input signals.
6357
63582012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6359
6360 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6361
63622012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6363
6364 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6365 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6366 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6367 access to `contents' member of Lisp_Vector objects with AREF and ASET
6368 where appropriate.
6369
63702012-06-19 Chong Yidong <cyd@gnu.org>
6371
6372 * frame.c (delete_frame): When selecting a frame on a different
6373 text terminal, do not alter the terminal's top-frame.
6374
6375 * xdisp.c (format_mode_line_unwind_data): Record the target
6376 frame's selected window and its terminal's top-frame.
6377 (unwind_format_mode_line): Restore them.
6378 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6379 Callers changed.
6380 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6381 since tty frames can be explicitly named.
6382 (prepare_menu_bars): Likewise.
6383
6384 * term.c (Ftty_top_frame): New function.
6385
63862012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6387
6388 Port byte-code-meter to modern targets.
6389 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6390 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6391 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6392 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6393 (METER_1, METER_2): Simplify.
6394
63952012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6396
6397 * data.c (Fdefalias): Return `symbol' (bug#11686).
6398
63992012-06-18 Martin Rudalics <rudalics@gmx.at>
6400
6401 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6402 gets killed during executing of this function (Bug#11665).
6403 Try to always return Qt when the buffer has been actually killed.
6404 (Vkill_buffer_query_functions): In doc-string say that functions
6405 run by this hook should not change the current buffer.
6406
64072012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6408
6409 Fix recently-introduced process.c problems found by static checking.
6410 * process.c (write_queue_push, write_queue_pop, send_process):
6411 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6412 (write_queue_pop): Fix pointer signedness problem.
6413 (send_process): Remove unused local.
6414
64152012-06-17 Chong Yidong <cyd@gnu.org>
6416
6417 * xdisp.c (redisplay_internal): No need to redisplay terminal
6418 frames that are not on top.
6419
64202012-06-17 Troels Nielsen <bn.troels@gmail.com>
6421
6422 * process.c (make_process): Initialize write_queue.
6423 (write_queue_push, write_queue_pop): New functions.
6424 (send_process): Use them to maintain correct ordering of process
6425 writes (Bug#10815).
6426
64272012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6428
6429 * lisp.h (eassert): Assume C89 or later.
6430 This removes the need for CHECK.
6431 (CHECK): Remove. Its comments about always evaluating its
6432 argument were confusing, as 'eassert' typically does not evaluate
6433 its argument.
6434
6435 * coding.c (produce_chars): Use ptrdiff_t, not int.
6436
6437 * xterm.c (x_draw_underwave): Check for integer overflow.
6438 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6439
64402012-06-17 Jan Djärv <jan.h.d@swipnet.se>
6441
6442 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6443 referenced (Bug#11583).
6444
64452012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6446
6447 Implement wave-style variant of underlining.
6448 * dispextern.h (face_underline_type): New enum.
6449 (face): Add field for underline type.
6450 * nsterm.m (ns_draw_underwave): New function.
6451 (ns_draw_text_decoration): Use it.
6452 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6453 New functions.
6454 (x_draw_glyph_string): Use them.
6455 * xfaces.c (Qline, Qwave): New Lisp objects.
6456 (check_lface_attrs, merge_face_ref)
6457 (Finternal_set_lisp_face_attribute, realize_x_face):
6458 Handle wave-style underline face attributes.
6459 * xterm.c (x_draw_underwave): New function.
6460 (x_draw_glyph_string): Use it.
6461
64622012-06-16 Juanma Barranquero <lekktu@gmail.com>
6463
6464 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6465 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6466 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6467 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6468 ($(BLD)/w32select.$(O)): Update dependencies.
6469
64702012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6471
6472 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6473 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6474 * character.c (_fetch_multibyte_char_p): Remove.
6475 * alloc.c: Include "character.h" before "buffer.h".
6476 * bidi.c: Likewise.
6477 * buffer.c: Likewise.
6478 * bytecode.c: Likewise.
6479 * callint.c: Likewise.
6480 * callproc.c: Likewise.
6481 * casefiddle.c: Likewise.
6482 * casetab.c: Likewise.
6483 * category.c: Likewise.
6484 * cmds.c: Likewise.
6485 * coding.c: Likewise.
6486 * composite.c: Likewise.
6487 * dired.c: Likewise.
6488 * dispnew.c: Likewise.
6489 * doc.c: Likewise.
6490 * dosfns.c: Likewise.
6491 * editfns.c: Likewise.
6492 * emacs.c: Likewise.
6493 * fileio.c: Likewise.
6494 * filelock.c: Likewise.
6495 * font.c: Likewise.
6496 * fontset.c: Likewise.
6497 * fringe.c: Likewise.
6498 * indent.c: Likewise.
6499 * insdel.c: Likewise.
6500 * intervals.c: Likewise.
6501 * keyboard.c: Likewise.
6502 * keymap.c: Likewise.
6503 * lread.c: Likewise.
6504 * macros.c: Likewise.
6505 * marker.c: Likewise.
6506 * minibuf.c: Likewise.
6507 * nsfns.m: Likewise.
6508 * nsmenu.m: Likewise.
6509 * print.c: Likewise.
6510 * process.c: Likewise.
6511 * regex.c: Likewise.
6512 * region-cache.c: Likewise.
6513 * search.c: Likewise.
6514 * syntax.c: Likewise.
6515 * term.c: Likewise.
6516 * textprop.c: Likewise.
6517 * undo.c: Likewise.
6518 * unexsol.c: Likewise.
6519 * w16select.c: Likewise.
6520 * w32fns.c: Likewise.
6521 * w32menu.c: Likewise.
6522 * window.c: Likewise.
6523 * xdisp.c: Likewise.
6524 * xfns.c: Likewise.
6525 * xmenu.c: Likewise.
6526 * xml.c: Likewise.
6527 * xselect.c: Likewise.
6528
65292012-06-16 Eli Zaretskii <eliz@gnu.org>
6530
6531 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6532 If all the glyphs of the glyph row came from strings, and we have no
6533 cursor positioning clues, put the cursor on the first glyph of the
6534 row.
6535 (handle_face_prop): Use chunk-relative overlay string index when
6536 indexing into it->string_overlays array. (Bug#11653)
6537 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6538 the rightmost. (Bug#11720)
6539
65402012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6541
6542 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6543 (CATEGORY_MEMBER): Enforce 1/0 value.
6544 * category.c (_temp_category_set): Remove.
6545
65462012-06-16 Eli Zaretskii <eliz@gnu.org>
6547
6548 * window.c (Fdelete_other_windows_internal)
6549 (Fdelete_window_internal): Don't access frame's mouse highlight
6550 info of the initial frame. (Bug#11677)
6551
65522012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6553
6554 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6555 Assume USE_2_TAGS_FOR_INTS.
6556 (xreload): Adjust $tagmask width to match recent lisp.h change.
6557
6558 Simplify lisp.h in minor ways that should not affect code.
6559 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6560 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6561 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6562 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6563 (INTTYPEBITS): New macro, for clarity.
6564 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6565 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6566 Simplify now that USE_LSB_TAG is always defined.
6567 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6568 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6569
65702012-06-13 Juanma Barranquero <lekktu@gmail.com>
6571
6572 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6573
65742012-06-13 Glenn Morris <rgm@gnu.org>
6575
6576 * s/bsd-common.h (BSD4_3):
6577 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6578
65792012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6580
6581 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6582 instead of union.
6583 (XLI, XIL): Define.
6584 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6585 Use them.
6586 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6587 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6588 * alloc.c (widen_to_Lisp_Object): Remove.
6589 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6590 * frame.c (delete_frame): Remove outdated comment.
6591 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6592 USE_LISP_UNION_TYPE.
6593 (Fw32_unregister_hot_key): Likewise.
6594 (Fw32_toggle_lock_key): Likewise.
6595 * w32menu.c (add_menu_item): Likewise.
6596 (w32_menu_display_help): Use XIL instead of checking
6597 USE_LISP_UNION_TYPE.
6598 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6599 (init_heap): Likewise.
6600 * w32term.c (w32_read_socket): Update comment.
6601
66022012-06-13 Glenn Morris <rgm@gnu.org>
6603
6604 * s/usg5-4-common.h, src/s/unixware.h:
6605 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6606
6607 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6608
66092012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6610
6611 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6612 * alloc.c (make_number) [!defined make_number]:
6613 Remove, as lisp.h always defines this now.
6614 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6615 (roundup_size): Verify that it is a power of 2.
6616 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6617 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6618 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6619 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6620 USE_LSB_TAG now is always defined to be either 0 or 1.
6621 All uses changed.
6622 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6623 code works fine either way, and efficiency is not a concern here,
6624 as the union type is for debugging, not for production.
6625 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6626 Use an inline function on all platforms when using the union type,
6627 since this is simpler and 'static inline' can be used portably
6628 within Emacs now.
6629 (LISP_INITIALLY_ZERO): New macro.
6630 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6631 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6632
66332012-06-12 Glenn Morris <rgm@gnu.org>
6634
6635 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6636
6637 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6638
6639 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6640 Move BROKEN_SIGIO to configure.
6641
6642 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6643 Move NO_TERMIO to configure.
6644
66452012-06-12 Chong Yidong <cyd@gnu.org>
6646
6647 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6648 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6649 MagickExportImagePixels is undefined.
6650
66512012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6652
6653 * image.c (imagemagick_load_image): Remove unused label.
6654
66552012-06-11 Glenn Morris <rgm@gnu.org>
6656
6657 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6658 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6659 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6660 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6661
66622012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6663
6664 * alloc.c (make_byte_code): New function.
6665 (Fmake_byte_code): Use it. Don't purify here.
6666 * lread.c (read1): Use it as well to avoid extra allocation.
6667
66682012-06-11 Chong Yidong <cyd@gnu.org>
6669
6670 * image.c (imagemagick_load_image): Implement transparency.
6671
66722012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6673
6674 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6675 account for preceding backslashes. (Bug#11663)
6676
66772012-06-09 Chong Yidong <cyd@gnu.org>
6678
6679 * term.c: Support italics in capable terminals (Bug#9652).
6680 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6681 (turn_on_face): Output using TS_enter_italic_mode if available.
6682 Don't handle unused blinking and alt-charset cases.
6683 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6684 and tty_alt_charset_p cases.
6685 (tty_capable_p, init_tty): Support italics.
6686
6687 * termchar.h (struct tty_display_info): Add field for italics.
6688 Remove unused blink field.
6689
6690 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6691 Handle slant.
6692
6693 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6694 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6695 tty_alt_charset_p. Add tty_italic_p.
6696
66972012-06-09 Michael Albinus <michael.albinus@gmx.de>
6698
6699 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6700 dbus_type_is_basic if available.
6701 (xd_extract_signed, xd_extract_unsigned): Rename from
6702 extract_signed and extract_unsigned, respectively. Adapt callers.
6703
67042012-06-09 Chong Yidong <cyd@gnu.org>
6705
6706 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6707
6708 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6709 case (Bug#9752).
6710
67112012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6712
6713 * xdisp.c (vmessage): Treat frame message as multibyte.
6714 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6715 would generate the diagnostic "Making \302\247 buffer-local while
6716 let-bound!".
6717
67182012-06-08 Eli Zaretskii <eliz@gnu.org>
6719
6720 * dispnew.c (showing_window_margins_p): Undo last change, which
6721 was done due to an inadvertent commit.
6722 (adjust_frame_glyphs_for_frame_redisplay): Do call
6723 showing_window_margins_p.
6724
67252012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6726
6727 * eval.c (Fmake_var_non_special): New primitive.
6728 (syms_of_eval): Defsubr it.
6729 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6730
67312012-06-08 Juanma Barranquero <lekktu@gmail.com>
6732
6733 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6734 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6735
67362012-06-08 Eli Zaretskii <eliz@gnu.org>
6737
6738 * alloc.c (allocate_vectorlike): Fix last change.
6739
67402012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6741
6742 Block-based vector allocation of small vectors.
6743 * lisp.h (struct vectorlike_header): New field `nbytes',
6744 adjust comment accordingly.
6745 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6746 to denote vector blocks. Adjust users (live_vector_p,
6747 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6748 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6749 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6750 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6751 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6752 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6753 (roundup_size): New constant.
6754 (struct vector_block): New data type.
6755 (vector_blocks, vector_free_lists, zero_vector): New variables.
6756 (all_vectors): Rename to `large_vectors'.
6757 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6758 (sweep_vectors): New functions.
6759 (allocate_vectorlike): Return `zero_vector' as the only vector of
6760 0 items. Allocate new vector from block if vector size is less than
6761 or equal to VBLOCK_BYTES_MAX.
6762 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6763 (init_alloc_once): Add call to init_vectors.
6764
67652012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6766
6767 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6768
67692012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6770
6771 * doprnt.c (doprnt): Truncate multibyte char correctly.
6772 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6773 would mishandle a string argument "Xc" if X was a multibyte
6774 character of length 2: it would truncate after X's first byte
6775 rather than including all of X.
6776
67772012-06-06 Chong Yidong <cyd@gnu.org>
6778
6779 * buffer.c (word_wrap): Doc fix.
6780
67812012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6782
6783 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6784
67852012-06-03 Glenn Morris <rgm@gnu.org>
6786
6787 * xdisp.c (tool-bar-style): Doc fix.
6788
67892012-06-03 Ulrich Müller <ulm@gentoo.org>
6790
6791 * Makefile.in (PAXCTL): Define.
6792 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6793 binary via PaX flags if the paxctl utility is available.
6794 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6795 Restore PaX flags to their default. (Bug#11398)
6796
67972012-06-03 Chong Yidong <cyd@gnu.org>
6798
6799 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6800 buffer (Bug#11226).
6801
68022012-06-03 Chong Yidong <cyd@gnu.org>
6803
6804 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6805 (note_mode_line_or_margin_highlight): If there is no help echo,
6806 use mode-line-default-help-echo. Handle the case where the mouse
6807 position is past the end of the mode line string.
6808
6809 * buffer.c (buffer_local_value_1): New function, split from
6810 Fbuffer_local_value; can return Qunbound.
6811 (Fbuffer_local_value): Use it.
6812 (Vmode_line_format): Docstring tweaks.
6813
68142012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6815
6816 * sysdep.c (system_process_attributes): Improve comment.
6817
68182012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6819
6820 * keyboard.c: Export real-this-command to Elisp.
6821 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6822 and DEFVAR it. Update all users.
6823
68242012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6825
6826 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6827
6828 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6829 Convert pctcpu and pctmem to Lisp float properly.
6830 Let the compiler fold better, as 100.0/0x8000 is exact.
6831
68322012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6833
6834 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6835 cons_block.
6836
68372012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6838
6839 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6840
68412012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6842
6843 For a 'struct window', replace some Lisp_Object fields to
6844 bitfields where appropriate, remove unused fields.
6845 * window.h (struct window): Remove unused 'last_mark_x' and
6846 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6847 change it's type from Lisp_Object to bitfield.
6848 Change type of 'force_start', 'optional_new_start',
6849 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6850 fields from Lisp_Object to bitfield. Adjust users accordingly.
6851
68522012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6853
6854 Pacify gcc -Wdouble-precision when using Xaw.
6855 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6856 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6857 Use 'float' consistently, rather than 'float' in most places
6858 and 'double' in a couple of places.
6859
68602012-05-31 Eli Zaretskii <eliz@gnu.org>
6861
6862 * xdisp.c (handle_stop): Detect whether we have overlay strings
6863 loaded by testing it->current.overlay_string_index to be
6864 non-negative, instead of checking whether n_overlay_strings is
6865 positive. (Bug#11587)
6866
68672012-05-31 Chong Yidong <cyd@gnu.org>
6868
6869 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6870
6871 * doc.c (Fsubstitute_command_keys): Doc fix.
6872
68732012-05-31 Eli Zaretskii <eliz@gnu.org>
6874
6875 * search.c (search_buffer): Remove calls to
6876 r_alloc_inhibit_buffer_relocation, as it is now called by
6877 maybe_unify_char, which was the cause of relocation of buffer text
6878 in bug#11519.
6879
68802012-05-31 Eli Zaretskii <eliz@gnu.org>
6881
6882 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6883 for the duration of call to load_charset, to avoid problems with
6884 callers of maybe_unify_char that access buffer text through C
6885 pointers.
6886
6887 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6888 decrement the inhibition flag, instead of just setting or
6889 resetting it.
6890
68912012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6892
6893 Remove obsolete '#define static' cruft.
6894 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6895 This #undef was "temporary" in 2000; it is no longer needed
6896 now that '#define static' has gone away.
6897 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6898 (gray_bitmap_bits): Remove; no longer needed.
6899 All uses replaced with definiens.
6900 * xterm.c: Include "bitmaps/gray.xbm".
6901
69022012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6903
6904 Clean up __executable_start, monstartup when --enable-profiling.
6905 The following changes affect the code only when profiling.
6906 * dispnew.c (__executable_start): Rename from safe_bcopy.
6907 Define only on platforms that need it.
6908 * emacs.c: Include <sys/gmon.h> when profiling.
6909 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6910 (__executable_start): Remove decl, since lisp.h does it now.
6911 (safe_bcopy): Remove decl; no longer has that name.
6912 (main): Coalesce #if into single bit of code, for simplicity.
6913 Cast pointers to uintptr_t, since standard libraries want integers
6914 and not pointers.
6915 * lisp.h (__executable_start): New decl.
6916
69172012-05-31 Glenn Morris <rgm@gnu.org>
6918
6919 * image.c (Fimagemagick_types): Doc fix.
6920
69212012-05-30 Jim Meyering <meyering@redhat.com>
6922
6923 * callproc.c (Fcall_process_region): Include directory component
6924 in mkstemp error message (Bug#11586).
6925
69262012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6927
6928 * alloc.c, lisp.h (make_pure_vector): Now static.
6929
69302012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6931
6932 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6933 Move to byte-run.el.
6934 (Fautoload): Do the hash-doc more carefully.
6935 * data.c (Fdefalias): Purify definition, except for keymaps.
6936 (Qdefun): Move from eval.c.
6937 * lisp.h (Qdefun): Remove.
6938 * lread.c (read1): Tiny simplification.
6939
69402012-05-29 Troels Nielsen <bn.troels@gmail.com>
6941
6942 Do not create empty overlays with the evaporate property (Bug#9642).
6943 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6944 Bug#9642, but explicitly check that the buffer the overlay would
6945 be moved to is live and rearrange lines to make sure that errors
6946 will not put the overlay in an inconsistent state.
6947 (Fdelete_overlay): Cosmetics.
6948
69492012-05-28 Eli Zaretskii <eliz@gnu.org>
6950
6951 * w32term.c (my_bring_window_to_top): New function.
6952 (x_raise_frame): Use handle returned by DeferWindowPos, which
6953 could be different from the original one.
6954 Call my_bring_window_to_top instead of my_set_foreground_window.
6955 (Bug#11513)
6956
6957 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6958 by calling BringWindowToTop.
6959
6960 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6961 (WM_EMACS_END): Increase by one.
6962
69632012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6964
6965 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6966 This avoids undefined behavior that might cause the eassert
6967 to not catch an out-of-range value.
6968
69692012-05-28 Juanma Barranquero <lekktu@gmail.com>
6970
6971 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6972 Update dependencies.
6973
69742012-05-27 Eli Zaretskii <eliz@gnu.org>
6975
6976 * bidi.c (bidi_mirror_char): Fix last change.
6977
69782012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6979
6980 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6981 when referring to sectname field in printf format.
6982
69832012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6984
6985 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6986 Only r_alloc_inhibit_buffer_relocation needed to be added;
6987 the others were already declared.
6988
6989 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6990 before checking whether it's out of range. Put the check inside
6991 eassert. See
6992 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6993
69942012-05-27 Ken Brown <kbrown@cornell.edu>
6995
6996 * callproc.c (Fcall_process): Restore a line that was accidentally
6997 commented out in the 2011-02-13 change (bug#11547).
6998
69992012-05-27 Eli Zaretskii <eliz@gnu.org>
7000
7001 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7002 defined on ralloc.c.
7003
7004 * buffer.c [REL_ALLOC]: Remove prototypes of
7005 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7006 they are now on lisp.h.
7007
7008 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7009
7010 * search.c (search_buffer): Use it to inhibit relocation of buffer
7011 text while re_search_2 is doing its job, because re_search_2 is
7012 passed C pointers to buffer text. (Bug#11519)
7013
7014 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7015 Update value to 24.
7016
7017 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7018 state after an additional call to move_it_in_display_line_to, keep
7019 the values of it->max_ascent and it->max_descent found for the
7020 entire line.
7021 (pos_visible_p): Revert the comparison against bottom_y to what it
7022 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7023 (Bug#11464)
7024
70252012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7026
7027 Fix coding-related core dumps with gcc -ftrapv.
7028 The code was computing A - B, where A and B are pointers, and B is
7029 random garbage. This can lead to core dumps on platforms that
7030 have special pointer registers, and it also leads to core dumps on
7031 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7032 A - B only when B is initialized properly.
7033 * coding.c (coding_set_source, coding_set_destination): Return void.
7034 (coding_change_source, coding_change_destinations): New functions,
7035 with the old behaviors of coding_set_source and coding_set_destination.
7036 All callers that need an offset changed to use these new functions.
7037
70382012-05-26 Glenn Morris <rgm@gnu.org>
7039
7040 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7041
70422012-05-26 Eli Zaretskii <eliz@gnu.org>
7043
7044 Extend mouse support on W32 text-mode console.
7045 * xdisp.c (draw_row_with_mouse_face):
7046 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7047
7048 * w32console.c: Include window.h.
7049 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7050 New functions.
7051 (initialize_w32_display): Initialize mouse-highlight data.
7052
7053 * w32inevt.c: Include termchar.h and window.h.
7054 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7055 moves, call note_mouse_highlight. If help_echo changed, call
7056 gen_help_event to produce help-echo message in the echo area.
7057 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7058 highlight info.
7059
70602012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7061
7062 * lread.c (read1): Simplify slightly to avoid an overflow warning
7063 with GCC 4.7.0 on x86-64.
7064
70652012-05-26 Eli Zaretskii <eliz@gnu.org>
7066
7067 * bidi.c (bidi_mirror_char): Revert last change: an int is
7068 definitely wide enough here.
7069
70702012-05-25 Paul Eggert <eggert@cs.ucla.edu>
7071
7072 Fix integer width and related bugs (Bug#9874).
7073 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7074 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7075 (string_bytes, check_sblock, allocate_string_data):
7076 (compact_small_strings, Fmake_bool_vector, make_string)
7077 (make_unibyte_string, make_multibyte_string)
7078 (make_string_from_bytes, make_specified_string)
7079 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7080 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7081 (mark_vectorlike):
7082 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7083 (allocate_pseudovector):
7084 Use int, not EMACS_INT, where int is wide enough.
7085 (inhibit_garbage_collection, Fgarbage_collect):
7086 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7087 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7088 int might not be wide enough.
7089 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7090 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7091 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7092 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7093 (bidi_level_of_next_char, bidi_move_to_visually_next):
7094 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7095 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7096 (Fkill_buffer, Fset_buffer_major_mode)
7097 (advance_to_char_boundary, Fbuffer_swap_text)
7098 (Fset_buffer_multibyte, overlays_at, overlays_in)
7099 (overlay_touches_p, struct sortvec, record_overlay_string)
7100 (overlay_strings, recenter_overlay_lists)
7101 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7102 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7103 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7104 (Foverlay_recenter, last_overlay_modification_hooks_used)
7105 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7106 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7107 (validate_region): Omit unnecessary test for b <= e,
7108 since that's guaranteed by the previous test.
7109 (adjust_overlays_for_delete): Avoid pos + length overflow.
7110 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7111 (report_overlay_modification):
7112 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7113 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7114 Omit pointer cast, which isn't needed anyway, and doesn't work
7115 after the EMACS_INT -> ptrdiff_t change.
7116 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7117 * buffer.h: Adjust decls to match defn changes elsewhere.
7118 (struct buffer_text, struct buffer):
7119 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7120 Use EMACS_INT, not int, where int might not be wide enough.
7121 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7122 not int, to avoid needless 32-bit limit on 64-bit hosts.
7123 (exec_byte_code): Use tighter memory-full test, one that checks
7124 for alloca overflow. Don't compute the address of the object just
7125 before an array, as that's not portable. Use EMACS_INT, not
7126 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7127 * callint.c (Fcall_interactively):
7128 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7129 * callproc.c (call_process_kill, Fcall_process):
7130 Don't assume pid_t fits into an Emacs fixnum.
7131 (call_process_cleanup, Fcall_process, child_setup):
7132 Don't assume pid_t fits into int.
7133 (call_process_cleanup, Fcall_process, delete_temp_file)
7134 (Fcall_process_region):
7135 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7136 (Fcall_process): Simplify handling of volatile integers.
7137 Use int, not EMACS_INT, where int will do.
7138 * casefiddle.c (casify_object, casify_region, operate_on_word)
7139 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7140 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7141 (casify_object): Avoid integer overflow when overallocating buffer.
7142 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7143 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
7144 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7145 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7146 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7147 integers are now checked earlier. All uses replaced with XINT.
7148 (ccl_driver):
7149 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7150 For CCL_MapSingle, check that content and value are in int range.
7151 (ccl_driver, Fregister_code_conversion_map):
7152 Check that Vcode_version_map_vector is a vector.
7153 (resolve_symbol_ccl_program): Check that vector header is in range.
7154 Always copy the vector, so that we can check its contents reliably
7155 now rather than having to recheck each instruction as it's being
7156 executed. Check that vector words fit in 'int'.
7157 (ccl_get_compiled_code, Fregister_ccl_program)
7158 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7159 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7160 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7161 contents are in range.
7162 (Fccl_execute_on_string): Check that status is in range.
7163 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7164 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7165 Accept and return EMACS_INT, not int, because callers can pass values
7166 out of 'int' range.
7167 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7168 (multibyte_chars_in_text, parse_str_as_multibyte)
7169 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7170 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7171 (string_escape_byte8, Fget_byte):
7172 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7173 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7174 avoid mishandling large integers.
7175 * character.h: Adjust decls to match defn changes elsewhere.
7176 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7177 (Ffind_charset_region):
7178 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7179 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7180 (load_charset_map_from_vector, Fdefine_charset_internal):
7181 Don't assume fixnum fits in int.
7182 (load_charset_map_from_vector, Fmap_charset_chars):
7183 Remove now-unnecessary CHECK_NATNUMs.
7184 (Fdefine_charset_internal): Check ranges here, more carefully.
7185 Don't rely on undefined behavior with signed left shift overflow.
7186 Don't assume unsigned int fits into fixnum, or that fixnum fits
7187 into unsigned int. Don't require max_code to be a valid fixnum;
7188 that's not true for gb10830 4-byte on a 32-bit host. Allow
7189 invalid_code to be a cons, for the same reason. Require code_offset
7190 to be a character. Avoid int overflow if max_char is close
7191 to INT_MAX.
7192 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7193 this is intended anyway and avoids some undefined behavior.
7194 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7195 INDEX_TO_CODE_POINT, as that's what it expects.
7196 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
7197 * charset.h (DECODE_CHAR): Return int, not unsigned;
7198 this is what was intended anyway, and it avoids undefined behavior.
7199 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7200 integer-overflow issues.
7201 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7202 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7203 where the argument is EMACS_INT, and this behavior is not intended.
7204 * chartab.c (Fmake_char_table, Fset_char_table_range)
7205 (uniprop_get_decoder, uniprop_get_encoder):
7206 Don't assume fixnum fits in int.
7207 * cmds.c (move_point): New function, that does the gist of
7208 Fforward_char and Fbackward_char, but does so while checking
7209 for integer overflow more accurately.
7210 (Fforward_char, Fbackward_char): Use it.
7211 (Fforward_line, Fend_of_line, internal_self_insert)
7212 (internal_self_insert):
7213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7214 Fix a FIXME, by checking for integer overflow when calculating
7215 target_clm and actual_clm.
7216 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
7217 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
7218 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7219 (coding_alloc_by_making_gap, alloc_destination)
7220 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7221 (encode_coding_utf_16, detect_coding_emacs_mule)
7222 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7223 (detect_coding_iso_2022, decode_coding_iso_2022)
7224 (encode_invocation_designation, encode_designation_at_bol)
7225 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7226 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7227 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7228 (encode_coding_ccl, encode_coding_raw_text)
7229 (detect_coding_charset, decode_coding_charset)
7230 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7231 (produce_composition, produce_charset, produce_annotation)
7232 (decode_coding, handle_composition_annotation)
7233 (handle_charset_annotation, consume_chars, decode_coding_gap)
7234 (decode_coding_object, encode_coding_object, detect_coding_system)
7235 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7236 (code_convert_region, code_convert_string)
7237 (Fdefine_coding_system_internal)
7238 (coding_set_source, coding_set_destination):
7239 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7240 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7241 (Fdefine_coding_system_internal):
7242 Don't assume fixnums fit in int.
7243 (decode_coding_gap, decode_coding_object, encode_coding_object)
7244 (Fread_coding_system, Fdetect_coding_region)
7245 (Funencodable_char_position, Fcheck_coding_systems_region)
7246 (get_translation, handle_composition_annotation, consume_chars):
7247 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7248 (consume_chars): Rewrite to not calculate an address outside buffer.
7249 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7250 Don't access memory outside of the args array.
7251 (Fdefine_coding_system_internal): Check for charset-id overflow.
7252 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7253 result of ENCODE_CHAR.
7254 * coding.h: Adjust decls to match defn changes elsewhere.
7255 (struct coding_system):
7256 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7257 * composite.c (get_composition_id, find_composition)
7258 (run_composition_function, update_compositions)
7259 (compose_text, composition_gstring_put_cache)
7260 (composition_gstring_p, composition_gstring_width)
7261 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7262 (composition_compute_stop_pos, composition_reseat_it)
7263 (composition_update_it, struct position_record)
7264 (find_automatic_composition, composition_adjust_point)
7265 (Fcomposition_get_gstring, Ffind_composition_internal):
7266 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7267 (update_compositions):
7268 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7269 * composite.h: Adjust decls to match defn changes elsewhere.
7270 (struct composition):
7271 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7272 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7273 Do not attempt to compute the address of the object just before a
7274 buffer; this is not portable.
7275 (Faref, Faset):
7276 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7277 (Faset): Use int, not EMACS_INT, where int is wide enough.
7278 (Fstring_to_number): Don't assume fixnums fit in int.
7279 (Frem): Don't assume arg is nonnegative.
7280 * dbusbind.c (xd_append_arg): Check for integers out of range.
7281 (Fdbus_call_method): Don't overflow the timeout int.
7282 (extract_signed, extract_unsigned): New functions.
7283 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7284 (xd_get_connection_references): Return ptrdiff_t, not int.
7285 All uses changed.
7286 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7287 (xd_read_message_1):
7288 Use int, not unsigned, where the dbus API uses int.
7289 (Fdbus_message_internal): Don't overflow mtype.
7290 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7291 * dired.c (directory_files_internal, file_name_completion, scmp)
7292 (file_name_completion_stat):
7293 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7294 (file_name_completion): Don't overflow matchcount.
7295 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7296 * dispextern.h: Adjust decls to match defn changes elsewhere.
7297 (struct text_pos, struct glyph, struct bidi_saved_info)
7298 (struct bidi_string_data, struct bidi_it, struct composition_it)
7299 (struct it):
7300 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7301 (struct display_pos, struct composition_it, struct it):
7302 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7303 * dispnew.c (increment_matrix_positions)
7304 (increment_row_positions, mode_line_string)
7305 (marginal_area_string):
7306 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7307 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7308 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7309 (duration_to_sec_usec): New function, to check for overflow better.
7310 (Fsleep_for, sit_for): Use it.
7311 * doc.c (get_doc_string, store_function_docstring):
7312 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7313 (get_doc_string, Fsnarf_documentation):
7314 Use int, not EMACS_INT, where int is wide enough.
7315 (get_doc_string):
7316 Use SAFE_ALLOCA, not alloca.
7317 Check for overflow when converting EMACS_INT to off_t.
7318 * doprnt.c (doprnt):
7319 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7320 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7321 Don't assume uid_t fits into fixnum.
7322 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7323 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7324 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7325 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7326 (general_insert_function)
7327 (Finsert_char, make_buffer_string, make_buffer_string_both)
7328 (update_buffer_properties, Fbuffer_substring)
7329 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7330 (Fsubst_char_in_region, check_translation)
7331 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7332 (transpose_markers, Ftranspose_regions):
7333 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7334 (clip_to_bounds): Move to lisp.h as an inline function).
7335 (Fconstrain_to_field): Don't assume integers are nonnegative.
7336 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7337 (Fsubst_char_in_region, Fsave_restriction):
7338 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7339 (Femacs_pid): Don't assume pid_t fits into fixnum.
7340 (lo_time): Use int, not EMACS_INT, when int suffices.
7341 (lisp_time_argument): Check for usec out of range.
7342 (Fencode_time): Don't assume fixnum fits in int.
7343 (Fuser_login_name, Fuser_full_name): Signal an error
7344 if a uid argument is out of range, rather than relying on
7345 undefined behavior.
7346 (Fformat_time_string): Remove now-unnecessary check.
7347 lisp_time_argument checks for out-of-range usec now.
7348 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7349 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7350 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7351 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7352 (init_cmdargs, Fdump_emacs):
7353 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7354 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7355 the bottom (typically) 32 bits of the fixnum.
7356 * eval.c (specpdl_size, call_debugger):
7357 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7358 (when_entered_debugger, Fbacktrace_debug):
7359 Don't assume fixnum can fit in int.
7360 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7361 the object just before a buffer; this is not portable.
7362 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7363 (grow_specpdl, unbind_to):
7364 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7365 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7366 (grow_specpdl): Simplify allocation by using xpalloc.
7367 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7368 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7369 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7370 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7371 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7372 (a_write, e_write):
7373 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7374 (Fcopy_file, non_regular_nbytes, read_non_regular)
7375 (Finsert_file_contents):
7376 Use int, not EMACS_INT, where int is wide enough.
7377 (READ_BUF_SIZE): Verify that it fits in int.
7378 (Finsert_file_contents): Check that counts are in proper range,
7379 rather than assuming fixnums fit into ptrdiff_t etc.
7380 Don't assume fixnums fit into int.
7381 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7382 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7383 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7384 (string_char_to_byte, string_byte_to_char)
7385 (string_make_multibyte, string_to_multibyte)
7386 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7387 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7388 (substring_both, Fdelete, internal_equal, Ffillarray)
7389 (Fclear_string, mapcar1)
7390 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7391 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7392 (larger_vector, make_hash_table, maybe_resize_hash_table)
7393 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7394 (Fmaphash, secure_hash):
7395 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7396 (concat): Check for string index and length overflow.
7397 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7398 (Frequire):
7399 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7400 (larger_vector): New API (vec, incr_min, size_max) replaces old
7401 one (vec, new_size, init). This catches size overflow.
7402 INIT was removed because it was always Qnil.
7403 All callers changed.
7404 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7405 the upper bound on a hash table index size.
7406 (make_hash_table, maybe_resize_hash_table): Use it.
7407 (secure_hash): Computer start_byte and end_byte only after
7408 they're known to be in ptrdiff_t range.
7409 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7410 (Ffont_get_glyphs, Ffont_at):
7411 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7412 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7413 (Flist_fonts, Fopen_font):
7414 Don't assume fixnum can fit in int.
7415 (check_gstring): Don't assume index can fit in int.
7416 (font_match_p): Check that fixnum is a character, not a nonnegative
7417 fixnum, since the later code needs to stuff it into an int.
7418 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7419 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7420 conversion overflow issues.
7421 (Fopen_font): Check for integer out of range.
7422 (Ffont_get_glyphs): Don't assume index can fit in int.
7423 * font.h: Adjust decls to match defn changes elsewhere.
7424 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7425 integer overflow.
7426 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7427 printmax_t, where ptrdiff_t is wide enough.
7428 (Finternal_char_font):
7429 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7430 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7431 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7432 (Fset_frame_position, x_set_frame_parameters)
7433 (x_set_line_spacing, x_set_border_width)
7434 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7435 Check that fixnums are in proper range for system types.
7436 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7437 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7438 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7439 Use SAFE_ALLOCA_LISP, not alloca.
7440 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7441 intptr_t is wide enough.
7442 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7443 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7444 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7445 Check for fixnum out of range.
7446 * ftfont.c (ftfont_list): Don't assume index fits in int.
7447 Check that fixnums are in proper range for system types.
7448 (ftfont_shape_by_flt):
7449 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7450 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7451 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7452 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7453 Check that fixnums are in proper range for system types.
7454 * gnutls.h: Adjust decls to match defn changes elsewhere.
7455 * gtkutil.c (xg_dialog_run):
7456 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7457 (update_frame_tool_bar):
7458 Check that fixnums are in proper range for system types.
7459 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7460 (lookup_image): Check that fixnums are in range for system types.
7461 * indent.c (last_known_column, last_known_column_point):
7462 (current_column_bol_cache):
7463 (skip_invisible, current_column, check_display_width):
7464 (check_display_width, scan_for_column, current_column_1)
7465 (Findent_to, Fcurrent_indentation, position_indentation)
7466 (indented_beyond_p, Fmove_to_column, compute_motion):
7467 (Fcompute_motion, Fvertical_motion):
7468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7469 (last_known_column_modified): Use EMACS_INT, not int.
7470 (check_display_width):
7471 (Fcompute_motion):
7472 Check that fixnums and floats are in proper range for system types.
7473 (compute_motion): Don't assume index or fixnum fits in int.
7474 (compute_motion, Fcompute_motion):
7475 Use int, not EMACS_INT, when it is wide enough.
7476 (vmotion): Omit local var start_hpos that is always 0; that way
7477 we don't need to worry about overflow in expressions involving it.
7478 * indent.h: Adjust decls to match defn changes elsewhere.
7479 (struct position):
7480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7481 Use int, not EMACS_INT, where int is wide enough.
7482 Remove unused members ovstring_chars_done and tab_offset;
7483 all uses removed.
7484 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7485 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7486 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7487 (make_gap, copy_text, insert, insert_and_inherit)
7488 (insert_before_markers, insert_before_markers_and_inherit)
7489 (insert_1, count_combining_before, count_combining_after)
7490 (insert_1_both, insert_from_string)
7491 (insert_from_string_before_markers, insert_from_string_1)
7492 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7493 (adjust_after_replace, adjust_after_insert, replace_range)
7494 (replace_range_2, del_range, del_range_1, del_range_byte)
7495 (del_range_both, del_range_2, modify_region)
7496 (prepare_to_modify_buffer, signal_before_change)
7497 (signal_after_change, Fcombine_after_change_execute):
7498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7499 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7500 (balance_an_interval, split_interval_right, split_interval_left)
7501 (find_interval, next_interval, update_interval)
7502 (adjust_intervals_for_insertion, delete_node, delete_interval)
7503 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7504 (static_offset_intervals, offset_intervals)
7505 (merge_interval_right, merge_interval_left, make_new_interval)
7506 (graft_intervals_into_buffer, temp_set_point_both)
7507 (temp_set_point, set_point, adjust_for_invis_intang)
7508 (set_point_both, move_if_not_intangible, get_property_and_range)
7509 (get_local_map, copy_intervals, copy_intervals_to_string)
7510 (compare_string_intervals, set_intervals_multibyte_1):
7511 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7512 * intervals.h: Adjust decls to match defn changes elsewhere.
7513 (struct interval):
7514 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7515 * keyboard.c (this_command_key_count, this_single_command_key_start)
7516 (before_command_key_count, before_command_echo_length, echo_now)
7517 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7518 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7519 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7520 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7521 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7522 (last_non_minibuf_size, last_point_position, echo_truncate)
7523 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7524 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7525 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7526 (stuff_buffered_input):
7527 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7528 (last_auto_save, command_loop_1, read_char):
7529 Use EMACS_INT, not int, to avoid integer overflow.
7530 (record_char): Avoid overflow in total_keys computation.
7531 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7532 * keyboard.h: Adjust decls to match defn changes elsewhere.
7533 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7534 (Fkey_description, Fdescribe_vector, Flookup_key):
7535 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7536 (click_position): New function, to check that positions are in range.
7537 (Fcurrent_active_maps):
7538 (describe_command):
7539 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7540 (Faccessible_keymaps, Fkey_description):
7541 (preferred_sequence_p):
7542 Don't assume fixnum can fit into int.
7543 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7544 Check for integer overflow in size calculations.
7545 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7546 avoid mishandling large integers.
7547 * lisp.h: Adjust decls to match defn changes elsewhere.
7548 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7549 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7550 (struct Lisp_Marker):
7551 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7552 (clip_to_bounds): Now an inline function, moved here from editfns.c.
7553 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7554 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7555 All callers changed.
7556 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7557 Assume the arg has valid form, since it always does.
7558 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7559 unsigned integer system type.
7560 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7561 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7562 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7563 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7564 (duration_to_sec_usec): New decl.
7565 * lread.c (read_from_string_index, read_from_string_index_byte)
7566 (read_from_string_limit, readchar, unreadchar, openp)
7567 (read_internal_start, read1, oblookup):
7568 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7569 (Fload, readevalloop, Feval_buffer, Feval_region):
7570 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7571 (openp): Check for out-of-range argument to 'access'.
7572 (read1): Use int, not EMACS_INT, where int is wide enough.
7573 Don't assume fixnum fits into int.
7574 Fix off-by-one error that can read outside a buffer.
7575 (read_filtered_event): Use duration_to_sec_usec
7576 to do proper overflow checking on durations.
7577 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7578 in size calculation.
7579 (Fexecute_kbd_macro):
7580 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7581 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7582 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7583 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7584 (set_marker_both, set_marker_restricted_both, marker_position)
7585 (marker_byte_position, Fbuffer_has_markers_at):
7586 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7587 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7588 * menu.c (ensure_menu_items): Rename from grow_menu_items.
7589 It now merely ensures that the menu is large enough, without
7590 necessarily growing it, as this avoids some integer overflow issues.
7591 All callers changed.
7592 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7593 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7594 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7595 Use SAFE_ALLOCA_LISP, not alloca.
7596 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7597 to EMACS_INT. Check that fixnums are in proper range for system types.
7598 * minibuf.c (minibuf_prompt_width, string_to_object)
7599 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7600 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7601 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7602 (get_minibuffer, read_minibuf_unwind):
7603 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7604 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7605 this simplifies overflow checking. All callers changed.
7606 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7607 (Ftest_completion):
7608 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7609 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7610 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7611 Check that fixnums are in proper range for system types.
7612 (Fx_create_frame, Fx_show_tip):
7613 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7614 * nsfont.m (ns_findfonts, nsfont_list_family):
7615 Don't assume fixnum fits in long.
7616 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7617 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7618 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7619 wide enough.
7620 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7621 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7622 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7623 (PRINTDECLARE, PRINTPREPARE):
7624 (strout, print_string):
7625 (print, print_preprocess, print_check_string_charset_prop)
7626 (print_object):
7627 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7628 (PRINTDECLARE):
7629 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7630 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7631 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7632 (printchar, strout): Use xpalloc to catch size calculation overflow.
7633 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7634 (print_error_message): Use SAFE_ALLOCA, not alloca.
7635 (print_object): Use int, not EMACS_INT, where int is wide enough.
7636 (print_depth, new_backquote_output, print_number_index):
7637 Use ptrdiff_t, not int, where int might not be wide enough.
7638 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7639 (Fset_process_window_size, Fformat_network_address)
7640 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7641 (sigchld_handler):
7642 Check that fixnums are in proper range for system types.
7643 (Fsignal_process): Simplify by avoiding a goto.
7644 Check for process-ids out of pid_t range rather than relying on
7645 undefined behavior.
7646 (process_tick, update_tick): Use EMACS_INT, not int.
7647 (Fformat_network_address, read_process_output, send_process)
7648 (Fprocess_send_region, status_notify):
7649 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7650 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7651 (wait_reading_process_output, read_process_output, exec_sentinel):
7652 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7653 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7654 (Faccept_process_output): Use duration_to_sec_usec to do proper
7655 overflow checking on durations.
7656 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7657 Don't assume pid_t fits in int.
7658 * process.h (struct Lisp_Process): Members tick and update_tick
7659 are now of type EMACS_INT, not int.
7660 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7661 configured --with-wide-int.
7662 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7663 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7664 * search.c (looking_at_1, string_match_1):
7665 (fast_string_match, fast_c_string_match_ignore_case)
7666 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7667 (scan_newline, find_before_next_newline, search_command)
7668 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7669 (set_search_regs, wordify):
7670 (Freplace_match):
7671 (Fmatch_data):
7672 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7673 (string_match_1, search_buffer, set_search_regs):
7674 (Fmatch_data):
7675 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7676 (wordify): Check for overflow in size calculation.
7677 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7678 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7679 Check that fixnums are in proper range for system types.
7680 * sound.c (struct sound_device)
7681 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7682 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7683 (Fplay_sound_internal):
7684 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7685 * syntax.c (struct lisp_parse_state, find_start_modiff)
7686 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7687 (Fparse_partial_sexp):
7688 Don't assume fixnums can fit in int.
7689 (struct lisp_parse_state, find_start_pos, find_start_value)
7690 (find_start_value_byte, find_start_begv)
7691 (update_syntax_table, char_quoted, dec_bytepos)
7692 (find_defun_start, prev_char_comend_first, back_comment):
7693 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7694 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7695 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7696 (Finternal_describe_syntax_value): Check that match_lisp is a
7697 character, not an integer, since the code stuffs it into int.
7698 (scan_words, scan_sexps_forward):
7699 Check that fixnums are in proper range for system types.
7700 (Fforward_word):
7701 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7702 (scan_sexps_forward):
7703 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7704 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7705 * syntax.h: Adjust decls to match defn changes elsewhere.
7706 (struct gl_state_s):
7707 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7708 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7709 MOST_POSITIVE_FIXNUM.
7710 * sysdep.c (wait_for_termination_1, wait_for_termination)
7711 (interruptible_wait_for_termination, mkdir):
7712 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7713 (emacs_read, emacs_write):
7714 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7715 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7716 and double all fit in int.
7717 * term.c (set_tty_color_mode):
7718 Check that fixnums are in proper range for system types.
7719 * termhooks.h (struct input_event):
7720 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7721 * textprop.c (validate_interval_range, interval_of)
7722 (Fadd_text_properties, set_text_properties_1)
7723 (Fremove_text_properties, Fremove_list_of_text_properties)
7724 (Ftext_property_any, Ftext_property_not_all)
7725 (copy_text_properties, text_property_list, extend_property_ranges)
7726 (verify_interval_modification):
7727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7728 (Fnext_single_char_property_change)
7729 (Fprevious_single_char_property_change):
7730 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7731 (copy_text_properties):
7732 Check for integer overflow in index calculation.
7733 * undo.c (last_boundary_position, record_point, record_insert)
7734 (record_delete, record_marker_adjustment, record_change)
7735 (record_property_change):
7736 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7737 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7738 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7739 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7740 (Fx_hide_tip, Fx_file_dialog):
7741 * w32menu.c (set_frame_menubar):
7742 Use ptrdiff_t, not int, for consistency with rest of code.
7743 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7744 (select_window, Fdelete_other_windows_internal)
7745 (window_scroll_pixel_based, window_scroll_line_based)
7746 (Frecenter, Fset_window_configuration):
7747 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7748 (Fset_window_hscroll, run_window_configuration_change_hook)
7749 (set_window_buffer, temp_output_buffer_show, scroll_command)
7750 (Fscroll_other_window, Frecenter):
7751 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7752 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7753 Don't assume fixnum fits in int.
7754 (Fset_window_scroll_bars):
7755 Check that fixnums are in proper range for system types.
7756 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7757 (string_pos, c_string_pos, number_of_chars, init_iterator)
7758 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7759 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7760 (compute_display_string_end, handle_face_prop)
7761 (face_before_or_after_it_pos, handle_invisible_prop)
7762 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7763 (display_prop_intangible_p, string_buffer_position_lim)
7764 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7765 (get_overlay_strings_1, get_overlay_strings)
7766 (iterate_out_of_display_property, forward_to_next_line_start)
7767 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7768 (get_next_display_element, set_iterator_to_next)
7769 (get_visually_first_element, compute_stop_pos_backwards)
7770 (handle_stop_backwards, next_element_from_buffer)
7771 (move_it_in_display_line_to, move_it_in_display_line)
7772 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7773 (add_to_log, message_dolog, message_log_check_duplicate)
7774 (message2, message2_nolog, message3, message3_nolog
7775 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7776 (current_message_1, truncate_echo_area, truncate_message_1)
7777 (set_message, set_message_1, store_mode_line_noprop)
7778 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7779 (text_outside_line_unchanged_p, check_point_in_composition)
7780 (reconsider_clip_changes)
7781 (redisplay_internal, set_cursor_from_row, try_scrolling)
7782 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7783 (redisplay_window, find_last_unchanged_at_beg_row)
7784 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7785 (trailing_whitespace_p, find_row_edges, display_line)
7786 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7787 (display_mode_element, store_mode_line_string)
7788 (pint2str, pint2hrstr, decode_mode_spec)
7789 (display_count_lines, display_string, draw_glyphs)
7790 (x_produce_glyphs, x_insert_glyphs)
7791 (rows_from_pos_range, mouse_face_from_buffer_pos)
7792 (fast_find_string_pos, mouse_face_from_string_pos)
7793 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7794 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7795 (safe_call, init_from_display_pos, handle_fontified_prop)
7796 (handle_single_display_spec, load_overlay_strings)
7797 (with_echo_area_buffer, setup_echo_area_for_printing)
7798 (display_echo_area, echo_area_display)
7799 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7800 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7801 (redisplay_window, dump_glyph_row, display_mode_line)
7802 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7803 (handle_display_spec, display_prop_string_p):
7804 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7805 (handle_single_display_spec, build_desired_tool_bar_string)
7806 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7807 (get_specified_cursor_type):
7808 Check that fixnums are in proper range for system types.
7809 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7810 (Flookup_image_map):
7811 Don't assume fixnums fit in int.
7812 (compare_overlay_entries):
7813 Avoid mishandling comparisons due to subtraction overflow.
7814 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7815 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7816 (handle_tool_bar_click):
7817 Use int, not unsigned, since we prefer signed and the signedness
7818 doesn't matter here.
7819 (get_next_display_element, next_element_from_display_vector):
7820 Use int, not EMACS_INT, when int is wide enough.
7821 (start_hourglass): Use duration_to_sec_usec to do proper
7822 overflow checking on durations.
7823 * xfaces.c (Fbitmap_spec_p):
7824 Check that fixnums are in proper range for system types.
7825 (compare_fonts_by_sort_order):
7826 Avoid mishandling comparisons due to subtraction overflow.
7827 (Fx_family_fonts, realize_basic_faces):
7828 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7829 (Fx_family_fonts):
7830 Don't assume fixnum fits in int.
7831 Use SAFE_ALLOCA_LISP, not alloca.
7832 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7833 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7834 (face_at_buffer_position, face_for_overlay_string)
7835 (face_at_string_position):
7836 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7837 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7838 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7839 (Fx_show_tip):
7840 Check that fixnums are in proper range for system types.
7841 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7842 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7843 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7844 (Fx_change_window_property): Don't assume fixnums fit in int.
7845 * xfont.c (xfont_chars_supported):
7846 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7847 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7848 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7849 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7850 * xml.c (parse_region):
7851 * xrdb.c (magic_file_p):
7852 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7853 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7854 (x_get_local_selection, x_reply_selection_request)
7855 (x_handle_selection_request, wait_for_property_change):
7856 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7857 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7858 short is wide enough.
7859 (x_send_client_event): Don't assume fixnum fits in int.
7860 * xterm.c (x_x_to_emacs_modifiers):
7861 Don't assume EMACS_INT overflows nicely into int.
7862 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7863 may come from Lisp.
7864 (handle_one_xevent): NATNUMP can eval its arg twice.
7865 (x_connection_closed):
7866 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7867 * xterm.h: Adjust decls to match defn changes elsewhere.
7868 (struct scroll_bar): Use struct vectorlike_header
7869 rather than rolling our own approximation.
7870 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7871
78722012-05-25 Glenn Morris <rgm@gnu.org>
7873
7874 * lisp.mk (lisp): Update for more files being compiled now.
7875
78762012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7877
7878 * lread.c: Remove `read_pure' which makes no difference.
7879 (read_pure): Remove var.
7880 (unreadpure): Remove function.
7881 (readevalloop): Don't call read_list with -1 flag.
7882 (read1, read_vector): Don't test read_pure any more.
7883 (read_list): Simplify.
7884
7885 * fileio.c, character.h: Minor style tweaks.
7886
78872012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7888
7889 * window.h (clip_changed): Remove useless declaration.
7890
78912012-05-22 Juanma Barranquero <lekktu@gmail.com>
7892
7893 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7894 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7895
78962012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7897
7898 Remove src/m/*.
7899 This directory predates autoconf and is no longer needed nowadays.
7900 Move its few remaining bits of functionality to where they're needed.
7901 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7902 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7903 * m/template.h: Remove.
7904 * Makefile.in (M_FILE): Remove. All uses removed.
7905 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7906 * lisp.h (USE_LSB_TAG):
7907 * mem-limits.h (EXCEEDS_LISP_PTR):
7908 Use VAL_MAX, not VALBITS, in #if.
7909 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7910 (EMACS_UINT): Define unconditionally now.
7911 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7912 (BITS_PER_EMACS_INT): New constants, replacing
7913 what used to be in config.h, but not useful in #if.
7914 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7915 define them any more.
7916 (VAL_MAX): New macro.
7917 (VALMASK): Use it.
7918 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7919 BITS_PER_EMACS_INT, in #if.
7920 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7921 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7922 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7923 * s/ms-w32.h (DATA_START):
7924 Move here from removed file m/intel386.h.
7925 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7926 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7927
79282012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7929
7930 Assume C89 or later.
7931 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7932 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7933 (xrealloc):
7934 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7935 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7936 * textprop.c, tparam.c (NULL): Remove.
7937 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7938 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7939 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7940 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7941 * xterm.c (input_signal_count): Assume volatile works.
7942
79432012-05-21 Ken Brown <kbrown@cornell.edu>
7944
7945 * xgselect.c (xg_select): Fix first argument in call to 'select'
7946 (bug#11508).
7947
79482012-05-20 Ken Brown <kbrown@cornell.edu>
7949
7950 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7951 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7952
79532012-05-19 Ken Brown <kbrown@cornell.edu>
7954
7955 * xfns.c (x_in_use): Remove `static' qualifier.
7956 * xterm.h (x_in_use): Declare.
7957 * xgselect.c: Include xterm.h.
7958 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7959 and `display_arg' (bug#9754).
7960
79612012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7962
7963 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7964
7965 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7966 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7967
79682012-05-18 Eli Zaretskii <eliz@gnu.org>
7969
7970 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7971
7972 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7973 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7974
7975 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7976 reference to image_cache->refcount.
7977 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7978
79792012-05-17 Juri Linkov <juri@jurta.org>
7980
7981 * search.c (Fword_search_regexp, Fword_search_backward)
7982 (Fword_search_forward, Fword_search_backward_lax)
7983 (Fword_search_forward_lax): Move functions to isearch.el
7984 (bug#10145, bug#11381).
7985
79862012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7987
7988 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7989
79902012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7991
7992 * lread.c (init_obarray): Declare Qt and Qnil as special.
7993
79942012-05-14 Glenn Morris <rgm@gnu.org>
7995
7996 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7997 Put "libexec" before "bin", for the sake of init_callproc_1.
7998
79992012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8000
8001 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8002
8003 * unexaix.c: Port to more-recent AIX compilers.
8004 (report_error, report_error_1, make_hdr, copy_sym)
8005 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8006 Make arguments const char *, not char *, to avoid violations of C
8007 standard and to fix some AIX warnings reported by Gilles Pion.
8008
80092012-05-14 Eli Zaretskii <eliz@gnu.org>
8010
8011 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8012 already have overlays loaded.
8013 (handle_single_display_spec): Before returning without displaying
8014 fringe bitmap, synchronize the bidi iterator with the main display
8015 iterator, by calling iterate_out_of_display_property.
8016 (iterate_out_of_display_property): Detect buffer iteration by
8017 testing that it->string is a Lisp string.
8018 (get_next_display_element): When the current object is exhausted,
8019 and there's something on it->stack, call set_iterator_to_next to
8020 proceed with what's on the stack, instead of returning zero.
8021 (set_iterator_to_next): If called at the end of a Lisp string,
8022 proceed to consider_string_end without incrementing string
8023 position. Don't increment display vector index past the end of
8024 the display vector. (Bug#11417)
8025 (pos_visible_p): Don't report a position visible when move_it_to
8026 stopped at the last line of window, which happens to be scanned
8027 backwards by the bidi iteration. (Bug#11464)
8028
80292012-05-14 Eli Zaretskii <eliz@gnu.org>
8030
8031 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8032 and right-margin display specs even if the spec is invalid or we
8033 are on a TTY, and thus unable to display on the fringes.
8034 That's because the text with the property will not be displayed anyway,
8035 so we need to signal to the caller that this is a "replacing"
8036 display spec. This fixes display when the spec is invalid or we
8037 are on a TTY.
8038
80392012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8040
8041 * unexaix.c (make_hdr): Fix typo in prototype.
8042 This bug broke the build on AIX. Problem reported by Gilles Pion.
8043
80442012-05-14 Michael Albinus <michael.albinus@gmx.de>
8045
8046 * keyboard.c (kbd_buffer_get_event): Read special events also in
8047 batch mode. (Bug#11415)
8048
80492012-05-12 Glenn Morris <rgm@gnu.org>
8050
8051 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8052
80532012-05-12 Eli Zaretskii <eliz@gnu.org>
8054
8055 * lisp.mk (lisp): Add newcomment.elc.
8056
80572012-05-12 Glenn Morris <rgm@gnu.org>
8058
8059 * Makefile.in (MKDIR_P): New, set by configure.
8060 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8061
80622012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8063
8064 Remove unused function hourglass_started.
8065 * dispextern.h (hourglass_started):
8066 * w32fns.c (hourglass_started):
8067 * xdisp.c (hourglass_started): Remove.
8068
80692012-05-10 Juanma Barranquero <lekktu@gmail.com>
8070
8071 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8072 Update dependencies.
8073
80742012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8075
8076 * xgselect.c (xg_select): Put maxfds+1 into a var.
8077 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8078
8079 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8080
80812012-05-10 Dave Abrahams <dave@boostpro.com>
8082
8083 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8084 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8085
80862012-05-09 Michael Albinus <michael.albinus@gmx.de>
8087
8088 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8089 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8090 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8091 Initialize xd_registered_buses.
8092
80932012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8094
8095 Untag more efficiently if USE_LSB_TAG.
8096 This is based on a proposal by YAMAMOTO Mitsuharu in
8097 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8098 For an admittedly artificial (nth 8000 longlist) benchmark on
8099 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8100 Emacs's overall text size by 1%.
8101 * lisp.h (XUNTAG): New macro.
8102 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8103 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8104 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8105 * eval.c (Fautoload):
8106 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8107 * frame.h (XFRAME): Use XUNTAG.
8108
8109 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8110 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8111 Remove unportable assumptions about print widths of types like
8112 dbus_uint32_t.
8113 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8114 intptr_t when converting between pointer and integer, to avoid GCC
8115 warnings about wrong width.
8116
81172012-05-09 Eli Zaretskii <eliz@gnu.org>
8118
8119 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8120 stack for each reader_thread, instead of defaulting to 8MB
8121 determined by the linker. This avoids failures in creating
8122 subprocesses on Windows 7, see the discussion in this thread:
8123 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8124
81252012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8126
8127 Fix up display of the *Minibuf-0* buffer in the mini window.
8128 * keyboard.c (read_char): Don't clear the echo area if there's no
8129 message to clear.
8130 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8131 contents of *Minibuf-0*) if there's no message displayed in its stead.
8132
81332012-05-07 Michael Albinus <michael.albinus@gmx.de>
8134
8135 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8136 batch mode.
8137
81382012-05-06 Chong Yidong <cyd@gnu.org>
8139
8140 * lisp.mk (lisp): Update.
8141
81422012-05-05 Jim Meyering <meyering@redhat.com>
8143
8144 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8145
81462012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8147
8148 * data.c (PUT_ERROR): New macro.
8149 (syms_of_data): Use it. Add new error type `user-error'.
8150 * undo.c (user_error): New function.
8151 (Fprimitive_undo): Use it.
8152 * print.c (print_error_message): Adjust print style for `user-error'.
8153 * keyboard.c (user_error): New function.
8154 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8155
81562012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8157
8158 Do not limit current-time-string to years 1000..9999.
8159 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8160 (Fcurrent_time_string): Support any year that is supported by the
8161 underlying localtime representation. Don't use asctime, as it
8162 has undefined behavior for years outside the range -999..9999.
8163
81642012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8165
8166 Fix race conditions involving setenv, gmtime, localtime, asctime.
8167 Without this fix, interrupts could mess up code that uses these
8168 nonreentrant functions, since setting TZ invalidates existing
8169 tm_zone or tzname values, and since most of these functions return
8170 pointers to static storage.
8171 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8172 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8173 Grow the critical sections to include not just invoking
8174 localtime/gmtime, but also accessing these functions' results
8175 including their tm_zone values if any, and any related TZ setting.
8176 (format_time_string): Last arg is now struct tm *, not struct tm **,
8177 so that the struct tm is saved in the critical section.
8178 All callers changed. Simplify allocation of initial buffer, partly
8179 motivated by the fact that memory allocation needs to be outside
8180 the critical section.
8181
81822012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8183
8184 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8185 with RESET_INTERVAL.
8186
8187 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8188 Remove duplicated buffer name initialization.
8189
81902012-05-02 Jim Meyering <jim@meyering.net>
8191
8192 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8193
8194 * xfns.c (x_window): Use xstrdup (Bug#11375).
8195
81962012-05-02 Eli Zaretskii <eliz@gnu.org>
8197
8198 * xdisp.c (pos_visible_p): If already at a newline from the
8199 display string before the 'while' loop, don't walk back the glyphs
8200 from it3.glyph_row. Solves assertion violation when the display
8201 string begins with a newline (egg.el). (Bug#11367)
8202
82032012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8204
8205 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8206 Move to simple.el.
8207
82082012-05-01 Glenn Morris <rgm@gnu.org>
8209
8210 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8211 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8212 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8213 All were removed before 23.1.
8214
8215 * dispnew.c: Remove HAVE_LIBNCURSES test;
8216 it is always true on relevant platforms.
8217
8218 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8219 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8220
8221 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8222
82232012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8224
8225 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8226 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8227 Remove.
8228
82292012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8230
8231 Do not avoid creating empty evaporating overlays (Bug#9642).
8232 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8233 That is, do not delete an evaporating overlay if it becomes
8234 empty after its bounds are adjusted to fit within its buffer.
8235 This fix caused other problems, and I'm reverting it until we get
8236 to the bottom of them.
8237
82382012-04-27 Chong Yidong <cyd@gnu.org>
8239
8240 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8241
82422012-04-27 Eli Zaretskii <eliz@gnu.org>
8243
8244 * xdisp.c (pos_visible_p): If the window start position is beyond
8245 ZV, start the display from buffer beginning. Prevents assertion
8246 violation in init_iterator when the minibuffer window is scrolled
8247 via the scroll bar.
8248
8249 * window.c (window_scroll_pixel_based): Likewise.
8250
82512012-04-27 Chong Yidong <cyd@gnu.org>
8252
8253 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8254
82552012-04-27 Glenn Morris <rgm@gnu.org>
8256
8257 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8258 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8259
82602012-04-27 Eli Zaretskii <eliz@gnu.org>
8261
8262 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8263 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
8264
82652012-04-26 Eli Zaretskii <eliz@gnu.org>
8266
8267 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8268 display element, check also the underlying string or buffer
8269 character. (Bug#11341)
8270
8271 * w32menu.c: Include w32heap.h.
8272 (add_menu_item): If the call to AppendMenuW (via
8273 unicode_append_menu) fails, disable Unicode menus only if we are
8274 running on Windows 9X/Me.
8275
82762012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8277
8278 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8279 (xgetint): Add missing shift for LSB tags.
8280
82812012-04-24 Martin Rudalics <rudalics@gmx.at>
8282
8283 * keyboard.c (read_char): Don't wipe echo area for select window
8284 events: These might get delayed via `mouse-autoselect-window'
8285 (Bug#11304).
8286
82872012-04-24 Juanma Barranquero <lekktu@gmail.com>
8288
8289 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8290 manipulation of :loaded-from data.
8291
82922012-04-23 Juanma Barranquero <lekktu@gmail.com>
8293
8294 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8295 now a cons (bug#11311).
8296
82972012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8298
8299 Do not create empty overlays with the evaporate property (Bug#9642).
8300 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8301 if it becomes empty after its bounds are adjusted to fit within
8302 its buffer. Without this fix, in a nonempty buffer (let ((o
8303 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8304 yields an empty overlay that has the evaporate property, which is
8305 not supposed to happen.
8306
8307 Fix minor GTK3 problems found by static checking.
8308 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8309 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8310 (struct _EmacsFixedClass, emacs_fixed_get_type):
8311 Move decls here from emacsgtkfixed.h, since they needn't be public.
8312 (emacs_fixed_get_type): Now static.
8313 (emacs_fixed_class_init): Omit unused local.
8314 (emacs_fixed_child_type): Remove; unused.
8315 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8316 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8317 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8318 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8319 (EMACS_FIXED_GET_CLASS): Remove; unused.
8320 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8321
8322 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8323 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8324
83252012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8326
8327 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8328 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8329 (__malloc_size_t, __malloc_ptrdiff_t):
8330 Remove. All uses removed, replaced by the definiens if needed,
8331 since we can assume C89 or better now.
8332 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8333 (protect_malloc_state, align, get_contiguous_space)
8334 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8335 (malloc_atfork_handler_child, malloc_enable_thread)
8336 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8337 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8338 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8339 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8340 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8341 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8342 Define using prototypes, not old style.
8343 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8344 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8345 (align): Don't assume that signed integer overflow wraps around.
8346 Omit unused local var.
8347 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8348 (_free_internal_nolock, memalign, mallochook, reallochook):
8349 Omit no-longer-needed casts.
8350 (valloc): Use getpagesize, not __getpagesize.
8351 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8352 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8353
8354 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8355
83562012-04-22 Michael Albinus <michael.albinus@gmx.de>
8357
8358 Move functions from C to Lisp. Make non-blocking method calls
8359 the default. Implement further D-Bus standard interfaces.
8360
8361 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8362 (QCdbus_request_name_allow_replacement)
8363 (QCdbus_request_name_replace_existing)
8364 (QCdbus_request_name_do_not_queue)
8365 (QCdbus_request_name_reply_primary_owner)
8366 (QCdbus_request_name_reply_in_queue)
8367 (QCdbus_request_name_reply_exists)
8368 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8369 (QCdbus_registered_serial, QCdbus_registered_method)
8370 (QCdbus_registered_signal): New Lisp objects.
8371 (XD_DEBUG_MESSAGE): Use sizeof.
8372 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8373 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8374 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8375 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8376 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8377 (xd_signature, xd_append_arg): Allow float for integer types.
8378 (xd_get_connection_references): New function.
8379 (xd_get_connection_address): Rename from xd_initialize.
8380 Return cached address.
8381 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8382 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8383 level.
8384 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8385 Return number of refcounts.
8386 (Fdbus_get_unique_name): Make stronger parameter check.
8387 (Fdbus_message_internal): New defun.
8388 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8389 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8390 (Fdbus_send_signal, Fdbus_register_service)
8391 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8392 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8393 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8394 (Vdbus_compiled_version, Vdbus_runtime_version)
8395 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8396 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8397 (Vdbus_message_type_signal): New defvars.
8398 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8399 Adapt docstring.
8400
84012012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8402
8403 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8404 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8405 Do not assume ptrdiff_t is the same width as 'int'.
8406
8407 * alloc.c: Handle unusual debugging option combinations.
8408 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8409 since the two debugging options are incompatible.
8410 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8411 is defined.
8412 (mem_init, mem_insert, mem_insert_fixup):
8413 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8414 (NEED_MEM_INSERT): Remove; no longer needed.
8415
84162012-04-22 Leo Liu <sdl.web@gmail.com>
8417
8418 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8419
84202012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8421
8422 * sysdep.c [__FreeBSD__]: Minor cleanups.
8423 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8424 Use Emacs indenting style more consistently. Avoid some casts.
8425 Use 'double' consistently rather than mixing 'float' and 'double'.
8426
84272012-04-21 Eduard Wiebe <usenet@pusto.de>
8428
8429 * sysdep.c (list_system_processes, system_process_attributes):
8430 Add implementation for FreeBSD (Bug#5243).
8431
84322012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8433
8434 * lisp.mk (lisp): Update.
8435
84362012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8437
8438 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8439 It is never used otherwise.
8440
84412012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8442
8443 * print.c (print_preprocess): Only check print_depth if print-circle
8444 is nil.
8445 (print_object): Check for cycles even when print-circle is nil and
8446 print-gensym is t, but only check print_depth if print-circle is nil.
8447
84482012-04-20 Chong Yidong <cyd@gnu.org>
8449
8450 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8451 set the status to "failed" and ensure that sentinel is run.
8452
84532012-04-20 Glenn Morris <rgm@gnu.org>
8454
8455 * process.c (Fset_process_inherit_coding_system_flag)
8456 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8457 (Fmake_network_process, Fmake_serial_process): Doc fix.
8458
84592012-04-20 Eli Zaretskii <eliz@gnu.org>
8460
8461 * xdisp.c (string_buffer_position_lim): Limit starting position to
8462 BEGV.
8463 (set_cursor_from_row): If called for a mode-line or header-line
8464 row, return zero immediately.
8465 (try_cursor_movement): If inside continuation line, don't back up
8466 farther than the first row after the header line, if any.
8467 Don't consider the header-line row as "partially visible", even if
8468 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8469
84702012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8471
8472 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8473 (bug#11238).
8474
84752012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
84762012-04-18 Paul Eggert <eggert@cs.ucla.edu>
8477
8478 configure: new option --enable-gcc-warnings (Bug#11207)
8479 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8480 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8481 (ALL_CFLAGS): Use new macros rather than old.
8482 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8483 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8484 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8485 -Wunused-result, -Wunused-variable. This should go away once
8486 the Emacs and Gnulib regex code is merged.
8487 (xmalloc, xrealloc): Now static.
8488
84892012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8490
8491 * dired.c (Fsystem_groups): Remove unused local.
8492
84932012-04-17 Glenn Morris <rgm@gnu.org>
8494
8495 * dired.c (Fsystem_users): Doc fix.
8496
84972012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8498
8499 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8500 (syms_of_dired): Add them.
8501
85022012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8503
8504 Fix minor alloc.c problems found by static checking.
8505 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8506 New extern decls, to avoid calling undeclared functions.
8507 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8508 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8509 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8510 (NEED_MEM_INSERT): New macro.
8511 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8512 Remove one incorrect comment and fix another.
8513
8514 Fix minor ralloc.c problems found by static checking.
8515 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8516 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8517 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8518 (r_alloc_sbrk): Now static.
8519
8520 Improve ralloc.c interface checking.
8521 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8522 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8523 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8524 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8525 [REL_ALLOC]: ... to here, to check interface.
8526 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8527 Remove decls. This fixes an "It stinks!".
8528
8529 * alloc.c (which_symbols): Fix alignment issue / type clash.
8530
85312012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8532
8533 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8534 (struct Lisp_Misc_Any): Likewise.
8535 (struct Lisp_Free): Likewise.
8536 * alloc.c (union aligned_Lisp_Symbol): Define.
8537 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8538 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8539 (union aligned_Lisp_Misc): Define.
8540 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8541 aligned_Lisp_Misc instead of union Lisp_Misc.
8542 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8543
85442012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8545
8546 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8547 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8548 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8549 * s/netbsd.h, s/sol2-6.h:
8550 Remove definition of GC_MARK_STACK, since the default now works.
8551 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8552 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8553 no longer the default.
8554 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8555
85562012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8557
8558 * lread.c (lisp_file_lexically_bound_p):
8559 Fix hang at ";-*-\n" (bug#11238).
8560
85612012-04-14 Eli Zaretskii <eliz@gnu.org>
8562
8563 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8564 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8565
85662012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8567
8568 * nsterm.m (constrainFrameRect): Always constrain when there is only
8569 one screen (Bug#10962).
8570
85712012-04-13 Ken Brown <kbrown@cornell.edu>
8572
8573 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8574
85752012-04-13 Reuben Thomas <rrt@sc3d.org>
8576
8577 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8578
85792012-04-11 Daniel Colascione <dancol@dancol.org>
8580
8581 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8582 against is gone. It's better to use vfork now so that when Cygwin
8583 gains a new, working vfork, we use it automatically (bug#10398).
8584
85852012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8586
8587 * window.c (save_window_save): Obey window-point-insertion-type.
8588
85892012-04-11 Glenn Morris <rgm@gnu.org>
8590
8591 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8592
85932012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8594
8595 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8596
85972012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
8598
8599 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8600 (force_quit_count): New var.
8601 (handle_interrupt): Use it.
8602
86032012-04-10 Juanma Barranquero <lekktu@gmail.com>
8604
8605 * w32.c (w32_delayed_load): Record the full path of the library
8606 being loaded (bug#10424).
8607
86082012-04-09 Glenn Morris <rgm@gnu.org>
8609
8610 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8611 not just in the obarray, before snarfing them. (Bug#11036)
8612
8613 * Makefile.in ($(leimdir)/leim-list.el):
8614 Pass EMACS rather than BUILT_EMACS.
8615
86162012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8617
8618 * process.c (make_process):
8619 * process.h: Add integer `gnutls_handshakes_tried' member to
8620 process struct.
8621
8622 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8623 Add convenience `GNUTLS_LOG2i' macro.
8624
8625 * gnutls.c (gnutls_log_function2i): Convenience log function.
8626 (emacs_gnutls_read): Use new log functions,
8627 `gnutls_handshakes_tried' process member, and
8628 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8629 attempts per process (connection).
8630
86312012-04-09 Chong Yidong <cyd@gnu.org>
8632
8633 * eval.c (Fuser_variable_p, user_variable_p_eh)
8634 (lisp_indirect_variable): Functions deleted.
8635 (Fdefvar): Caller changed.
8636
8637 * callint.c (Finteractive, Fcall_interactively):
8638 * minibuf.c (Fread_variable): Callers changed.
8639
86402012-04-09 Eli Zaretskii <eliz@gnu.org>
8641
8642 * xdisp.c (set_cursor_from_row): If the display string appears in
8643 the buffer at position that is closer to point than the position
8644 after the display string, display the cursor on the first glyph of
8645 the display string. Fixes cursor display when a 'display' text
8646 property immediately follows invisible text. (Bug#11094)
8647
86482012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8649
8650 composite.c: use 'double' consistently
8651 * composite.c (get_composition_id): Use 'double' consistently
8652 instead of converting 'float' to 'double' and vice versa; this is
8653 easier to understand and avoids a GCC warning.
8654
86552012-04-09 Glenn Morris <rgm@gnu.org>
8656
8657 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8658 preparation for dumping it with emacs. (Bug#4789)
8659 (leimdir): New variable.
8660 ($(leimdir)/leim-list.el): New rule.
8661 (emacs$(EXEEXT)): Depend on leim-list.el.
8662
8663 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8664 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8665 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8666
86672012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8668
8669 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8670 proper alignment.
8671
86722012-04-07 Juanma Barranquero <lekktu@gmail.com>
8673
8674 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8675 Remove unused local variable.
8676
86772012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8678
8679 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8680 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8681 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8682 objects, as mark_maybe_pointer will catch them otherwise.
8683 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8684 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8685
86862012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8687
8688 Fix typo that broke non-Windows builds.
8689 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8690
86912012-04-07 Eli Zaretskii <eliz@gnu.org>
8692
8693 Support building on MS-Windows with libxml2.
8694
8695 * makefile.w32-in (OBJ2): Add xml.$(O).
8696 (GLOBAL_SOURCES): Add xml.c.
8697 ($(BLD)/xml.$(O)): New dependency list.
8698
8699 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8700 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8701 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8702 [!WINDOWSNT]: New macros.
8703 (init_libxml2_functions, libxml2_loaded_p): New functions.
8704 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8705 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8706 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8707 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8708 linked in).
8709 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8710 Call init_libxml2_functions before calling libxml2 functions.
8711 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8712
8713 * emacs.c: Don't include libxml/parser.h.
8714 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8715 xmlCleanupParser directly.
8716
8717 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8718
87192012-04-07 Eli Zaretskii <eliz@gnu.org>
8720
8721 * indent.c (Fvertical_motion): If there is a display string at
8722 point, use it.vpos to compute how many lines to backtrack after
8723 move_it_to point. (Bug#11133)
8724
87252012-04-06 Eli Zaretskii <eliz@gnu.org>
8726
8727 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8728 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8729 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8730 macros related to unification of CJK characters. For the details,
8731 see the discussion following the message here:
8732 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8733
87342012-04-04 Chong Yidong <cyd@gnu.org>
8735
8736 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8737
87382012-04-01 Eli Zaretskii <eliz@gnu.org>
8739
8740 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8741 instead of alloca. (Bug#11138)
8742
87432012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8744
8745 * w32menu.c (is_simple_dialog): Properly check lisp types.
8746 (Bug#11141)
8747
87482012-03-31 Eli Zaretskii <eliz@gnu.org>
8749
8750 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8751 position we get to after a call to move_it_to fails the
8752 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8753 only if we wind up in a string from display property. (Bug#11063)
8754
8755 * window.c (Fdelete_other_windows_internal): Invalidate the row
8756 and column information about mouse highlight, so that redisplay
8757 restores it after reallocating the glyph matrices. (Bug#7464)
8758
8759 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8760 string comes from a `display' text property, use the buffer
8761 position of that property as if we actually saw that position in
8762 the row's glyphs.
8763 (move_it_by_lines): Remove the assertion that
8764 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8765 violated when there's a before-string at the beginning of a line.
8766 (Bug#11063)
8767
87682012-03-30 Eli Zaretskii <eliz@gnu.org>
8769
8770 * xdisp.c (append_space_for_newline): If the default face was
8771 remapped, use the remapped face for the appended newline.
8772 (extend_face_to_end_of_line): Use the remapped default face for
8773 extending the face to the end of the line.
8774 (display_line): Call extend_face_to_end_of_line when the default
8775 face was remapped. (Bug#11068)
8776
87772012-03-29 Eli Zaretskii <eliz@gnu.org>
8778
8779 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8780
87812012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8782
8783 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8784
87852012-03-27 Glenn Morris <rgm@gnu.org>
8786
8787 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8788 Doc fixes.
8789
87902012-03-26 Kenichi Handa <handa@m17n.org>
8791
8792 * dispextern.h (struct glyph): Fix previous change. Change the
8793 bit length of glyphless.ch to 25 (Bug#11082).
8794
87952012-03-26 Chong Yidong <cyd@gnu.org>
8796
8797 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8798 (command_loop_1): Use it; inhibit selection update for
8799 handle-select-window too (Bug#8996).
8800
88012012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8802
8803 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8804
88052012-03-25 Kenichi Handa <handa@m17n.org>
8806
8807 * dispextern.h (struct glyph): Change the bit length of
8808 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8809
88102012-03-24 Eli Zaretskii <eliz@gnu.org>
8811
8812 * s/ms-w32.h (tzname): Include time.h before redirecting to
8813 _tzname. Fixes the MSVC build. (Bug#9960)
8814
88152012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8816
8817 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8818 characters.
8819
8820 * xterm.c (XTread_socket): Only modify handling_signal if
8821 !SYNC_INPUT. (Bug#11080)
8822
88232012-03-23 Eli Zaretskii <eliz@gnu.org>
8824
8825 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8826 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8827 when fetching a multibyte character consumes more bytes than
8828 CHAR_BYTES returns, due to unification of CJK characters in
8829 string_char. (Bug#11073)
8830
88312012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8832
8833 * process.c (wait_reading_process_output): Handle pty disconnect
8834 by refraining from sending oneself a SIGCHLD (bug#10933).
8835
88362012-03-22 Chong Yidong <cyd@gnu.org>
8837
8838 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8839
8840 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8841 Mark string as coming from a prefix property.
8842 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8843 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8844
88452012-03-21 Chong Yidong <cyd@gnu.org>
8846
8847 * xfaces.c (Vface_remapping_alist): Doc fix.
8848
88492012-03-20 Eli Zaretskii <eliz@gnu.org>
8850
8851 * w32proc.c (Fw32_set_console_codepage)
8852 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8853 Doc fixes.
8854
88552012-03-20 Chong Yidong <cyd@gnu.org>
8856
8857 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8858 to reflect default non-nil value of redisplay-dont-pause.
8859
88602012-03-19 Kenichi Handa <handa@m17n.org>
8861
8862 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8863 it fit in a valid range (Bug#11003).
8864
88652012-03-18 Eli Zaretskii <eliz@gnu.org>
8866
8867 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8868 that is not from display property, accept the row as a "cursor
8869 row" if one of the string's character has a non-nil `cursor'
8870 property. Fixes cursor positioning when there are newlines in
8871 overlay strings, e.g. in icomplete.el. (Bug#11035)
8872
88732012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8874
8875 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8876
88772012-03-12 Chong Yidong <cyd@gnu.org>
8878
8879 * eval.c (inhibit_lisp_code): Rename from
8880 inhibit_window_configuration_change_hook; move from window.c.
8881
8882 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8883 * window.c (run_window_configuration_change_hook)
8884 (syms_of_window): Callers changed.
8885
88862012-03-11 Chong Yidong <cyd@gnu.org>
8887
8888 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8889
8890 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8891
88922012-03-10 Chong Yidong <cyd@gnu.org>
8893
8894 * frame.c (other_visible_frames): Don't assume the selected frame
8895 is visible (Bug#10955).
8896
88972012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8898
8899 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8900
89012012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8902
8903 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8904 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8905 zero (Bug#10954).
8906
89072012-03-03 Glenn Morris <rgm@gnu.org>
8908
8909 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8910
89112012-03-02 Eli Zaretskii <eliz@gnu.org>
8912
8913 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8914 position past the first glyph_row that ends at ZV. (Bug#10902)
8915 (redisplay_window, next_element_from_string): Fix typos in
8916 comments.
8917 (redisplay_window): Pass to move_it_vertically the margin in
8918 pixels, not in screen lines.
8919
89202012-03-02 Glenn Morris <rgm@gnu.org>
8921
8922 * buffer.c (buffer-list-update-hook): Doc fix.
8923
89242012-02-29 Eli Zaretskii <eliz@gnu.org>
8925
8926 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8927 push_it before setting up the iterator for the first overlay
8928 string, even if we have an empty string loaded.
8929 (next_overlay_string): If there's an empty string on the iterator
8930 stack, pop the stack. (Bug#10903)
8931
89322012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8933
8934 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8935 Suggested by Stefan Monnier in
8936 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8937 * alloc.c (widen_to_Lisp_Object): New static function.
8938 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8939 and widening them to Lisp_Objects. This would work even if
8940 USE_LSB_TAG is defined and wide integers are used, which might
8941 happen in a future version of Emacs.
8942
89432012-02-25 Chong Yidong <cyd@gnu.org>
8944
8945 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8946 Doc fix.
8947
8948 * xselect.c (Fx_selection_exists_p): Doc fix.
8949 (x_clipboard_manager_save_all): Print an informative message
8950 before saving to clipboard manager.
8951
89522012-02-24 Chong Yidong <cyd@gnu.org>
8953
8954 * keyboard.c (process_special_events): Handle all X selection
8955 requests in kbd_buffer, not just the next one (Bug#8869).
8956
89572012-02-23 Chong Yidong <cyd@gnu.org>
8958
8959 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8960 call when setting menu-bar-lines and tool-bar-lines parameters.
8961 (unwind_create_frame_1): New helper function.
8962
8963 * window.c (inhibit_window_configuration_change_hook): New var.
8964 (run_window_configuration_change_hook): Obey it.
8965 (syms_of_window): Initialize it.
8966
89672012-02-22 Chong Yidong <cyd@gnu.org>
8968
8969 * xterm.c (x_draw_image_relief): Add missing type check for
8970 Vtool_bar_button_margin (Bug#10743).
8971
89722012-02-21 Chong Yidong <cyd@gnu.org>
8973
8974 * fileio.c (Vfile_name_handler_alist): Doc fix.
8975
8976 * buffer.c (Fget_file_buffer): Protect against invalid file
8977 handler return value.
8978
89792012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8980
8981 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8982 when computing $valmask.
8983
8984 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8985 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8986 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8987 It's useless in that case, and it can cause problems on hosts
8988 that allocate halves of EMACS_INT values separately.
8989 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8990 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8991 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8992 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8993 it avoids undefined behavior on hosts where shifting right by more
8994 than the word width has undefined behavior.
8995
89962012-02-19 Chong Yidong <cyd@gnu.org>
8997
8998 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8999 (Funhandled_file_name_directory, Ffile_name_as_directory)
9000 (Fdirectory_file_name, Fexpand_file_name)
9001 (Fsubstitute_in_file_name): Protect against invalid file handler
9002 return values (Bug#10845).
9003
90042012-02-18 Eli Zaretskii <eliz@gnu.org>
9005
9006 * .gdbinit (pitx): Fix incorrect references to fields of the
9007 iterator stack.
9008
90092012-02-17 Chong Yidong <cyd@gnu.org>
9010
9011 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9012
90132012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9014
9015 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9016 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9017
90182012-02-15 Chong Yidong <cyd@gnu.org>
9019
9020 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9021 marked as special. Also, starting docstrings with * is obsolete.
9022
90232012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9024
9025 * gnutls.c (emacs_gnutls_write): Fix last change.
9026
90272012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9028
9029 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9030 send_process.
9031
90322012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9033
9034 * keymap.c (Fsingle_key_description): Handle char ranges.
9035
90362012-02-12 Chong Yidong <cyd@gnu.org>
9037
9038 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9039 as that creates a dangerous corner case.
9040
9041 * window.c (Fdelete_window_internal): Invalidate the mouse
9042 highlight (Bug#9904).
9043
90442012-02-12 Glenn Morris <rgm@gnu.org>
9045
9046 * xselect.c (Fx_own_selection_internal)
9047 (Fx_get_selection_internal, Fx_disown_selection_internal)
9048 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9049 * nsselect.m (Fx_own_selection_internal)
9050 (Fx_disown_selection_internal, Fx_selection_exists_p)
9051 (Fx_selection_owner_p, Fx_get_selection_internal):
9052 Sync docs and argument specs with the xselect.c versions.
9053
90542012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9055
9056 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9057
90582012-02-11 Eli Zaretskii <eliz@gnu.org>
9059
9060 * w32select.c (Fx_selection_exists_p): Sync doc string and
9061 argument list with xselect.c. (Bug#10783)
9062
9063 * w16select.c (Fx_selection_exists_p): Sync doc string and
9064 argument list with xselect.c. (Bug#10783)
9065
90662012-02-10 Glenn Morris <rgm@gnu.org>
9067
9068 * fns.c (Fsecure_hash): Doc fix.
9069
90702012-02-09 Kenichi Handa <handa@m17n.org>
9071
9072 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9073
90742012-02-07 Chong Yidong <cyd@gnu.org>
9075
9076 * buffer.c (Fbuffer_local_variables)
9077 (buffer_lisp_local_variables): Handle unbound vars correctly;
9078 don't let Qunbound leak into Lisp.
9079
90802012-02-07 Glenn Morris <rgm@gnu.org>
9081
9082 * image.c (Fimagemagick_types): Doc fix.
9083
9084 * image.c (imagemagick-render-type): Change it from a lisp object
9085 to an integer. Move the doc here from the lisp manual.
9086 Treat all values not equal to 0 the same.
9087
90882012-02-06 Chong Yidong <cyd@gnu.org>
9089
9090 * doc.c (store_function_docstring): Avoid applying docstring of
9091 alias to base function (Bug#2603).
9092
90932012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9094
9095 * .gdbinit (pp1, pv1): Remove redundant defines.
9096 (pr): Use pp.
9097
90982012-02-04 Chong Yidong <cyd@gnu.org>
9099
9100 * nsterm.m: Declare a global (Bug#10694).
9101
91022012-02-04 Eli Zaretskii <eliz@gnu.org>
9103
9104 * w32.c (get_emacs_configuration_options):
9105 Include --enable-checking, if specified, in the return value.
9106
91072012-02-04 Martin Rudalics <rudalics@gmx.at>
9108
9109 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9110 after rounding frame sizes. (Bug#9723)
9111
91122012-02-04 Eli Zaretskii <eliz@gnu.org>
9113
9114 * keyboard.c (adjust_point_for_property): Don't position point
9115 before BEGV. (Bug#10696)
9116
91172012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9118
9119 Handle overflow when computing char display width (Bug#9496).
9120 * character.c (char_width): Return EMACS_INT, not int.
9121 (char_width, c_string_width): Check for overflow when
9122 computing the width; this is possible now that individual
9123 characters can have unbounded width. Problem introduced
9124 by merge from Emacs 23 on 2012-01-19.
9125
91262012-02-02 Michael Albinus <michael.albinus@gmx.de>
9127
9128 * dbusbind.c (Fdbus_register_method): Mention the return value
9129 :ignore in the docstring.
9130
91312012-02-02 Glenn Morris <rgm@gnu.org>
9132
9133 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9134
9135 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9136 Unconditionally set to t. (Bug#10673)
9137 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9138 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9139 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9140
91412012-02-02 Kenichi Handa <handa@m17n.org>
9142
9143 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9144 0, do not call append_composite_glyph.
9145
91462012-02-02 Kenichi Handa <handa@m17n.org>
9147
9148 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9149 NULL (Bug#6988).
9150 (x_produce_glyphs): If the component of a composition is a null
9151 string, set it->pixel_width to 1 to avoid zero-width glyph.
9152
91532012-02-01 Eli Zaretskii <eliz@gnu.org>
9154
9155 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9156 first 2 arguments are identical. This makes inserting large
9157 output from a subprocess an order of magnitude faster on
9158 MS-Windows, where all sbrk'ed memory is always contiguous.
9159
91602012-01-31 Glenn Morris <rgm@gnu.org>
9161
9162 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9163 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9164 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9165
91662012-01-29 Glenn Morris <rgm@gnu.org>
9167
9168 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9169
91702012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9171
9172 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9173
91742012-01-28 Chong Yidong <cyd@gnu.org>
9175
9176 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9177
91782012-01-26 Chong Yidong <cyd@gnu.org>
9179
9180 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9181
9182 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9183 repeat counts (Bug#10507).
9184
91852012-01-26 Glenn Morris <rgm@gnu.org>
9186
9187 * lread.c (syms_of_lread): Doc fix.
9188
91892012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9190
9191 * coding.c (encode_designation_at_bol): Change return value to
9192 EMACS_INT.
9193
91942012-01-25 Chong Yidong <cyd@gnu.org>
9195
9196 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9197
91982012-01-21 Chong Yidong <cyd@gnu.org>
9199
9200 * floatfns.c (Fcopysign): Make the second argument non-optional,
9201 since nil is not allowed anyway.
9202
92032012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9204
9205 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9206 (send_process): Likewise.
9207
92082012-01-19 Martin Rudalics <rudalics@gmx.at>
9209
9210 * window.c (save_window_save, Fcurrent_window_configuration)
9211 (Vwindow_persistent_parameters): Do not use Qstate.
9212 Rewrite doc-strings.
9213
92142012-01-19 Kenichi Handa <handa@m17n.org>
9215
9216 * character.c (char_width): New function.
9217 (Fchar_width, c_string_width, lisp_string_width):
9218 Use char_width (Bug#9496).
9219
92202012-01-16 Martin Rudalics <rudalics@gmx.at>
9221
9222 * window.c (Vwindow_persistent_parameters): New variable.
9223 (Fset_window_configuration, save_window_save): Handle persistent
9224 window parameters.
9225
92262012-01-14 Eli Zaretskii <eliz@gnu.org>
9227
9228 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9229 thrashing the stack of the thread. (Bug#9087)
9230
92312012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9232
9233 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9234
92352012-01-11 Eli Zaretskii <eliz@gnu.org>
9236
9237 * xdisp.c (rows_from_pos_range): Handle the case where the
9238 highlight ends on a newline. (Bug#10464)
9239 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9240 he end column for display of highlight that ends on a newline
9241 before a R2L line.
9242
92432012-01-11 Glenn Morris <rgm@gnu.org>
9244
9245 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9246 from load-path also when installation-directory is nil. (Bug#10208)
9247
92482012-01-10 Glenn Morris <rgm@gnu.org>
9249
9250 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9251
9252 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9253 Update template values to be closer to their typical values these days.
9254
92552012-01-09 Eli Zaretskii <eliz@gnu.org>
9256
9257 * xdisp.c (rows_from_pos_range): Accept additional argument
9258 DISP_STRING, and accept any glyph in a row whose object is that
9259 string as eligible for mouse highlight. Fixes mouse highlight of
9260 display strings from overlays. (Bug#10464)
9261
92622012-01-07 Paul Eggert <eggert@cs.ucla.edu>
9263
9264 emacs: fix an auto-save permissions race condition (Bug#10400)
9265 * fileio.c (auto_saving_dir_umask): New static var.
9266 (Fmake_directory_internal): Use it.
9267 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9268 creating the directory. The old code temporarily assigns
9269 too-generous permissions to the directory.
9270 (do_auto_save_eh): Clear it.
9271 (Fdo_auto_save): Catch all errors, not just file errors, so
9272 that the var is always cleared.
9273
92742012-01-07 Eli Zaretskii <eliz@gnu.org>
9275
9276 * search.c (scan_buffer): Pass character positions to
9277 know_region_cache, not byte positions. (Bug#6540)
9278
92792012-01-07 LynX <_LynX@bk.ru> (tiny change)
9280
9281 * w32.c (sys_rename): Report EXDEV when rename of a directory
9282 fails because the target is on another logical disk. (Bug#10284)
9283
92842012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9285
9286 * xterm.c (x_embed_request_focus): New function.
9287
9288 * xterm.h: Add prototype.
9289
9290 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9291
92922012-01-05 Glenn Morris <rgm@gnu.org>
9293
9294 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9295
92962012-01-01 Eli Zaretskii <eliz@gnu.org>
9297
9298 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9299 Load gnutls_transport_set_lowat only if GnuTLS version is below
9300 2.11.1.
9301 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9302 GnuTLS versions below 2.11.1.
9303
93042011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9305
9306 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9307 to the doc string advising against its use for altering the way
9308 windows are scrolled.
9309
93102011-12-28 Kenichi Handa <handa@m17n.org>
9311
9312 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9313 coding-system ASCII compatible only when it does not produce BOM
9314 on encoding (Bug#10383).
9315
93162011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9317
9318 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9319 can scroll.
9320 (create_and_show_popup_menu): Always use menu_position_func for
9321 Gtk3 (Bug#10361).
9322
93232011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9324
9325 * callint.c (Fcall_interactively): Don't truncate prompt string.
9326
93272011-12-23 Eli Zaretskii <eliz@gnu.org>
9328
9329 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9330 property that ends at ZV, so that the bidi iteration could be
9331 resumed from there (after widening). (Bug#10360)
9332
93332011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9334
9335 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9336
93372011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9338
9339 * nsterm.m (x_free_frame_resources):
9340 Release f->output_data.ns->miniimage.
9341 (ns_index_color): Fix indentation. Do not retain
9342 color_table->colors[i].
9343
9344 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9345 before returning.
9346
9347 * nsfns.m (x_set_background_color): Assign return value from
9348 ns_index_color to face-background instead of NSColor*.
9349 (ns_implicitly_set_icon_type): Fix indentation.
9350 Change assignment in for loop to comparison.
9351
9352 * emacs.c (ns_pool): New variable.
9353 (main): Assign ns_pool.
9354 (Fkill_emacs): Call ns_release_autorelease_pool.
9355
9356 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9357 autorelease fdesc, release fdAttrs and tdict.
9358 (ns_get_covering_families): Release charset.
9359 (ns_findfonts): Release NSFontDescriptor created with new.
9360 (ns_uni_to_glyphs): Fix indentation.
9361 (setString): Release attrStr before assigning new value.
9362
93632011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9364
9365 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9366 and NS_IMPL_COCOA.
9367 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9368 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9369
93702011-12-18 David Reitter <reitter@cmu.edu>
9371
9372 * nsterm.m (ns_term_init): Subscribe for notifications
9373 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9374 to method trackingNotification in EmacsMenu.
9375
9376 * nsmenu.m (trackingMenu): New variable.
9377 (trackingNotification): New method (from Aquamacs).
9378 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9379 from Aquamacs (Bug#7030).
9380
93812011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9382
9383 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9384 (symbol_to_nsstring): Fix indentation.
9385 (ns_symbol_to_pb): New function.
9386 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9387 (Fns_rotate_cut_buffers_internal): Remove.
9388 (Fns_store_selection_internal): Rename from
9389 Fns_store_cut_buffer_internal.
9390 (ns_get_foreign_selection, Fx_own_selection_internal)
9391 (Fx_disown_selection_internal, Fx_selection_exists_p)
9392 (Fns_get_selection_internal, Fns_store_selection_internal):
9393 Use ns_symbol_to_pb and check if return value is nil.
9394 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9395 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9396 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9397 renamed to Sns_store_selection_internal.
9398 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9399 and remove this function.
9400 (ns_handle_selection_clear): Remove, never used.
9401 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9402 here.
9403
94042011-12-17 Ken Brown <kbrown@cornell.edu>
9405
9406 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9407 GID is unknown (Bug#10257).
9408
94092011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9410
9411 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9412 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9413 which caused a build failure on GNU/Linux IA-64. This problem was
9414 introduced by my 2011-10-07 patch.
9415
94162011-12-15 Juri Linkov <juri@jurta.org>
9417
9418 * image.c (imagemagick_error): New function. (Bug#10112)
9419 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9420 Use `imagemagick_error' where ImageMagick functions return
9421 `MagickFalse'.
9422 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9423 proper order.
9424
94252011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9426
9427 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9428 fill background (Bug#8992).
9429
94302011-12-13 Martin Rudalics <rudalics@gmx.at>
9431
9432 * window.c (Vwindow_combination_resize)
9433 (Vwindow_combination_limit): Use t instead of non-nil in
9434 doc-strings.
9435 (Vrecenter_redisplay): Add first sentence of doc-string on
9436 separate line.
9437 (Frecenter): Fix doc-string typo.
9438
94392011-12-11 Kenichi Handa <handa@m17n.org>
9440
9441 * coding.c (Funencodable_char_position): Pay attention to the
9442 buffer text relocation (Bug#9389).
9443
94442011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9445
9446 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9447 gtk_init (Bug#10100).
9448
94492011-12-10 Eli Zaretskii <eliz@gnu.org>
9450
9451 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9452 IT->string is nil. (Bug#10263)
9453
94542011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9455
9456 * nsterm.h (x_free_frame_resources): Declare.
9457
9458 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9459 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9460
9461 * nsterm.h (ns_get_defaults_value): Declare.
9462
9463 * nsterm.m (ns_default): Call ns_get_defaults_value.
9464
94652011-12-09 Eli Zaretskii <eliz@gnu.org>
9466
9467 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9468 (Bug#10170)
9469
94702011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9471
9472 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9473 that where the value of an _OBJC_* symbol points to is in the .bss
9474 section (Bug#10240).
9475
94762011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9477
9478 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9479 after the loop to call ccl_driver at least once (Bug#8619).
9480
94812011-12-08 Kenichi Handa <handa@m17n.org>
9482
9483 * ftfont.c (get_adstyle_property): Fix previous change
9484 (Bug#10233).
9485
94862011-12-07 Juanma Barranquero <lekktu@gmail.com>
9487
9488 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9489 dirs from the default value of EMACSLOADPATH (bug#10208).
9490
94912011-12-07 Glenn Morris <rgm@gnu.org>
9492
9493 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9494 installation and source directories as well. (Bug#10208)
9495
94962011-12-06 Chong Yidong <cyd@gnu.org>
9497
9498 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9499
95002011-12-06 Glenn Morris <rgm@gnu.org>
9501
9502 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9503 as an error, not just -1. (Bug#10217)
9504
95052011-12-05 Chong Yidong <cyd@gnu.org>
9506
9507 * keyboard.c (process_special_events): New function.
9508 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9509
95102011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9511
9512 * coding.c (encode_designation_at_bol): Don't use uninitialized
9513 local variable (Bug#9318).
9514
95152011-12-05 Kenichi Handa <handa@m17n.org>
9516
9517 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9518 return Qnil (Bug#8046, Bug#10193).
9519
95202011-12-05 Kenichi Handa <handa@m17n.org>
9521
9522 * coding.c (encode_designation_at_bol): New args charbuf_end and
9523 dst. Return the number of produced bytes. Callers changed.
9524 (coding_set_source): Return how many bytes coding->source was
9525 relocated.
9526 (coding_set_destination): Return how many bytes
9527 coding->destination was relocated.
9528 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9529 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9530
95312011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9532
9533 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9534 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9535 macro (Bug#9318).
9536
95372011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9538
9539 The following changes are to fix Bug#9318.
9540
9541 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9542 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9543 (encode_coding_iso_2022, encode_coding_sjis)
9544 (encode_coding_big5, encode_coding_charset): Use the above macros.
9545
95462011-12-05 Juanma Barranquero <lekktu@gmail.com>
9547
9548 * lisp.h (process_quit_flag): Fix external declaration.
9549
95502011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9551
9552 Don't macro-inline non-performance-critical code.
9553 * eval.c (process_quit_flag): New function.
9554 * lisp.h (QUIT): Use it.
9555
95562011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9557
9558 * nsfns.m (get_geometry_from_preferences): New function.
9559 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9560
95612011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9562
9563 * emacs.c (Qkill_emacs): Define.
9564 (syms_of_emacs): Initialize it.
9565 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9566 Qquit_flag to `kill-emacs' instead.
9567 (quit_throw_to_read_char): Add parameter `from_signal'.
9568 All callers changed. Call Fkill_emacs if requested and safe.
9569 * lisp.h (QUIT): Call Fkill_emacs if requested.
9570
95712011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9572
9573 * widget.c (update_wm_hints): Return if wmshell is null.
9574 (widget_update_wm_size_hints): New function.
9575
9576 * widget.h (widget_update_wm_size_hints): Declare.
9577
9578 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9579 widget_update_wm_size_hints (Bug#10104).
9580
95812011-12-03 Eli Zaretskii <eliz@gnu.org>
9582
9583 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9584 before a newline, prepare the bidi iterator for consuming the
9585 newline, and keep the current paragraph direction. (Bug#10183)
9586 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9587
95882011-12-02 Juri Linkov <juri@jurta.org>
9589
9590 * search.c (Fword_search_regexp): New Lisp function created from
9591 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9592 (Fword_search_backward, Fword_search_forward)
9593 (Fword_search_backward_lax, Fword_search_forward_lax):
9594 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9595 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9596
95972011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9598
9599 * fileio.c (Finsert_file_contents): Move after-change-function call
9600 to before the "handled:" label, since all "goto handled" appear in
9601 cases where the *-change-functions have already been properly called
9602 (bug#10117).
9603
96042011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9605
9606 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9607 waiting for input. (Bug#10169)
9608
96092011-11-30 Eli Zaretskii <eliz@gnu.org>
9610
9611 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9612 verifies glyph row's hash code--we have just reallocated the
9613 glyphs, so their contents can be complete garbage. (Bug#10164)
9614
96152011-11-30 Juanma Barranquero <lekktu@gmail.com>
9616
9617 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9618
96192011-11-30 Eli Zaretskii <eliz@gnu.org>
9620
9621 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9622 attributes are tested _before_ calling verify_row_hash, to protect
9623 against GCC re-ordering of the tests. (Bug#10164)
9624
96252011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9626
9627 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9628
9629 * xterm.c (handle_one_xevent): Only set async_visible and friends
9630 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9631 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9632 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9633
96342011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9635
9636 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9637 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9638 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9639 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9640 All uses changed to use GCPRO1 etc.
9641 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9642 Revert to old implementation (i.e., before 2011-03-11).
9643
96442011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9645
9646 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9647 of scroll runs so as to avoid assigning disabled bogus rows and
9648 unnecessary graphics copy operations.
9649
96502011-11-27 Eli Zaretskii <eliz@gnu.org>
9651
9652 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9653 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9654 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9655 (malloc, free, realloc, calloc): Redirect to e_* only when
9656 compiling Emacs.
9657
9658 * lisp.h (GCTYPEBITS): Move before first use.
9659 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9660 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9661 this macro definition.
9662
9663 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9664 _MSC_VER.
9665
96662011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9667
9668 * gtkutil.c (xg_create_frame_widgets):
9669 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9670 present with Gtk+ 2.0.
9671
96722011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9673
9674 * fileio.c (Finsert_file_contents): Undo previous change; see
9675 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9676
96772011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9678
9679 Rename locals to avoid shadowing.
9680 * fileio.c (Finsert_file_contents):
9681 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9682 * process.c (wait_reading_process_output):
9683 Rename inner 'proc' to 'p' to avoid shadowing.
9684 Indent for consistency with usual Emacs style.
9685
96862011-11-25 Eli Zaretskii <eliz@gnu.org>
9687
9688 * xdisp.c (redisplay_window): If cursor row is not fully visible
9689 after recentering, and scroll-conservatively is set to a large
9690 number, scroll window by a few more lines to make the cursor fully
9691 visible and out of scroll-margin. (Bug#10105)
9692 (start_display): Don't move to the next line if the display should
9693 start at a newline that is part of a display vector or an overlay
9694 string. (Bug#10119)
9695
96962011-11-24 Juri Linkov <juri@jurta.org>
9697
9698 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9699 after the `MagickPingImage' call. (Bug#10112)
9700
97012011-11-23 Chong Yidong <cyd@gnu.org>
9702
9703 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9704
97052011-11-23 Martin Rudalics <rudalics@gmx.at>
9706
9707 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9708 making another buffer current. (Bug#10114)
9709
97102011-11-23 Glenn Morris <rgm@gnu.org>
9711
9712 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9713
97142011-11-23 Chong Yidong <cyd@gnu.org>
9715
9716 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9717 using it (Bug#5984).
9718
97192011-11-22 Eli Zaretskii <eliz@gnu.org>
9720
9721 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9722 and header-lines, as they don't have one computed for them.
9723 (Bug#10098)
9724
9725 * .gdbinit (prow): Make displayed values more self-explaining.
9726 Add row's hash code.
9727
97282011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9729
9730 * process.c (wait_reading_process_output): Fix asynchrounous
9731 GnuTLS socket handling on some versions of the GnuTLS library.
9732 (wait_reading_process_output): Add comment and URL.
9733
97342011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9735
9736 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9737
97382011-11-21 Chong Yidong <cyd@gnu.org>
9739
9740 * window.c (Fnext_window, Fprevious_window): Doc fix.
9741
97422011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9743
9744 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9745
97462011-11-20 Juanma Barranquero <lekktu@gmail.com>
9747
9748 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9749
97502011-11-20 Martin Rudalics <rudalics@gmx.at>
9751
9752 * window.c (Fset_window_combination_limit): Rename argument
9753 STATUS to LIMIT.
9754 (Vwindow_combination_limit): Remove "status" from doc-string.
9755
97562011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9757
9758 * m/ibms390.h: Remove.
9759 * m/ibms390x.h: Don't include "ibms390.h".
9760
97612011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9762
9763 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9764 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9765
97662011-11-20 Juanma Barranquero <lekktu@gmail.com>
9767
9768 * casetab.c (Fset_case_table):
9769 * charset.c (Fcharset_after): Fix typos.
9770
97712011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9772
9773 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9774 Otherwise, valgrind does not work on some platforms.
9775 Problem reported by Andreas Schwab in
9776 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9777 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9778 is set, removing the need for VIRT_ADDRESS_VARIES.
9779 (PURE_P): Use a more-efficient implementation that needs just one
9780 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9781 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9782 to 4 (xorl, subq, cmpq, setbe).
9783 * alloc.c (pure): Always extern now, since that's the
9784 VIRT_ADDR_VARIES behavior.
9785 (PURE_POINTER_P): Use a single comparison, not two, for
9786 consistency with the new puresize.h.
9787 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9788 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9789 Remove VIRT_ADDR_VARIES no longer needed.
9790
97912011-11-19 Eli Zaretskii <eliz@gnu.org>
9792
9793 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9794 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9795 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9796 behave as if the cursor position were at the window margin.
9797
9798 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9799 and the cursor position is out of bounds, behave as if the cursor
9800 position were at the window margin. (Bug#10075)
9801
98022011-11-18 Chong Yidong <cyd@gnu.org>
9803
9804 * window.c (Fwindow_combination_limit): Make first argument
9805 non-optional, since it is meaningless for live windows like the
9806 selected window.
9807
98082011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9809
9810 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9811
98122011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9813
9814 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9815 (graft_intervals_into_buffer): Simplify.
9816
98172011-11-18 Eli Zaretskii <eliz@gnu.org>
9818
9819 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9820 hash values of the two rows.
9821 (copy_row_except_pointers): Preserve the used[] arrays and the
9822 hash values of the two rows. (Bug#10035)
9823 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9824
9825 * xdisp.c (row_hash): New function, body extracted from
9826 compute_line_metrics.
9827 (compute_line_metrics): Call row_hash, instead of computing the
9828 hash code inline.
9829
9830 * dispnew.c (verify_row_hash): Call row_hash for computing the
9831 hash code of a row, instead of duplicating code from xdisp.c.
9832
9833 * dispextern.h (row_hash): Add prototype.
9834
98352011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9836
9837 * frame.c (delete_frame): Don't delete the terminal when the last
9838 X frame is closed if emacs is built with GTK toolkit.
9839
98402011-11-17 Juanma Barranquero <lekktu@gmail.com>
9841
9842 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9843
98442011-11-17 Martin Rudalics <rudalics@gmx.at>
9845
9846 * window.c (Vwindow_splits): Rename to
9847 Vwindow_combination_resize. Suggested by Juri Linkov.
9848 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9849 of Vwindow_splits.
9850
98512011-11-16 Juanma Barranquero <lekktu@gmail.com>
9852
9853 * nsfns.m (Fns_font_name):
9854 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9855
98562011-11-16 Martin Rudalics <rudalics@gmx.at>
9857
9858 * window.h (window): Rename slot "nest" to "combination_limit".
9859 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9860 (Fset_window_nest): Rename to Fset_window_combination_limit.
9861 (Vwindow_nest): Rename to Vwindow_combination_limit.
9862 (recombine_windows, make_parent_window, make_window)
9863 (Fsplit_window_internal, saved_window)
9864 (Fset_window_configuration, save_window_save): Rename all
9865 occurrences of window_nest to window_combination_limit.
9866
98672011-11-15 Juanma Barranquero <lekktu@gmail.com>
9868
9869 * image.c (imagemagick_load_image): Fix typo.
9870
98712011-11-14 Eli Zaretskii <eliz@gnu.org>
9872
9873 * xdisp.c (display_line): Move the call to
9874 highlight_trailing_whitespace before the call to
9875 compute_line_metrics, since the latter needs to see the final
9876 faces of all the glyphs to compute ROW's hash value.
9877 Fixes assertion violations in row_equal_p. (Bug#10035)
9878
98792011-11-14 Juanma Barranquero <lekktu@gmail.com>
9880
9881 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9882 just return (bug#10044).
9883
98842011-11-12 Eli Zaretskii <eliz@gnu.org>
9885
9886 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9887 with user-defined heap size. Bump the default size of the temacs
9888 heap to 27MB, to avoid memory warning when running temacs.
9889 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9890
9891 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9892 current_matrix and desired_matrix. (Bug#9990)
9893 (verify_row_hash) [XASSERTS]: New function.
9894 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9895 that the hash value of glyph rows is correct.
9896
98972011-11-12 Martin Rudalics <rudalics@gmx.at>
9898
9899 * window.h (window): Remove splits slot.
9900 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9901 (Fdelete_other_windows_internal, make_parent_window)
9902 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9903 (Fset_window_configuration, save_window_save): Don't deal with
9904 split status of windows.
9905 (saved_window): Remove splits slot.
9906 (Vwindow_splits): Rewrite doc-string.
9907
99082011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9909
9910 * xfns.c (unwind_create_frame):
9911 * nsfns.m (unwind_create_frame):
9912 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9913 Vframe_list (Bug#9999).
9914
99152011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9916
9917 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9918
99192011-11-11 Kenichi Handa <handa@m17n.org>
9920
9921 * callproc.c (Fcall_process): Set the member dst_multibyte of
9922 process_coding.
9923
99242011-11-11 Johan Bockgård <bojohan@gnu.org>
9925
9926 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9927 avoid a crash (bug#9496).
9928
99292011-11-09 Chong Yidong <cyd@gnu.org>
9930
9931 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9932 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9933
99342011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9935
9936 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9937
99382011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9939
9940 Avoid some portability problems by eschewing 'extern inline' functions.
9941 The trivial performance wins aren't worth the portability hassles; see
9942 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9943 et seq.
9944 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9945 (window_box_width, window_box_left, window_box_left_offset)
9946 (window_box_right, window_box_right_offset): Undo previous change,
9947 by removing the "extern"s.
9948 * intervals.c (adjust_intervals_for_insertion)
9949 (adjust_intervals_for_deletion): Undo previous change,
9950 making these static again.
9951 (offset_intervals, temp_set_point_both, temp_set_point)
9952 (copy_intervals_to_string): No longer inline.
9953 * xdisp.c (window_text_bottom_y, window_box_width)
9954 (window_box_height, window_box_left_offset)
9955 (window_box_right_offset, window_box_left, window_box_right)
9956 (window_box): No longer inline.
9957
99582011-11-08 Chong Yidong <cyd@gnu.org>
9959
9960 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9961 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9962 Signal an error if not a live window.
9963 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9964 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9965
99662011-11-07 Juanma Barranquero <lekktu@gmail.com>
9967
9968 * lisp.h (syms_of_abbrev): Remove declaration.
9969 Reported by CHENG Gao <chenggao@royau.me>.
9970
99712011-11-07 Eli Zaretskii <eliz@gnu.org>
9972
9973 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9974 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9975 of temacs in GUI mode.
9976
99772011-11-07 Martin Rudalics <rudalics@gmx.at>
9978
9979 * window.h: Declare delete_all_child_windows instead of
9980 delete_all_subwindows.
9981 * window.c (Fwindow_nest, Fset_window_nest)
9982 (Fset_window_new_total, Fset_window_new_normal)
9983 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9984 (delete_all_subwindows): Rename to delete_all_child_windows.
9985 (Fdelete_other_windows_internal, Fset_window_configuration):
9986 Call delete_all_child_windows instead of delete_all_subwindows.
9987 * frame.c (delete_frame): Call delete_all_child_windows instead
9988 of delete_all_subwindows.
9989
99902011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9991
9992 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9993 This is also needed for porting to any host where GC_MARK_STACK is
9994 not GC_MAKE_GCPROS_NOOPS.
9995 (which_symbols): Use it.
9996
99972011-11-07 Kenichi Handa <handa@m17n.org>
9998
9999 * coding.c (coding_set_destination): Check coding->src_pos only
10000 when coding->src_object is a buffer (bug#9910).
10001
10002 * process.c (send_process): Set the member src_multibyte of coding
10003 to 0 (bug#9911) when sending a unibyte text.
10004
10005 * callproc.c (Fcall_process): Set the member src_multibyte of
10006 process_coding to 0 (bug#9912).
10007
100082011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10009
10010 * xmenu.c (cleanup_widget_value_tree): New function.
10011 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10012 calling free_menubar_widget_value_tree directly (Bug#9830).
10013
100142011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10015
10016 Fix some portability problems with 'inline'.
10017 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10018 (window_box_width, window_box_left, window_box_left_offset)
10019 (window_box_right, window_box_right_offset): Declare extern.
10020 Otherwise, these inline functions do not conform to C99 and
10021 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10022 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10023 * intervals.c (adjust_intervals_for_insertion)
10024 (adjust_intervals_for_deletion): Now extern, because otherwise the
10025 extern inline functions 'offset_intervals' couldn't refer to it.
10026 (static_offset_intervals): Remove.
10027 (offset_intervals): Rewrite using the old contents of
10028 static_offset_intervals. The old version didn't conform to C99
10029 because an extern inline function contained a reference to an
10030 identifier with static linkage.
10031
100322011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10033
10034 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10035 GC.
10036
100372011-11-06 Eli Zaretskii <eliz@gnu.org>
10038
10039 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10040 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10041 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10042 return Qleft_to_right.
10043
100442011-11-06 Chong Yidong <cyd@gnu.org>
10045
10046 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10047 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10048 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10049 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10050 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10051 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10052 (Fwindow_vscroll): Doc fix.
10053 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10054 argument, since it makes no sense to pass a live window and for
10055 consistency with window-child.
10056
100572011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10058
10059 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10060 support MSVC.
10061
100622011-11-05 Jason Rumney <jasonr@gnu.org>
10063
10064 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10065 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10066 fonts (Bug#6029).
10067 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10068 bitwise arithmetic preventing use of unicode-sip and non-truetype
10069 opentype fonts.
10070
100712011-11-05 Eli Zaretskii <eliz@gnu.org>
10072
10073 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10074 "emacs"-only part.
10075
10076 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10077 initialization code to keep similarity to xfns.c after changes
10078 from 2011-11-05.
10079
100802011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10081
10082 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10083 (unwind_create_frame): New function (Bug#9943).
10084 (Fx_create_frame): Restructure code to be more similar to the one in
10085 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10086 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10087 Move terminal->reference_count++ just before making the frame official
10088 (Bug#9943).
10089
10090 * nsterm.m (x_free_frame_resources): New function.
10091 (x_destroy_window): Move code to x_free_frame_resources.
10092
10093 * xfns.c (unwind_create_frame): Fix comment.
10094 (Fx_create_frame, x_create_tip_frame):
10095 Move terminal->reference_count++ just before making the frame
10096 official. Move initialization of image_cache_refcount and
10097 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10098
100992011-11-05 Eli Zaretskii <eliz@gnu.org>
10100
10101 Support MSVC build with newer versions of Visual Studio.
10102 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10103 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10104 nt/gmake.defs.
10105
10106 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10107 which are not supported by MSVC.
10108 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10109 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10110 bitfields.
10111 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10112 types in bitfields.
10113 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10114
10115 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10116
101172011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
10118
10119 Support MSVC build with newer versions of Visual Studio.
10120 * w32.c: Don't include w32api.h for MSVC.
10121 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10122
10123 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10124 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10125 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10126 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10127 e_* cousins.
10128 (alloca) [_MSC_VER]: Define to _alloca.
10129
10130 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10131
10132 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10133
101342011-11-04 Eli Zaretskii <eliz@gnu.org>
10135
10136 * xdisp.c (note_mouse_highlight): If either of
10137 previous/next-single-property-change returns nil, treat that as
10138 the beginning or the end of the buffer. (Bug#9955)
10139
101402011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10141
10142 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10143 label is not null (Bug#9951).
10144 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10145 may be NULL.
10146
101472011-11-04 Eli Zaretskii <eliz@gnu.org>
10148
10149 * window.c (Fwindow_body_size): Mention in the doc string that the
10150 return value is in frame's canonical units. (Bug#9949)
10151
101522011-11-03 Eli Zaretskii <eliz@gnu.org>
10153
10154 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10155
10156 * w32fns.c (unwind_create_frame): If needed, free the glyph
10157 matrices of the partially constructed frame. (Bug#9943)
10158 * xfns.c (unwind_create_frame): Likewise.
10159
101602011-11-01 Eli Zaretskii <eliz@gnu.org>
10161
10162 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10163 Don't stop backward scan on the continuation glyph, even though
10164 its CHARPOS is positive.
10165 (mouse_face_from_buffer_pos, note_mouse_highlight):
10166 Rename cover_string to disp_string.
10167
101682011-11-01 Martin Rudalics <rudalics@gmx.at>
10169
10170 * window.c (temp_output_buffer_show): Don't use
10171 Vtemp_buffer_show_specifiers.
10172 (Vtemp_buffer_show_specifiers): Remove unused variable.
10173
101742011-10-30 Eli Zaretskii <eliz@gnu.org>
10175
10176 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10177 past the beginning of the current glyph matrix.
10178
101792011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
10180
10181 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10182 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10183 HAVE_GTK3 (Bug#9869).
10184
10185 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10186 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10187
10188 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10189
10190 * xterm.c: Declare x_handle_net_wm_state to return int.
10191 (handle_one_xevent): Check if we are iconified but don't have
10192 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10193 (get_current_wm_state): Return non-zero if not hidden,
10194 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10195 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10196 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10197 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10198
101992011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10200
10201 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10202 so that this new function doesn't get optimized away by a
10203 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10204
102052011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10206
10207 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10208
102092011-10-29 Eli Zaretskii <eliz@gnu.org>
10210
10211 Fix the `xbytecode' command.
10212 * .gdbinit (xprintbytestr): New command.
10213 (xwhichsymbols): Rename from `which'; all callers changed.
10214 (xbytecode): Print the byte-code string as well.
10215
102162011-10-29 Kim Storm <storm@cua.dk>
10217
10218 * alloc.c (which_symbols): New function.
10219
102202011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10221
10222 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10223 line. (Bug#9903)
10224
102252011-10-29 Glenn Morris <rgm@gnu.org>
10226
10227 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10228 Not clear what it was for, and it causes various bugs. (Bug#9839)
10229
102302011-10-28 Eli Zaretskii <eliz@gnu.org>
10231
10232 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10233 possible random value that matches one of those tested as
10234 condition to clear the mouse face.
10235
102362011-10-28 Chong Yidong <cyd@gnu.org>
10237
10238 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10239
102402011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10241
10242 * window.c (make_window): Initialize phys_cursor_on_p.
10243
102442011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10245
10246 * lisp.h (struct Lisp_Symbol): Update comments.
10247
102482011-10-28 Juanma Barranquero <lekktu@gmail.com>
10249
10250 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10251
102522011-10-28 Eli Zaretskii <eliz@gnu.org>
10253
10254 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10255 <oslsachem@gmail.com> for helping to debug this.
10256
10257 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10258 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10259 (g_b_init_get_glyph_outline_w): New static variables.
10260 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10261 (GetGlyphOutlineW_Proc): New typedefs.
10262 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10263 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10264 New functions.
10265 (w32font_open_internal, compute_metrics):
10266 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10267 instead of calling the "wide" APIs directly.
10268
10269 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10270
10271 * w32.h (syms_of_w32font): Add prototype.
10272
102732011-10-27 Juanma Barranquero <lekktu@gmail.com>
10274
10275 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10276 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10277 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10278 (Fmove_to_window_line): Doc fix.
10279
102802011-10-27 Chong Yidong <cyd@gnu.org>
10281
10282 * process.c (make_process): Set gnutls_state to NULL.
10283
10284 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10285 non-NULL, regardless of GNUTLS_INITSTAGE.
10286 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10287 an error. Set process slots as soon as we allocate them.
10288
10289 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10290
102912011-10-27 Chong Yidong <cyd@gnu.org>
10292
10293 * gnutls.c (emacs_gnutls_deinit): New function.
10294 Deallocate credentials structures as well as calling gnutls_deinit.
10295 (Fgnutls_deinit, Fgnutls_boot): Use it.
10296
10297 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10298 (deactivate_process): Call emacs_gnutls_deinit.
10299
103002011-10-27 Juanma Barranquero <lekktu@gmail.com>
10301
10302 * image.c (x_create_x_image_and_pixmap):
10303 * w32.c (sys_rename, w32_delayed_load):
10304 * w32font.c (fill_in_logfont):
10305 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10306
103072011-10-26 Juanma Barranquero <lekktu@gmail.com>
10308
10309 * w32fns.c (w32_default_color_map): New function,
10310 extracted from Fw32_default_color_map.
10311 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10312
103132011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10314
10315 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10316
103172011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10318
10319 * keyboard.c (test_undefined): New function (bug#9751).
10320 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10321
103222011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10323
10324 * sysdep.c (init_sys_modes): Fix the check for the controlling
10325 terminal (Bug#6649).
10326
103272011-10-20 Eli Zaretskii <eliz@gnu.org>
10328
10329 * dispextern.h (struct bidi_it): New member next_en_type.
10330
10331 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10332 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10333 current character, check also for next_en_type being WEAK_EN.
10334 (bidi_resolve_weak): Don't enter the expensive loop if the current
10335 position is before next_en_pos. Record the bidi type of the first
10336 non-ET, non-BN character we find, in addition to its position.
10337 (bidi_level_of_next_char): Invalidate next_en_type when
10338 next_en_pos is over-stepped.
10339
103402011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10341
10342 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10343 * editfns.c: Rewrite current-time-zone so that it invokes
10344 the equivalent of (format-time-string "%Z") to get the time zone name.
10345 This fixes a bug when the time zone name contains characters that
10346 need converting from the system time locale to Emacs internal format.
10347 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10348 that patch fixed format-time-string to do the conversion, but
10349 I forgot to fix current-time-zone.
10350 (format_time_string): New function, containing most of
10351 what Fformat_time_string used to contain.
10352 (Fformat_time_string): Rewrite in terms of format_time_string.
10353 This doesn't change this function's behavior.
10354 (current-time-zone): Rewrite to use format_time_string.
10355 This fixes the bug reported by Michael Schierl in
10356 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10357 Jason Rumney's 2007-06-07 change worked around this bug, but
10358 didn't fix it.
10359 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10360
103612011-10-19 Eli Zaretskii <eliz@gnu.org>
10362
10363 * xdisp.c (start_display): If the character at POS is displayed
10364 via a display vector, reset IT->current.dpvec_index to zero.
10365 (try_window_reusing_current_matrix): If a line ends in a display
10366 vector or the next line starts in a display vector, continue
10367 redrawing the window even though the character position of
10368 start_row was reached.
10369 (Bug#9771, part 2)
10370
103712011-10-18 Chong Yidong <cyd@gnu.org>
10372
10373 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10374 with nobreak-char-display too.
10375
103762011-10-18 Eli Zaretskii <eliz@gnu.org>
10377
10378 Fix part 3 of bug#9771.
10379 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10380 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10381 non-neutral characters if the current character is a paragraph
10382 separator (a.k.a. Newline). This avoids running the same
10383 expensive loop twice, once when we consume the preceding newline
10384 and the other time when the line actually needs to be displayed.
10385 Avoid the loop when we see neutrals on the base embedding level
10386 following a character whose directionality is the same as the
10387 paragraph's. This avoids running the expensive loop when a line
10388 ends in a long sequence of neutrals, like control characters.
10389 Add assertion against STRONG_AL type. Slightly rearrange code
10390 that determines the type of a neutral given the first non-neutral
10391 that follows it.
10392 (bidi_level_of_next_char): Set next_en_pos to zero when
10393 invalidating its info.
10394
103952011-10-17 Eli Zaretskii <eliz@gnu.org>
10396
10397 * xdisp.c (push_display_prop): Determine whether to record string
10398 or buffer position by IT->string, not by IT->method. Allow
10399 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10400 (move_it_vertically_backward): Don't look for character position
10401 immediately after the newline when in a continuation line.
10402 (Bug#9771, part 1)
10403
104042011-10-15 Martin Rudalics <rudalics@gmx.at>
10405
10406 * window.c (coordinates_in_window): Rewrite and delabelize
10407 vertical border check. (Bug#5357) (Bug#9618)
10408
104092011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10410
10411 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10412 errors in XSetWindowBorder (bug#9310).
10413
104142011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10415
10416 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10417 avoid crash when xmalloc overrun checking is enabled.
10418
104192011-10-13 Eli Zaretskii <eliz@gnu.org>
10420
10421 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10422 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10423 cursor motion with <left> and <right> arrow keys.
10424
10425 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10426 some callers set that themselves.
10427
104282011-10-12 Eli Zaretskii <eliz@gnu.org>
10429
10430 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10431 display string and the previous row comes from the same string and
10432 is empty. (Bug#9739) (Bug#9738)
10433
104342011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10435
10436 * doc.c (get_doc_string): Encode file name (bug#9735).
10437
104382011-10-12 Eli Zaretskii <eliz@gnu.org>
10439
10440 * bidi.c (bidi_level_of_next_char):
10441 * xdisp.c (get_visually_first_element): Remove old incorrect
10442 comments regarding the Unicode Line Separator character.
10443
10444 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10445
104462011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10447
10448 * alloc.c (Fgc_status): Do not access beyond zombies array
10449 boundary if nzombies > MAX_ZOMBIES.
10450 * alloc.c (dump_zombies): Add missing format specifier.
10451
104522011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10453
10454 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10455 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10456
10457 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10458 Some packages use them to denote characters with modifiers.
10459
104602011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10461
10462 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10463 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10464 matching a pp-number. Rename parameter var to var1.
10465
104662011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10467
10468 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10469
104702011-10-08 Glenn Morris <rgm@gnu.org>
10471
10472 * callint.c (Fcall_interactively): Give a more explicit error for the
10473 'c' case with a non-character input. (Bug#8479)
10474
104752011-10-08 Eli Zaretskii <eliz@gnu.org>
10476
10477 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10478 lines.
10479 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10480 lines that are hscrolled on the left.
10481
10482 * dispnew.c (buffer_posn_from_coords): Account for a possible
10483 presence of header-line. (Bug#4426)
10484
104852011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10486
10487 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10488 Don't advertise functionality which we discourage or doesn't work.
10489
104902011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10491
10492 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10493 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10494 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10495 this makes Emacs dump core during garbage collection on rare
10496 occasions. sizeof is obviously inferior to offsetof here, so
10497 stick with offsetof.
10498 (GC_POINTER_ALIGNMENT): New macro.
10499 (mark_memory): Omit 3rd (offset) arg; caller changed.
10500 Don't assume EMACS_INT alignment is the same as pointer alignment.
10501
105022011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10503
10504 * keyboard.c (read_key_sequence_remapped): New var.
10505 (read_key_sequence): Compute remapping in the right buffer.
10506 (command_loop_1): Use read_key_sequence's remapping directly.
10507
105082011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10509
10510 * dired.c (file_name_completion): Don't expand file name.
10511 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10512 before checking file name handler.
10513
10514 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10515 they've been requested explicitly (bug#9591).
10516
105172011-10-01 Andreas Schwab <schwab@linux-m68k.org>
10518
10519 * keymap.c (Fsingle_key_description): Use make_specified_string
10520 instead of build_string to build string from push_key_description.
10521 (Bug#5193)
10522
105232011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10524
10525 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10526 This fixes a Y2038 bug on 64-bit hosts.
10527 * buffer.c (reset_buffer):
10528 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10529 (Fclear_buffer_auto_save_failure):
10530 Use 0, not -1, to represent an unset failure time, since time_t
10531 might not be signed.
10532
10533 Remove dependency on glibc malloc internals.
10534 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10535 Move back here from lisp.h, but with their new implementations.
10536 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10537 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10538 * charset.c (charset_table_init): New static var.
10539 (syms_of_charset): Use it instead of xmalloc. This removes a
10540 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10541 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10542 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10543 Move back to alloc.c.
10544 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10545 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10546
105472011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10548
10549 * nsterm.m (windowDidResize): Call x_set_window_size only when
10550 ns_in_resize is true. Otherwise set pixelwidth/height and
10551 call change_frame_size (Bug#9628).
10552
105532011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10554
10555 Port --enable-checking=all to Fedora 14 x86-64.
10556 * charset.c (syms_of_charset): Also account for glibc malloc's
10557 internal overhead when calculating the initial malloc maximum.
10558
10559 Port --enable-checking=all to Fedora 14 x86.
10560 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10561 Move to lisp.h.
10562 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10563 (overrun_check_realloc, overrun_check_free):
10564 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10565 That way, xmalloc returns a properly-aligned pointer even if
10566 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10567 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10568 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10569 into account when calculating the initial malloc maximum.
10570 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10571 Move here from alloc.c, so that charset.c can use it too.
10572 Properly align; the old code wasn't right for common 32-bit hosts
10573 when configured with --enable-checking=all.
10574 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10575 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10576
105772011-09-29 Eli Zaretskii <eliz@gnu.org>
10578
10579 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10580 use EDOM.
10581
105822011-09-28 Eli Zaretskii <eliz@gnu.org>
10583
10584 * xdisp.c (compute_display_string_end): If there's no display
10585 string at CHARPOS, return -1.
10586
10587 * bidi.c (bidi_fetch_char): When compute_display_string_end
10588 returns a negative value, treat the character as a normal
10589 character not covered by a display string. (Bug#9624)
10590
105912011-09-28 Juanma Barranquero <lekktu@gmail.com>
10592
10593 * lread.c (Fread_from_string): Fix typo in docstring.
10594
105952011-09-27 Eli Zaretskii <eliz@gnu.org>
10596
10597 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10598 newline, reseat the iterator instead of bidi-iterating there one
10599 character at a time. (Bug#9610)
10600 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10601 TO_CHARPOS if the bidi iterator is at base embedding level.
10602
106032011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10604
10605 * lread.c (readevalloop): Use correct code for NBSP.
10606 (read1): Likewise. (Bug#9608)
10607
106082011-09-25 Michael Albinus <michael.albinus@gmx.de>
10609
10610 * dbusbind.c (Fdbus_register_signal): When service is not
10611 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10612
106132011-09-25 Glenn Morris <rgm@gnu.org>
10614
10615 * buffer.c (truncate-lines): Doc fix.
10616
106172011-09-24 Chong Yidong <cyd@stupidchicken.com>
10618
10619 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10620 (Fset_window_next_buffers): Doc fix.
10621
106222011-09-24 Glenn Morris <rgm@gnu.org>
10623
10624 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10625
106262011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10627
10628 Fix minor problems found by static checking.
10629 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10630 * indent.c (Fvertical_motion): Fix == vs = typo.
10631
106322011-09-24 Eli Zaretskii <eliz@gnu.org>
10633
10634 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10635 Default value is now t. Doc fix.
10636
10637 * indent.c (Fvertical_motion): Compute and apply the overshoot
10638 logic when moving up, not only when moving down. Fix the
10639 confusing name and values of the it_overshoot_expected variable;
10640 logic changes accordingly. (Bug#9254) (Bug#9549)
10641
10642 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10643 CHARPOS is covered by a display string which includes newlines.
10644 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10645 is covered by a display string with embedded newlines.
10646
106472011-09-24 Michael Albinus <michael.albinus@gmx.de>
10648
10649 * dbusbind.c (Fdbus_register_signal): Add match rule to
10650 Vdbus_registered_objects_table. (Bug#9581)
10651 (Fdbus_register_method, Vdbus_registered_objects_table):
10652 Fix docstring.
10653
106542011-09-24 Jim Meyering <meyering@redhat.com>
10655
10656 do not ignore write error for any output size
10657 The previous change was incomplete.
10658 While it makes emacs --batch detect the vast majority of stdout
10659 write failures, errors were still ignored whenever the output size is
10660 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10661 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10662 && echo FAIL: ignored write error
10663 FAIL: ignored write error
10664 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10665 && echo FAIL: ignored write error
10666 FAIL: ignored write error
10667 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10668
106692011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10670
10671 * emacs.c (Fkill_emacs): In noninteractive mode exit
10672 non-successfully if a write error occurred on stdout. (Bug#9574)
10673
106742011-09-21 Eli Zaretskii <eliz@gnu.org>
10675
10676 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10677 the xassert test.
10678
10679 * dispextern.h (struct it): Update the comment documenting what
10680 can it->OBJECT be.
10681
106822011-09-20 Eli Zaretskii <eliz@gnu.org>
10683
10684 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10685 a display string, extend search for cursor position to end of row.
10686 (find_row_edges): If the row ends in a newline from a display
10687 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10688 Handle the case of a display string with multiple newlines.
10689 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10690 non-empty line. Fixes confusing cursor motion with arrow keys at
10691 the beginning of a line that starts with whitespace.
10692
106932011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10694
10695 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10696 (bug#9493).
10697
106982011-09-18 Chong Yidong <cyd@stupidchicken.com>
10699
10700 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10701 boolean (Bug#9154).
10702
107032011-09-18 Eli Zaretskii <eliz@gnu.org>
10704
10705 * xdisp.c (display_line): Record maximum and minimum buffer
10706 positions even if no glyphs were produced (e.g., by a zero-width
10707 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10708 buffer positions that will be removed from the glyph row because
10709 they don't fit.
10710 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10711 column is beyond frame width: don't subtract 1 "pixel" when
10712 computing width of the stretch.
10713 (reseat_at_next_visible_line_start): Undo the change made on
10714 2011-09-17 that saved paragraph information and restored it after
10715 the call to `reseat'. (Bug#9545)
10716
107172011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10718
10719 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10720 and turn window cursor on if cleared (Bug#9415).
10721
107222011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10723
10724 * search.c (boyer_moore): Take unibyte characters from pattern
10725 literally. (Bug#9458)
10726
107272011-09-18 Eli Zaretskii <eliz@gnu.org>
10728
10729 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10730
107312011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10732
10733 Fix minor problem found by static checking.
10734 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10735 initialized, to pacify gcc -Wuninitialized.
10736
10737 * fileio.c: Report proper errno when syscall falls.
10738 (Finsert_file_contents): Save and restore errno,
10739 so that report_file_error outputs the correct diagnostic.
10740 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10741
107422011-09-18 Eli Zaretskii <eliz@gnu.org>
10743
10744 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10745
107462011-09-17 Eli Zaretskii <eliz@gnu.org>
10747
10748 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10749 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10750
107512011-09-17 Eli Zaretskii <eliz@gnu.org>
10752
10753 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10754 about the current paragraph and restore it after the call to reseat.
10755
10756 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10757 (bidi_find_paragraph_start): Search back for paragraph beginning
10758 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10759 (bidi_move_to_visually_next): Only trigger paragraph-related
10760 computations when the last character is a newline or at EOB, not
10761 just any NEUTRAL_B. (Bug#9470)
10762
10763 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10764 truncated lines if point is covered by a display string. (Bug#9524)
10765
107662011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10767
10768 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10769 (cons_to_x_long): New function.
10770 (lisp_data_to_selection_data): Use it. Correct the test for
10771 short-versus-long data; it was negated. Break out of vector
10772 loop, for efficiency, when a long datum is discovered.
10773
107742011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10775
10776 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10777
107782011-09-16 Eli Zaretskii <eliz@gnu.org>
10779
10780 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10781 GCC PR/17406) by declaring this function with external scope.
10782
107832011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10784
10785 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10786 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10787
107882011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10789
10790 * editfns.c (Fformat): Correctly handle text properties on "%%".
10791
107922011-09-15 Eli Zaretskii <eliz@gnu.org>
10793
10794 * xterm.c (x_draw_composite_glyph_string_foreground):
10795 * w32term.c (x_draw_composite_glyph_string_foreground):
10796 * term.c (encode_terminal_code):
10797 * composite.c (composition_update_it, get_composition_id):
10798 * xdisp.c (get_next_display_element)
10799 (fill_composite_glyph_string): Add comments about special meaning
10800 of TAB characters in a composition.
10801
108022011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10803
10804 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10805 This occurs when processing a multibyte format.
10806 Problem reported by Wolfgang Jenker.
10807
108082011-09-15 Johan Bockgård <bojohan@gnu.org>
10809
10810 * xdisp.c (try_cursor_movement): Only check for exact match if
10811 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10812
108132011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10814
10815 Remove unused external symbols.
10816 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10817 * xdisp.c (calc_pixel_width_or_height): Now static.
10818 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10819 * indent.c (check_display_width):
10820 * w32term.c: Fix comment to match code.
10821 * xterm.c, xterm.h (x_catching_errors): Remove.
10822
108232011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10824
10825 * xselect.c: Use signed conversions more consistently (Bug#9498).
10826 (selection_data_to_lisp_data): Assume incoming selection data are
10827 signed integers, not unsigned. This is to be consistent with
10828 outgoing selection data, which was modified to use signed integers
10829 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10830 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10831 expects long, not unsigned long.
10832
108332011-09-14 Eli Zaretskii <eliz@gnu.org>
10834
10835 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10836 computation of loop end. Reported by Johan Bockgård
10837 <bojohan@gnu.org>.
10838
108392011-09-13 Chong Yidong <cyd@stupidchicken.com>
10840
10841 * frame.c (Fother_visible_frames_p): Function deleted.
10842
108432011-09-12 Eli Zaretskii <eliz@gnu.org>
10844
10845 * indent.c (compute_motion): Process display vector front to back
10846 rather than the other way around. (Bug#2496)
10847
108482011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10849
10850 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10851
108522011-09-11 Chong Yidong <cyd@stupidchicken.com>
10853
10854 * minibuf.c (Fread_from_minibuffer): Doc fix.
10855
108562011-09-11 Eli Zaretskii <eliz@gnu.org>
10857
10858 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10859 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10860
108612011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10862
10863 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10864 value for non-existent files.
10865
108662011-09-11 Eli Zaretskii <eliz@gnu.org>
10867
10868 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10869 set its "size" to -1. This will set the modtime_size field of
10870 the corresponding buffer to -1, which is what
10871 verify-visited-file-modtime expects for files that do not exist.
10872 (Bug#9139)
10873
108742011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10875
10876 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10877 here ...
10878 * lisp.h: ... from here. push_key_description is no longer
10879 defined in keyboard.c, so its declaration should not be in
10880 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10881 logically belongs with push_key_description.
10882
108832011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10884
10885 * buffer.h: Include <sys/types.h> instead of <time.h>.
10886 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10887 Problem reported by Herbert J. Skuhra.
10888
108892011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10890
10891 * xml.c (parse_region): Make the parsing work for
10892 non-comment-starting XML files again (bug#9144).
10893
108942011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10895
10896 * image.c (gif_load): Fix calculation of bottom and right corner.
10897 (Bug#9468)
10898
108992011-09-10 Eli Zaretskii <eliz@gnu.org>
10900
10901 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10902 redisplay in small windows.
10903
109042011-09-09 Eli Zaretskii <eliz@gnu.org>
10905
10906 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10907
109082011-09-08 Martin Rudalics <rudalics@gmx.at>
10909
10910 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10911 Operate on live windows only.
10912
109132011-09-08 Juanma Barranquero <lekktu@gmail.com>
10914
10915 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10916
109172011-09-07 Eli Zaretskii <eliz@gnu.org>
10918
10919 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10920 only under bidi iteration.
10921
109222011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10923
10924 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10925
109262011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10927
10928 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10929 Without this fix, the command to link temacs failed due to an
10930 undefined symbol __builtin_isnan. This is because
10931 /usr/include/iso/math_c99.h #defines isnan(x) to
10932 __builtin_isnan(x), but the bundled gcc, which identifies itself
10933 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10934 a __builtin_isnan.
10935 * floatfns.c (isnan): #undef, and then #define to a clone of
10936 what's in data.c.
10937 (Fisnan): Always define, since it's always available now.
10938 (syms_of_floatfns): Always define isnan at the Lisp level.
10939
109402011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10941
10942 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10943
109442011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10945
10946 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10947 The previous code assumed that file offsets (off_t values) fit in
10948 EMACS_INT variables, which is not true on typical 32-bit hosts.
10949 The code messed up by falsely reporting buffer overflow in cases
10950 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10951 when "big" contains more than 2**29 bytes, even though this
10952 inserts just one byte and does not overflow the buffer.
10953 (Finsert_file_contents): Store file offsets as off_t
10954 values, not as EMACS_INT values. Check for overflow when
10955 converting between EMACS_INT and off_t. When checking for
10956 buffer overflow or for overlap, take the offsets into account.
10957 Don't use EMACS_INT for small values where int suffices.
10958 When checking for overlap, fix a typo: ZV was used where
10959 ZV_BYTE was intended.
10960 (Fwrite_region): Don't assume off_t fits into 'long'.
10961 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10962
109632011-09-05 Michael Albinus <michael.albinus@gmx.de>
10964
10965 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10966
109672011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10968
10969 sprintf-related integer and memory overflow issues (Bug#9412).
10970
10971 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10972 (esprintf, exprintf, evxprintf): New functions.
10973 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10974 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10975 (modify_event_symbol): Do not assume that the length of
10976 name_alist_or_stem is safe to alloca and fits in int.
10977 (Fexecute_extended_command): Likewise for function name and binding.
10978 (Frecursion_depth): Wrap around reliably on integer overflow.
10979 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10980 since some callers pass EMACS_INT values.
10981 (Fsingle_key_description): Don't crash if symbol name contains more
10982 than MAX_ALLOCA bytes.
10983 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10984 (get_minibuffer): Arg is now EMACS_INT, not int.
10985 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10986 (esprintf, exprintf, evxprintf): New decls.
10987 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10988
10989 * dbusbind.c (signature_cat): New function.
10990 (xd_signature, Fdbus_register_signal):
10991 Do not overrun buffer; instead, report string overflow.
10992
10993 * dispnew.c (add_window_display_history): Don't overrun buffer.
10994 Truncate instead; this is OK since it's just a log.
10995
10996 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10997 even if the time zone offset is outlandishly large.
10998 Don't mishandle offset == INT_MIN.
10999
11000 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11001 when creating daemon; the previous buffer-overflow check was incorrect.
11002
11003 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11004 which has the guts of the old verror function.
11005
11006 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11007 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11008
11009 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11010 (font_unparse_xlfd): Don't blindly alloca long strings.
11011 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11012 fits in int, when using sprintf. Use single snprintf to count
11013 length of string rather than counting it via multiple sprintfs;
11014 that's simpler and more reliable.
11015 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11016 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11017 sprintf, in case result does not fit in int.
11018
11019 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11020 (fontset_from_font): Print it.
11021
11022 * frame.c (tty_frame_count): Now printmax_t, not int.
11023 (make_terminal_frame, set_term_frame_name): Print it.
11024 (x_report_frame_params): In X, window IDs are unsigned long,
11025 not signed long, so print them as unsigned.
11026 (validate_x_resource_name): Check for implausibly long names,
11027 and don't assume name length fits in 'int'.
11028 (x_get_resource_string): Don't blindly alloca invocation name;
11029 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11030 not fit in int.
11031
11032 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11033 (xg_check_special_colors, xg_set_geometry):
11034 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11035
11036 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11037 Use esprintf, not sprintf, in case result does not fit in int.
11038
11039 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11040 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11041 it as a large positive number.
11042 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11043 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11044
11045 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11046 in case result does not fit in int.
11047
11048 * print.c (float_to_string): Detect width overflow more reliably.
11049 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11050 buffer overrun. Don't assume list length fits in 'int'. Treat
11051 print length of 0 as 0, not as infinity; to be consistent with other
11052 uses of print length in this function. Don't overflow print length
11053 index. Don't assume hash table size fits in 'long', or that
11054 vectorlike size fits in 'unsigned long'.
11055
11056 * process.c (make_process): Use printmax_t, not int, to format
11057 process-name gensyms.
11058
11059 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11060
11061 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11062 to avoid potential buffer overrun.
11063
11064 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11065 if X resource line is longer than 512 bytes.
11066
11067 * xfns.c (x_window): Make sprintf buffer a bit bigger
11068 to avoid potential buffer overrun.
11069
11070 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11071
11072 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11073
110742011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11075
11076 Integer overflow fixes for scrolling, etc.
11077 Without these, Emacs silently mishandles large integers sometimes.
11078 For example, "C-u 4294967297 M-x recenter" was treated as if
11079 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11080
11081 * xdisp.c (try_window_id): Check Emacs fixnum range before
11082 converting to 'int'.
11083
11084 * window.c (window_scroll_line_based, Frecenter):
11085 Check that an Emacs fixnum is in range before assigning it to 'int'.
11086 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11087 values converted from Emacs fixnums.
11088 (Frecenter): Don't wrap around a line count if it is out of 'int'
11089 range; instead, treat it as an extreme value.
11090 (Fset_window_configuration, compare_window_configurations):
11091 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11092
11093 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11094 that can exceed INT_MAX. Check that EMACS_INT value is in range
11095 before assigning it to the (possibly-narrower) index.
11096 (match_limit): Don't assume that a fixnum can fit in 'int'.
11097
11098 * print.c (print_object): Use ptrdiff_t, not int, for index that can
11099 exceed INT_MAX.
11100
11101 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11102 (Fvertical_motion): Don't wrap around LINES values that don't fit
11103 in 'int'. Instead, treat them as extreme values. This is good
11104 enough for windows, which can't have more than INT_MAX lines anyway.
11105
111062011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11107
11108 * Require libxml/parser.h to avoid compilation warning.
11109
11110 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11111
11112 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11113 since this reportedly can destroy thread storage.
11114
111152011-08-30 Chong Yidong <cyd@stupidchicken.com>
11116
11117 * syntax.c (find_defun_start): Update all cache variables if
11118 exiting early (Bug#9401).
11119
111202011-08-30 Eli Zaretskii <eliz@gnu.org>
11121
11122 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11123
11124 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11125 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11126 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11127
11128 * term.c (tty_append_glyph): New function.
11129 (produce_stretch_glyph): Static function and its prototype deleted.
11130
11131 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11132 Add prototypes.
11133
111342011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11135
11136 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11137 when checking :margin (Bug#9390).
11138 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11139 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11140 so that the name doesn't mislead. All uses changed.
11141
111422011-08-28 Johan Bockgård <bojohan@gnu.org>
11143
11144 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11145 set_tty_hooks.
11146
111472011-08-27 Eli Zaretskii <eliz@gnu.org>
11148
11149 * xdisp.c (move_it_to): Don't bail out early when reaching
11150 position beyond to_charpos, if we are scanning backwards.
11151 (move_it_vertically_backward): When DY == 0, make sure we get to
11152 the first character in the line after the newline.
11153
111542011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11155
11156 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11157 (ccl_driver): Do not generate an out-of-range pointer.
11158 (Fccl_execute_on_string): Remove unnecessary check for
11159 integer overflow, noted by Stefan Monnier in
11160 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11161 Remove a FIXME that didn't need fixing.
11162 Simplify the newly-introduced buffer reallocation code.
11163
111642011-08-27 Juanma Barranquero <lekktu@gmail.com>
11165
11166 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11167
111682011-08-26 Paul Eggert <eggert@cs.ucla.edu>
11169
11170 Integer and memory overflow issues (Bug#9196).
11171
11172 * doc.c (get_doc_string): Rework so that
11173 get_doc_string_buffer_size is the actual buffer size, rather than
11174 being 1 less than the actual buffer size; this makes xpalloc more
11175 convenient.
11176
11177 * image.c (x_allocate_bitmap_record, cache_image):
11178 * xselect.c (Fx_register_dnd_atom):
11179 Simplify previous changes by using xpalloc.
11180
11181 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11182 since either will do and ptrdiff_t is convenient with xpalloc.
11183
11184 * charset.c (charset_table_size)
11185 (struct charset_sort_data.priority): Now ptrdiff_t.
11186 (charset_compare): Don't overflow if priorities differ greatly.
11187 (Fsort_charsets): Don't assume list length fits in int.
11188 Check for size-calculation overflow when allocating sort data.
11189 (syms_of_charset): Allocate an initial charset table that is
11190 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11191
11192 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11193
11194 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11195 The actual value is always <= INT_MAX, and leaving it unsigned made
11196 overflow checking harder.
11197
11198 * dispextern.h (struct glyph_matrix.rows_allocated)
11199 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11200 with xpalloc. The values are still always <= INT_MAX.
11201
11202 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11203
11204 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11205 (SAFE_NALLOCA): New macro.
11206
11207 * region-cache.c (struct boundary.pos, find_cache_boundary)
11208 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11209 (set_cache_region, invalidate_region_cache)
11210 (revalidate_region_cache, know_region_cache, region_cache_forward)
11211 (region_cache_backward, pp_cache):
11212 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11213 so that ptrdiff_t * can be passed to xpalloc.
11214 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11215 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11216 (pp_cache): Don't assume cache_len fits in int.
11217 * region-cache.h: Adjust extern decls to match.
11218
11219 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11220 EMACS_INT, since either will do, for xpalloc.
11221
11222 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11223 (xnmalloc, xnrealloc, xpalloc): New functions.
11224
11225 * bidi.c (bidi_shelve_header_size): New constant.
11226 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11227 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11228
11229 * bidi.c (bidi_cache_shrink):
11230 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11231 (overlay_strings):
11232 Don't update size of array until after memory allocation succeeds,
11233 because xmalloc/xrealloc may not return.
11234 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11235 now that we have proper integer overflow checking.
11236 (record_overlay_string, overlay_strings): Catch overflows when
11237 calculating size of overlay_str_buf.
11238
11239 * callproc.c (Fcall_process): Check for size overflow when
11240 calculating size of args2.
11241 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11242 Normally we prefer signed values, but sticking with ptrdiff_t would
11243 require adding more-complicated checks.
11244
11245 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11246 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11247 Redo buffer-overflow calculations to avoid integer overflow.
11248 Add a FIXME comment where memory seems to be over-allocated.
11249
11250 * character.c (Fstring): Check for size-calculation overflow.
11251
11252 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11253 unnecessary integer overflow. Check for size overflow.
11254 (encode_coding_object): Don't update size until xmalloc succeeds.
11255
11256 * composite.c (get_composition_id): Check for overflow in glyph
11257 length calculations.
11258
11259 Integer and memory overflow fixes for display code.
11260 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11261 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11262 (scrolling_window): Check for overflow in size calculations.
11263 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11264 Don't assume glyph table len fits in int.
11265 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11266 (row_table_size): Now ptrdiff_t, not int.
11267 (scrolling_window): Avoid overflow in size calculations.
11268 Don't update size until allocation succeeds.
11269 * fns.c (concat): Check for overflow in size calculations.
11270 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11271 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11272 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11273
11274 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11275 (get_doc_string): Check for size calculation overflow.
11276 Don't update size until allocation succeeds.
11277 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11278 EMACS_INT, where ptrdiff_t will do.
11279 (Fsubstitute_command_keys): Check for string overflow.
11280
11281 * editfns.c (set_time_zone_rule): Don't assume environment length
11282 fits in int.
11283 (message_length): Now ptrdiff_t, not int.
11284 (Fmessage_box): Don't update size until allocation succeeds.
11285 Don't assume message length fits in int.
11286 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11287
11288 * emacs.c (main): Do not reallocate argv, since there is a null at
11289 the end that can be overwritten, and this way there's no need to
11290 worry about size-calculation overflow.
11291 (sort_args): Check for size-calculation overflow.
11292
11293 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11294 alloc succeeds.
11295 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11296
11297 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11298 (x_set_scroll_bar_width, x_figure_window_size):
11299 Check for integer overflow.
11300 (x_set_alpha): Do not assume XINT fits in int.
11301
11302 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11303 This is for the members text_lines, text_cols, total_lines, total_cols,
11304 where the system imposes an 'int' limit.
11305
11306 * fringe.c (Fdefine_fringe_bitmap):
11307 Don't update size until alloc works.
11308
11309 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11310 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11311
11312 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11313 Check for size-calculation overflow.
11314 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11315 do, as we prefer signed integers.
11316 (id_to_widget.max_size, id_to_widget.used)
11317 (xg_store_widget_in_map, xg_remove_widget_from_map)
11318 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11319 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11320 Use and return ptrdiff_t, not int.
11321 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11322 * gtkutil.h: Change prototypes to match the above.
11323
11324 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11325 are duplicate now that they've been promoted to lisp.h.
11326 (x_allocate_bitmap_record, x_alloc_image_color)
11327 (make_image_cache, cache_image, xpm_load):
11328 Don't update size until alloc is done.
11329 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11330 (x_detect_edges):
11331 Check for size calculation overflow.
11332 (ct_colors_allocated_max): New constant.
11333 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11334 overflow.
11335
11336 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11337 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11338 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11339 Use ptrdiff_t, not int, to count maps.
11340 (read_char_minibuf_menu_prompt): Check for overflow in size
11341 calculations. Don't update size until allocation succeeds.
11342 Redo calculations to avoid overflow.
11343 * keyboard.h: Change prototypes to match the above.
11344
11345 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11346 to count maps.
11347 (current_minor_maps): Check for size calculation overflow.
11348 * keymap.h: Change prototypes to match the above.
11349
11350 * lread.c (read1, init_obarray): Don't update size until alloc done.
11351
11352 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11353 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11354
11355 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11356 Now ptrdiff_t, not int.
11357 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11358 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11359
11360 * process.c (Fnetwork_interface_list): Check for overflow
11361 in size calculation.
11362
11363 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11364
11365 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11366 overflow. Don't bother calling xmalloc when xrealloc will do.
11367
11368 * search.c (Freplace_match): Check for size calculation overflow.
11369 (Fset_match_data): Don't assume list lengths fit in 'int'.
11370
11371 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11372 for command line length. Do not attempt to address one before the
11373 beginning of an array, as that's not portable.
11374
11375 * term.c (max_frame_lines): Remove; unused.
11376 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11377 not int.
11378 (encode_terminal_code, calculate_costs): Check for size
11379 calculation overflow.
11380 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11381 table lengths and related sizes. Don't update size until alloc
11382 done. Redo calculations to avoid overflow.
11383 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11384
11385 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11386 subtracting pointers.
11387 (gobble_line): Check for overflow more carefully. Don't update size
11388 until alloc done.
11389
11390 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11391 Don't update size until alloc done.
11392 Redo size calculations to avoid overflow.
11393 Check for size calculation overflow.
11394 (main) [DEBUG]: Fix typo in invoking tparam1.
11395
11396 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11397 Use ptrdiff_t, not int, for sizes.
11398 (store_mode_line_noprop_char): Don't update size until alloc done.
11399
11400 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11401 Use ptrdiff_t, not int, for sizes.
11402 (Finternal_make_lisp_face, cache_face):
11403 Check for size calculation overflow.
11404 (cache_face): Treat size calculation overflows as if they were
11405 memory exhaustion (the usual treatment), rather than aborting.
11406
11407 * xfns.c (x_encode_text, x_set_name_internal)
11408 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11409 sizes, since they can exceed INT_MAX in size. Check for size
11410 calculation overflow.
11411
11412 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11413 (xg_select): Check for size calculation overflow.
11414 Don't update size until alloc done.
11415
11416 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11417 as sprintf is limited to int lengths.
11418
11419 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11420 (X_LONG_MIN): New macros.
11421 Use them to make the following changes clearer.
11422 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11423 This change doesn't affect the value now, but it may help remind
11424 future maintainers not to raise the value too much later.
11425 (SELECTION_QUANTUM): Remove, replacing with ...
11426 (selection_quantum): ... new function, which avoids overflow.
11427 All uses changed.
11428 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11429 assumption that selection length fits in 'int'.
11430 (x_reply_selection_request, x_handle_selection_request)
11431 (x_get_window_property, receive_incremental_selection)
11432 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11433 (lisp_data_to_selection_data, clean_local_selection_data):
11434 Use ptrdiff_t, not int, to record length of selection.
11435 (x_reply_selection_request, x_get_window_property)
11436 (receive_incremental_selection, x_property_data_to_lisp):
11437 Redo calculations to avoid overflow.
11438 (x_reply_selection_request): When sending hint, ceiling it at
11439 X_LONG_MAX rather than relying on wraparound overflow to send
11440 something.
11441 (x_get_window_property, receive_incremental_selection)
11442 (lisp_data_to_selection_data, x_property_data_to_lisp):
11443 Check for size-calculation overflow.
11444 (x_get_window_property, receive_incremental_selection)
11445 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11446 Don't store size until memory allocation succeeds.
11447 (x_get_window_property): Plug memory leak on memory exhaustion.
11448 Don't double-block input; malloc is safe here. Don't assume 2**34
11449 - 4 fits in unsigned long. Add an xassert to check
11450 XGetWindowProperty overflow. Be more careful about overflow
11451 calculations, and distinguish size from memory overflow better.
11452 (receive_incremental_selection): When tracing, don't assume
11453 unsigned int is less than INT_MAX.
11454 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11455 harmful) conversions of unsigned short to int.
11456 (lisp_data_to_selection_data): Don't assume that integers
11457 in the range -65535 through -1 fit in an X unsigned short.
11458 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11459 result parameters unless successful. Rely on cons_to_unsigned
11460 to report problems with elements; the old code wasn't right anyway.
11461 (x_check_property_data): Check for int overflow; we cannot use
11462 a wider type due to X limits.
11463 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11464
11465 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11466
11467 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11468 (x_term_init): Check for size calculation overflow.
11469 (x_color_cells): Don't store size until memory allocation succeeds.
11470 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11471 Don't assume alloca size is less than MAX_ALLOCA.
11472 (x_term_init): Don't assume length fits in int (sprintf is limited
11473 to int size).
11474
11475 Use ptrdiff_t for composition IDs.
11476 * character.c (lisp_string_width):
11477 * composite.c (composition_table_size, n_compositions)
11478 (get_composition_id, composition_gstring_from_id):
11479 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11480 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11481 * window.c (Frecenter):
11482 Use ptrdiff_t, not int, for composition IDs.
11483 * composite.c (get_composition_id): Check for integer overflow.
11484 * composite.h: Adjust prototypes to match the above changes.
11485
11486 Use ptrdiff_t for hash table indexes.
11487 * category.c (hash_get_category_set):
11488 * ccl.c (ccl_driver):
11489 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11490 * coding.c (coding_system_charset_list, detect_coding_system):
11491 * coding.h (struct coding_system.id):
11492 * composite.c (get_composition_id, gstring_lookup_cache):
11493 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11494 * image.c (xpm_get_color_table_h):
11495 * lisp.h (hash_lookup, hash_put):
11496 * minibuf.c (Ftest_completion):
11497 Use ptrdiff_t for hash table indexes, not int (which is too
11498 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11499 32-bit --with-wide-int hosts).
11500
11501 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11502 Add a FIXME comment about memory leaks.
11503 (syms_of_charset): Don't assume xmalloc returns.
11504
11505 Don't assume that stated character widths fit in int.
11506 * character.c (Fchar_width, c_string_width, lisp_string_width):
11507 * character.h (CHAR_WIDTH):
11508 * indent.c (MULTIBYTE_BYTES_WIDTH):
11509 Use sanitize_char_width to avoid undefined and/or bad behavior
11510 with outlandish widths.
11511 * character.h (sanitize_tab_width): Rename from sanitize_width,
11512 now that we have two such functions. All uses changed.
11513 (sanitize_char_width): New inline function.
11514
11515 Don't assume that tab-width fits in int.
11516 * character.h (sanitize_width): New inline function.
11517 (SANE_TAB_WIDTH): New macro.
11518 (ASCII_CHAR_WIDTH): Use it.
11519 * indent.c (sane_tab_width): Remove. All uses replaced by
11520 SANE_TAB_WIDTH (current_buffer).
11521 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11522
11523 * fileio.c: Integer overflow issues with file modes.
11524 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11525
11526 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11527 Remove unreachable code.
11528 (read_hex, load_charset_map_from_file): Check for integer overflow.
11529
11530 * xterm.c: Don't go over XClientMessageEvent limit.
11531 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11532 (x_send_scroll_bar_event): Likewise. Check that the size does not
11533 exceed limits imposed by XClientMessageEvent, as well as the usual
11534 ptrdiff_t and size_t limits.
11535
11536 * keyboard.c: Overflow, signedness and related fixes.
11537 (make_lispy_movement): Use same integer type in forward decl
11538 that is used in the definition.
11539 (read_key_sequence, keyremap_step):
11540 Change bufsize argument back to int, undoing my 2011-03-30 change.
11541 We prefer signed types, and int is wide enough here.
11542 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11543 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11544 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11545 length, not size_t. Use ptrdiff_t for index, not int.
11546 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11547 possibility of integer overflow.
11548
11549 Overflow, signedness and related fixes for images.
11550
11551 * dispextern.h (struct it.stack[0].u.image.image_id)
11552 (struct_it.image_id, struct image.id, struct image_cache.size)
11553 (struct image_cache.used, struct image_cache.ref_count):
11554 * gtkutil.c (update_frame_tool_bar):
11555 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11556 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11557 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11558 * nsmenu.m (update_frame_tool_bar):
11559 * xdisp.c (calc_pixel_width_or_height):
11560 * xfns.c (image_cache_refcount):
11561 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11562 on typical 64-bit hosts.
11563
11564 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11565 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11566 Omit unnecessary casts to int.
11567 (parse_image_spec): Check that integers fall into 'int' range
11568 when the callers expect that.
11569 (image_ascent): Redo ascent calculation to avoid int overflow.
11570 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11571 (lookup_image): Remove unnecessary tests.
11572 (xbm_image_p): Locals are now of int, not EMACS_INT,
11573 since parse_image_check makes sure they fit into int.
11574 (png_load, gif_load, svg_load_image):
11575 Prefer int to unsigned where either will do.
11576 (tiff_handler): New function, combining the cores of the
11577 old tiff_error_handler and tiff_warning_handler.
11578 This function is rewritten to use vsnprintf and thereby avoid
11579 stack buffer overflows. It uses only the features of vsnprintf
11580 that are common to both POSIX and native Microsoft.
11581 (tiff_error_handler, tiff_warning_handler): Use it.
11582 (tiff_load, gif_load, imagemagick_load_image):
11583 Don't assume :index value fits in 'int'.
11584 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11585 (imagemagick_load_image): Check that crop parameters fit into
11586 the integer types that MagickCropImage accepts. Don't assume
11587 Vimagemagick_render_type has a nonnegative value. Don't assume
11588 size_t fits in 'long'.
11589 (gs_load): Use printmax_t to print the widest integers possible.
11590 Check for integer overflow when computing image height and width.
11591
115922011-08-26 Eli Zaretskii <eliz@gnu.org>
11593
11594 * xdisp.c (redisplay_window): Don't force window start if point
11595 will be invisible in the resulting window. (Bug#9324)
11596
115972011-08-25 Eli Zaretskii <eliz@gnu.org>
11598
11599 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11600 the display spec is of the form `(space ...)'.
11601 (handle_display_spec): Return the value returned by
11602 handle_single_display_spec, not just 1 or zero.
11603 (handle_single_display_spec): If the display spec is of the form
11604 `(space ...)', and specifies display in the text area, return 2
11605 rather than 1.
11606 (try_cursor_movement): Check for the need to scroll more
11607 accurately, and prefer exact match for point under bidi.
11608 Don't advance `row' beyond the last row of the window.
11609
11610 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11611 into disp_prop; all users changed.
11612
11613 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11614 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11615 for the text covered by the display property.
11616
116172011-08-25 Chong Yidong <cyd@stupidchicken.com>
11618
11619 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11620 Change return value to nil.
11621 (Frecord_buffer): Delete unused function.
11622
116232011-08-24 Eli Zaretskii <eliz@gnu.org>
11624
11625 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11626 buffers, return left-to-right.
11627 (set_cursor_from_row): Consider candidate row a win if its glyph
11628 represents a newline and point is on that newline. Fixes cursor
11629 positioning on the newline at EOL of R2L text within L2R
11630 paragraph, and vice versa.
11631 (try_cursor_movement): Check continued rows, in addition to
11632 continuation rows. Fixes unwarranted scroll when point enters a
11633 continued line of R2L text within an L2R paragraph, or vice versa.
11634 (cursor_row_p): Consider the case of point being equal to
11635 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11636 from the end of a short line to the beginning of a continued line
11637 of R2L text within L2R paragraph.
11638 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11639 composed characters.
11640
11641 * bidi.c (bidi_check_type): Use xassert.
11642 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11643 members.
11644
116452011-08-23 Eli Zaretskii <eliz@gnu.org>
11646
11647 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11648 a character.
11649
116502011-08-23 Chong Yidong <cyd@stupidchicken.com>
11651
11652 * nsfont.m (ns_otf_to_script): Fix typo.
11653
116542011-08-22 Kenichi Handa <handa@m17n.org>
11655
11656 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11657 extra slot even if the purpose is char-code-property-table.
11658
116592011-08-23 Eli Zaretskii <eliz@gnu.org>
11660
11661 * xdisp.c (redisplay_window): When computing centering_position,
11662 account for the height of the header line. (Bug#8874)
11663
11664 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11665 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11666 candidate is selected by the mouse, and that candidate has a
11667 composed character under the mouse.
11668
11669 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11670 coordinates reported by pos-visible-in-window-p for a composed
11671 character in column zero.
11672
116732011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11674
11675 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11676
116772011-08-22 Eli Zaretskii <eliz@gnu.org>
11678
11679 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11680 consider it a hit if to_charpos is anywhere in the range of the
11681 composed buffer positions.
11682
116832011-08-22 Chong Yidong <cyd@stupidchicken.com>
11684
11685 * image.c (gif_load): Don't assume that each subimage has the same
11686 dimensions as the base image. Handle disposal method that is
11687 "undefined" by the gif spec (Bug#9335).
11688
116892011-08-20 Chong Yidong <cyd@stupidchicken.com>
11690
11691 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11692 (Fcondition_case): Document `debug' symbol in error handler.
11693
116942011-08-19 Eli Zaretskii <eliz@gnu.org>
11695
11696 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11697 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11698 from an Org mode buffer to a Speedbar frame.
11699
11700 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11701 a composition, take its buffer position from IT->cmp_it.charpos.
11702 Fixes cursor positioning at the beginning of a line that begins
11703 with a composed character.
11704
117052011-08-18 Eli Zaretskii <eliz@gnu.org>
11706
11707 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11708 character bidirectional type, use STRONG_L instead. Fixes crashes
11709 in a buffer produced by `describe-categories'.
11710
11711 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11712 members before the level stack, so they would be saved and
11713 restored when copying iterator state. Fixes incorrect reordering
11714 around TABs covered by display properties.
11715
117162011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11717
11718 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11719
117202011-08-17 Chong Yidong <cyd@stupidchicken.com>
11721
11722 * eval.c (internal_condition_case, internal_condition_case_1)
11723 (internal_condition_case_2, internal_condition_case_n):
11724 Remove unnecessary aborts (Bug#9081).
11725
117262011-08-17 Eli Zaretskii <eliz@gnu.org>
11727
11728 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11729 has no `load' handler, try opening the file locally. (Bug#9311)
11730
117312011-08-16 Ken Brown <kbrown@cornell.edu>
11732
11733 * gmalloc.c: Expand comment.
11734
117352011-08-16 Eli Zaretskii <eliz@gnu.org>
11736
11737 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11738 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11739
117402011-08-16 Ken Brown <kbrown@cornell.edu>
11741
11742 Fix memory allocation problems in Cygwin build (Bug#9273).
11743
11744 * unexcw.c ( __malloc_initialized): Declare external variable.
11745 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11746
11747 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11748 New variables.
11749 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11750 dumped emacs.
11751 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11752 in the static heap.
11753 [CYGWIN] (special_realloc): New function.
11754 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11755 requests to realloc storage in the static heap.
11756
117572011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11758
11759 * bidi.c (bidi_initialize): Remove unused local.
11760
117612011-08-15 Eli Zaretskii <eliz@gnu.org>
11762
11763 * bidimirror.h:
11764 * biditype.h: Remove file.
11765 * makefile.w32-in ($(BLD)/bidi.$(O)):
11766 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11767
11768 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11769
11770 * chartab.c: Improve commentary for the uniprop_table API.
11771
11772 * bidi.c (bidi_paragraph_init): Support zero value of
11773 bidi_ignore_explicit_marks_for_paragraph_level.
11774 (bidi_initialize): Use uniprop_table instead of including
11775 biditype.h and bidimirror.h.
11776
11777 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11778 coordinates of the iterator when restoring from ppos_it.
11779 (Bug#9296)
11780
117812011-08-14 Kenichi Handa <handa@m17n.org>
11782
11783 * process.c (create_process): Call setup_process_coding_systems
11784 after the pid of the process is set to -1 (Bug#8162).
11785
117862011-08-14 Eli Zaretskii <eliz@gnu.org>
11787
11788 * xdisp.c (move_it_in_display_line_to): Don't invoke
11789 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11790 ppos_it. Fixes vertical cursor motion when line beginning is
11791 covered by an image. (Bug#9296)
11792
117932011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11794
11795 * nsterm.h (ns_run_ascript): Declare.
11796 (NSAPP_DATA2_RUNASSCRIPT): Define.
11797
11798 * nsfns.m (as_script, as_result, as_status): New static variables.
11799 (ns_run_ascript): New function.
11800 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11801 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11802 the event loop. Get status from as_status (Bug#7276).
11803
11804 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11805 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11806 the event loop (Bug#7276).
11807
118082011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11809
11810 * gnutls.c (QCgnutls_bootprop_priority)
11811 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11812 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11813 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11814 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11815 (QCgnutls_bootprop_verify_hostname_error)
11816 (QCgnutls_bootprop_callbacks_verify): Rename from
11817 Qgnutls_bootprop_..., all uses changed.
11818
11819 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11820 uses changed.
11821
118222011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11823
11824 * xfaces.c (Qframe_set_background_mode): Now static.
11825 * dispextern.h (Qframe_set_background_mode): Remove decl.
11826
11827 * process.c (Fnetwork_interface_info): Declare local only if needed.
11828
118292011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11830
11831 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11832 (Fnetwork_interface_list): Allocate in increments of bytes instead
11833 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11834 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11835 sockaddr.
11836 (struct ifflag_def): notrailers is smart on OSX.
11837 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11838 Get hardware address with getifaddrs if available.
11839
118402011-08-12 Eli Zaretskii <eliz@gnu.org>
11841
11842 * xdisp.c (iterate_out_of_display_property): xassert that
11843 IT->position is set to within IT->object's boundaries. Break from
11844 the loop as soon as EOB is reached; avoids infloops in redisplay
11845 when IT->position is set up wrongly due to some bug.
11846 Set IT->current to match the bidi iterator unconditionally.
11847 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11848 entry. Force push_it to save on the stack the current
11849 buffer/string position, to be restored by pop_it. Fix flags in
11850 the iterator structure wrt the object coming from a display
11851 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11852 properties. (Bug#9284)
11853
118542011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11855
11856 * fontset.c (fontset_get_font_group): Add proper type checks.
11857 (Bug#9172)
11858
118592011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11860
11861 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11862 and LC_VERSION_MIN_MACOSX.
11863 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11864 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11865
118662011-08-08 Eli Zaretskii <eliz@gnu.org>
11867
11868 * xdisp.c (forward_to_next_line_start): Allow to use the
11869 no-display-properties-and-no-overlays under bidi display.
11870 Set disp_pos in the bidi iterator to avoid searches for display
11871 properties and overlays.
11872
118732011-08-08 Chong Yidong <cyd@stupidchicken.com>
11874
11875 * editfns.c (Fset_time_zone_rule): Document relationship with the
11876 setenv function.
11877
11878 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11879 the font entity extracted from the cache (Bug#8109).
11880
118812011-08-07 Chong Yidong <cyd@stupidchicken.com>
11882
11883 * composite.c (autocmp_chars): Don't reset point. That is done by
11884 restore_point_unwind (Bug#5984).
11885
118862011-08-07 Juri Linkov <juri@jurta.org>
11887
11888 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11889 to show the arg `TIME' instead of `TIMEVAL'.
11890
118912011-08-06 Eli Zaretskii <eliz@gnu.org>
11892
11893 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11894 display property strides EOL and includes a newline, as in
11895 longlines-mode. (Bug#9254)
11896 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11897 word-wrap under bidirectional display. (Bug#9224)
11898
11899 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11900 is non-zero, even if the data buffer is NULL. Fixes a crash in
11901 vertical-motion with longlines-mode. (Bug#9254)
11902
119032011-08-05 Eli Zaretskii <eliz@gnu.org>
11904
11905 * bidi.c <bidi_cache_total_alloc>: Now static.
11906 (bidi_initialize): Initialize bidi_cache_total_alloc.
11907
11908 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11909 cache. (Bug#9221)
11910
11911 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11912 amount allocated this far in `bidi_cache_total_alloc'.
11913 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11914 non-zero, only free the data buffer without restoring the cache
11915 contents. All callers changed.
11916
11917 * dispextern.h (bidi_unshelve_cache): Update prototype.
11918
11919 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11920 (move_it_in_display_line, move_it_to)
11921 (move_it_vertically_backward, move_it_by_lines): Replace the call
11922 to xfree to an equivalent call to bidi_unshelve_cache.
11923 (move_it_in_display_line_to): Fix logic of returning
11924 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11925
119262011-08-05 Eli Zaretskii <eliz@gnu.org>
11927
11928 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11929 came from a string character with a `cursor' property. (Bug#9229)
11930
119312011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11932
11933 * Makefile.in (LIB_PTHREAD): New variable.
11934 (LIBES): Add LIB_PTHREAD (Bug#9216).
11935
11936 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11937 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11938
119392011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11940
11941 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11942
119432011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11944
11945 * xterm.c (x_find_topmost_parent): New function.
11946 (x_set_frame_alpha): Find topmost parent window with
11947 x_find_topmost_parent and set the property there also (bug#9181).
11948 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11949
119502011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11951
11952 * callproc.c (Fcall_process): Avoid vfork clobbering
11953 the local vars buffer, coding_systems, current_dir.
11954
119552011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11956
11957 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11958
119592011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11960
11961 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11962 so that it is not optimized away.
11963
11964 * xdisp.c (compute_display_string_pos): Remove unused local.
11965
119662011-08-02 Eli Zaretskii <eliz@gnu.org>
11967
11968 Fix slow cursor motion and scrolling in large buffers with
11969 selective display, like Org Mode buffers. (Bug#9218)
11970
11971 * dispextern.h (struct bidi_it): New member disp_prop_p.
11972
11973 * xdisp.c: Remove one-slot cache of display string positions.
11974 (compute_display_string_pos): Accept an additional argument
11975 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11976 for a display string or property. If found, set DISP_PROP_P
11977 non-zero.
11978
11979 * bidi.c (bidi_fetch_char): Accept an additional argument
11980 DISP_PROP_P, and pass it to compute_display_string_pos.
11981 Only handle text covered by a display string if DISP_PROP_P is returned
11982 non-zero. All callers of bidi_fetch_char changed.
11983
119842011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11985
11986 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11987
119882010-12-03 Don March <don@ohspite.net>
11989
11990 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11991 last character M-[char] is translated to ESC [char] (bug#7541).
11992
119932011-08-02 Kenichi Handa <handa@m17n.org>
11994
11995 * lisp.h (uniprop_table): Extern it.
11996
11997 * chartab.c (uniprop_table): Make it non-static.
11998
119992011-08-01 Eli Zaretskii <eliz@gnu.org>
12000
12001 * xdisp.c (forward_to_next_line_start): Accept additional argument
12002 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12003 on the newline.
12004 (reseat_at_next_visible_line_start): Use the bidi iterator state
12005 returned by forward_to_next_line_start to restore the state of
12006 it->bidi_it after backing up to previous newline. (Bug#9212)
12007
120082011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12009
12010 * regex.c (re_comp): Protoize.
12011 (re_exec): Fix return type.
12012 (regexec): Fix type of `ret'. (Bug#9203)
12013
120142011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12015
12016 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12017 This is needed if max-image-size is a floating-point number.
12018
120192011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12020
12021 * print.c (print_object): Print empty symbol as ##.
12022
12023 * lread.c (read1): Read ## as empty symbol.
12024
120252011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12026
12027 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12028 setting frame foreground color (Bug#9175).
12029 (x_set_background_color): Likewise.
12030
12031 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12032 contents (Bug#9176).
12033 (EmacsTooltip -init): Remove bezels and add shadows to
12034 tooltip windows.
12035
12036 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12037 or scroll bar (Bug#8470).
12038
12039 * nsfont.m (nsfont_open): Remove assignment to voffset and
12040 unnecessary vars hshink, expand, hd, full_height, min_height.
12041 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12042
12043 * nsterm.h (nsfont_info): Remove voffset field.
12044
120452011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12046
12047 Implement strike-through and overline on NextStep (Bug#8863).
12048
12049 * nsfont.m (nsfont_open): Use underline position provided by font,
12050 instead of hard-coded value of 2.
12051 (nsfont_draw): Call ns_draw_text_decoration instead.
12052
12053 * nsterm.h: Add declaration for ns_draw_text_decoration.
12054
12055 * nsterm.m (ns_draw_text_decoration): New function for drawing
12056 underline, overline, and strike-through.
12057 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12058 ns_draw_text_decoration. Change treatment of cursor drawing to
12059 accommodate underlining, etc.
12060
120612011-07-28 Eli Zaretskii <eliz@gnu.org>
12062
12063 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12064 default.
12065
120662011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12067
12068 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12069 Without this fix, if a signal arrives just after memory fills up,
12070 'malloc' might be invoked reentrantly.
12071
12072 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12073 In other words, assume that every image size is allowed, on non-X
12074 hosts. This assumption is probably wrong, but it lets Emacs compile.
12075
120762011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12077
12078 * regex.c (re_iswctype): Convert return values to boolean.
12079
120802011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12081
12082 * xdisp.c (compute_display_string_pos): Don't use cached display
12083 string position if the buffer had its restriction changed.
12084 (Bug#9184)
12085
120862011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12087
12088 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12089
120902011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12091
12092 Integer signedness and overflow and related fixes. (Bug#9079)
12093
12094 * bidi.c: Integer size and overflow fixes.
12095 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12096 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12097 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12098 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12099 (bidi_find_other_level_edge):
12100 Use ptrdiff_t instead of EMACS_INT where either will do.
12101 This works better on 32-bit hosts configured --with-wide-int.
12102 (bidi_cache_ensure_space): Check for size-calculation overflow.
12103 Use % rather than repeated addition, for better worst-case speed.
12104 Don't set bidi_cache_size until after xrealloc returns, because it
12105 might not return.
12106 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12107 (bidi_cache_ensure_space): Also check that the bidi cache size
12108 does not exceed that of the largest Lisp string or buffer. See Eli
12109 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12110
12111 * alloc.c (__malloc_size_t): Remove.
12112 All uses replaced by size_t. See Andreas Schwab's note
12113 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12114
12115 * image.c: Improve checking for integer overflow.
12116 (check_image_size): Assume that f is nonnull, since
12117 it is always nonnull in practice. This is one less thing to
12118 worry about when checking for integer overflow later.
12119 (x_check_image_size): New function, which checks for integer
12120 overflow issues inside X.
12121 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12122 This removes the need for a memory_full check.
12123 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12124 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12125 (xbm_read_bitmap_data): Change locals back to 'int', since
12126 their values must fit in 'int'.
12127 (xpm_load_image, png_load, tiff_load):
12128 Invoke x_create_x_image_and_pixmap earlier,
12129 to avoid much needless work if the image is too large.
12130 (tiff_load): Treat overly large images as if
12131 x_create_x_image_and_pixmap failed, not as malloc failures.
12132 (gs_load): Use x_check_image_size.
12133
12134 * gtkutil.c: Omit integer casts.
12135 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12136 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12137
12138 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12139
12140 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12141 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12142 would wrongly return t on a 64-bit host.
12143
12144 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12145 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12146 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12147 and therefore cause GCC to emit a bogus diagnostic in some cases.
12148
12149 * image.c: Integer signedness and overflow and related fixes.
12150 This is not an exhaustive set of fixes, but it's time to
12151 record what I've got.
12152 (lookup_pixel_color, check_image_size): Remove redundant decls.
12153 (check_image_size): Don't assume that arbitrary EMACS_INT values
12154 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12155 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12156 (tiff_load, imagemagick_load_image):
12157 Check for overflow in size calculations.
12158 (x_create_x_image_and_pixmap): Remove unnecessary test for
12159 xmalloc returning NULL; that can't happen.
12160 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12161 (xpm_color_bucket): Use better integer hashing function.
12162 (xpm_cache_color): Don't possibly over-allocate memory.
12163 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12164 (gif_memory_source):
12165 Use ptrdiff_t, not int or size_t, to record sizes.
12166 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12167 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12168 either works, as we prefer signed integers.
12169 (tiff_read_from_memory, tiff_write_from_memory):
12170 Return tsize_t, not size_t, since that's what the TIFF API wants.
12171 (tiff_read_from_memory): Don't fail simply because the read would
12172 go past EOF; instead, return a short read.
12173 (tiff_load): Omit no-longer-needed casts.
12174 (Fimagemagick_types): Don't assume size fits into 'int'.
12175
12176 Improve hashing quality when configured --with-wide-int.
12177 * fns.c (hash_string): New function, taken from sxhash_string.
12178 Do not discard information about ASCII character case; this
12179 discarding is no longer needed.
12180 (sxhash-string): Use it. Change sig to match it. Caller changed.
12181 * lisp.h: Declare it.
12182 * lread.c (hash_string): Remove, since we now use fns.c's version.
12183 The fns.c version returns a wider integer if --with-wide-int is
12184 specified, so this should help the quality of the hashing a bit.
12185
12186 * emacs.c: Integer overflow minor fix.
12187 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12188 Define only if GNU_LINUX.
12189 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12190
12191 * dispnew.c: Integer signedness and overflow fixes.
12192 Remove unnecessary forward decls, that were a maintenance hassle.
12193 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12194 All uses changed.
12195 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12196 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12197 (prepare_desired_row, line_draw_cost):
12198 Use int, not unsigned, where either works.
12199 (save_current_matrix, restore_current_matrix):
12200 Use ptrdiff_t, not size_t, where either works.
12201 (init_display): Check for overflow more accurately, and without
12202 relying on undefined behavior.
12203
12204 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12205 Remove, replacing with the new symbols in lisp.h. All uses changed.
12206 * fileio.c (make_temp_name):
12207 * filelock.c (lock_file_1, lock_file):
12208 * xdisp.c (message_dolog):
12209 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12210 Use pMd etc. instead.
12211 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12212 replacing the pWIDE etc. symbols removed from editfns.c.
12213
12214 * keyboard.h (num_input_events): Now uintmax_t.
12215 This is (very slightly) less likely to mess up due to wraparound.
12216 All uses changed.
12217
12218 * buffer.c: Integer signedness fixes.
12219 (alloc_buffer_text, enlarge_buffer_text):
12220 Use ptrdiff_t rather than size_t when either will do, as we prefer
12221 signed integers.
12222
12223 * alloc.c: Integer signedness and overflow fixes.
12224 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12225 (__malloc_size_t): Default to size_t, not to int.
12226 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12227 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12228 Prefer ptrdiff_t to size_t when either would do, as we prefer
12229 signed integers.
12230 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12231 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12232 Now const. Initialize with values that are in range even if char
12233 is signed.
12234 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12235 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12236 These functions do the right thing with sizes > 2**32.
12237 (check_depth): Now ptrdiff_t, not int.
12238 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12239 Adjust to new way of storing sizes. Check for size overflow bugs
12240 in rest of code.
12241 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12242 slightly wrong anyway, as it missed one instance of
12243 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12244 (refill_memory_reserve): Omit needless cast to size_t.
12245 (mark_object_loop_halt): Mark as externally visible.
12246
12247 * xselect.c: Integer signedness and overflow fixes.
12248 (Fx_register_dnd_atom, x_handle_dnd_message):
12249 Use ptrdiff_t, not size_t, since we prefer signed.
12250 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12251 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12252 x_dnd_atoms_size and x_dnd_atoms_length.
12253
12254 * doprnt.c: Prefer signed to unsigned when either works.
12255 * eval.c (verror):
12256 * doprnt.c (doprnt):
12257 * lisp.h (doprnt):
12258 * xdisp.c (vmessage):
12259 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12260 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12261 prefer signed arithmetic to avoid comparison confusion.
12262 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12263 but is a bit tricky.
12264
12265 Assume freestanding C89 headers, string.h, stdlib.h.
12266 * data.c, doprnt.c, floatfns.c, print.c:
12267 Include float.h unconditionally.
12268 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12269 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12270 * regex.c: Likewise for stddef.h, string.h.
12271 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12272 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12273 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12274 (STDC_HEADERS): Remove obsolete defines.
12275 * sysdep.c: Include limits.h unconditionally.
12276
12277 Assume support for memcmp, memcpy, memmove, memset.
12278 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12279 * regex.c (memcmp, memcpy):
12280 Remove; we assume C89 now.
12281
12282 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12283 (__malloc_safe_bcopy): Remove; no longer needed.
12284
12285 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12286 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12287 well either way, and we prefer signed to unsigned.
12288
122892011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12290
12291 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12292 closes the connection while we're reading (bug#9182).
12293
122942011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12295
12296 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12297 are specified (Bug#9168).
12298
122992011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12300
12301 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12302 Found by GCC static checking and --with-wide-int on a 32-bit host.
12303
123042011-07-25 Eli Zaretskii <eliz@gnu.org>
12305
12306 * xdisp.c (compute_display_string_pos): Fix logic of caching
12307 previous display string position. Initialize cached_prev_pos to
12308 -1. Fixes slow-down at the beginning of a buffer.
12309
123102011-07-24 Eli Zaretskii <eliz@gnu.org>
12311
12312 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12313 for attrs[LFACE_FONTSET_INDEX].
12314
123152011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12316
12317 * xml.c (parse_region): Remove unused local
12318 that was recently introduced.
12319
123202011-07-23 Eli Zaretskii <eliz@gnu.org>
12321
12322 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12323 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12324
12325 * xdisp.c (move_it_in_display_line_to): Record the best matching
12326 position for TO_CHARPOS while scanning the line, and restore it on
12327 exit if none of the characters scanned was an exact match.
12328 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12329 when exact match is impossible due to invisible text, and the
12330 lines are truncated.
12331
123322011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12333
12334 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12335 for OSX >= 10.7.
12336
123372011-07-22 Eli Zaretskii <eliz@gnu.org>
12338
12339 Fix a significant slow-down of cursor motion with C-n, C-p,
12340 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12341 auto-repeat under bidi redisplay in fontified buffers.
12342 * xdisp.c (compute_stop_pos_backwards): New function.
12343 (next_element_from_buffer): Call compute_stop_pos_backwards to
12344 find a suitable prev_stop when we find ourselves before
12345 base_level_stop.
12346 (reseat): Don't look for prev_stop, as that could mean a very long
12347 run.
12348 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12349 <cached_disp_overlay_modiff>: Cache for last found display string
12350 position.
12351 (compute_display_string_pos): Return the cached position if asked
12352 about the same buffer in the same area of character positions, and
12353 the buffer wasn't changed since the time the display string
12354 position was cached.
12355
123562011-07-22 Eli Zaretskii <eliz@gnu.org>
12357
12358 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12359 is an integer, which is important for empty lines. (Bug#9149)
12360
123612011-07-22 Chong Yidong <cyd@stupidchicken.com>
12362
12363 * frame.c (Fmodify_frame_parameters): In tty case, update the
12364 default face if necessary (Bug#4238).
12365
123662011-07-21 Chong Yidong <cyd@stupidchicken.com>
12367
12368 * editfns.c (Fstring_to_char): No need to explain what a character
12369 is in the docstring (Bug#6576).
12370
123712011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12372
12373 * xml.c (parse_region): Make sure we always return a tree.
12374
123752011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12376
12377 * xml.c (parse_region): If a document contains only comments,
12378 return that, too.
12379
123802011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12381
12382 * xml.c (make_dom): Return comments, too.
12383
123842011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12385
12386 Port to OpenBSD.
12387 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12388 and the surrounding thread.
12389 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12390 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12391 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12392 timer goes off.
12393 * s/openbsd.h (BROKEN_SIGIO): Define.
12394 * unexelf.c (unexec) [__OpenBSD__]:
12395 Don't update the .mdebug section of the Alpha COFF symbol table.
12396
123972011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12398
12399 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12400 (bug#8460).
12401
124022011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12403
12404 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12405 This fixes some race conditions on the permissions of any newly
12406 created file.
12407
12408 * alloc.c (valid_pointer_p): Use pipe, not open.
12409 This fixes some permissions issues when debugging.
12410
12411 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12412 If fchown fails to set both uid and gid, try to set just gid,
12413 as that is sometimes allowed. Adjust the file's mode to eliminate
12414 setuid or setgid bits that are inappropriate if fchown fails.
12415
124162011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12417
12418 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12419 to compare Lisp_Objects.
12420 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12421 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12422 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12423
124242011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12425
12426 * lread.c (read_integer): Unread even EOF character.
12427 (read1): Likewise. Properly record start position of symbol.
12428
12429 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12430 symbol character follows.
12431
124322011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12433
12434 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12435 This works around a problem with the previous change to Fcopy_file.
12436 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12437 and without this change, GCC might complain about discarding
12438 fchown's return value.
12439
124402011-07-16 Juanma Barranquero <lekktu@gmail.com>
12441
12442 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12443
124442011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12445
12446 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12447
124482011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12449
12450 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12451 it's used from the C level.
12452
12453 * process.c: Use the same condition for POLL_FOR_INPUT in both
12454 keyboard.c and process.c (bug#1858).
12455
124562011-07-09 Lawrence Mitchell <wence@gmx.li>
12457
12458 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12459 (Fgnutls_boot): Use it.
12460
124612011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12462
12463 * doc.c (Fsubstitute_command_keys): Revert last change.
12464
124652011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12466
12467 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12468 quotes the next character, and doesn't affect other longer
12469 sequences (bug#8935).
12470
12471 * lread.c (syms_of_lread): Clarify that is isn't only
12472 `eval-buffer' and `eval-defun' that's affected by
12473 `lexical-binding' (bug#8460).
12474
124752011-07-15 Eli Zaretskii <eliz@gnu.org>
12476
12477 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12478 bidi redisplay when a line includes both an image and is truncated.
12479
124802011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12481
12482 Fix minor problems found by static checking.
12483 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12484 (elsz): Now a signed constant, not a size_t var. We prefer signed
12485 types to unsigned, to avoid integer comparison confusion. Without
12486 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12487 "cannot optimize loop, the loop counter may overflow", a symptom
12488 of the confusion.
12489 * indent.c (Fvertical_motion): Mark locals as initialized.
12490 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12491
124922011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12493
12494 * search.c (Fre_search_backward): Mention `case-fold-search' in
12495 all the re_search_* functions (bug#8138).
12496
12497 * keyboard.c (Fopen_dribble_file): Document when the file is
12498 closed (bug#8056).
12499
125002011-07-14 Eli Zaretskii <eliz@gnu.org>
12501
12502 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12503 bidi_cache_idx.
12504
12505 Support bidi reordering of display and overlay strings.
12506 * xdisp.c (compute_display_string_pos)
12507 (compute_display_string_end): Accept additional argument STRING.
12508 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12509 (reseat_to_string): Initialize bidi_it->string.s and
12510 bidi_it->string.schars.
12511 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12512 NULL (avoids a crash in bidi_paragraph_init).
12513 Initialize itb.string.lstring.
12514 (init_iterator): Call bidi_init_it only of a valid
12515 buffer position was specified. Initialize paragraph_embedding to
12516 L2R.
12517 (reseat_to_string): Initialize the bidi iterator.
12518 (display_string): If we need to ignore text properties of
12519 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12520 original value of -1 will not work with bidi.)
12521 (compute_display_string_pos): First arg is now struct
12522 `text_pos *'; all callers changed. Support display properties on
12523 Lisp strings.
12524 (compute_display_string_end): Support display properties on Lisp
12525 strings.
12526 (init_iterator, reseat_1, reseat_to_string): Initialize the
12527 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12528 when iterating on a string not from display properties).
12529 (compute_display_string_pos, compute_display_string_end):
12530 Fix calculation of the object to scan. Fixes an error when using
12531 arrow keys.
12532 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12533 base_level_stop; instead, set base_level_stop to BEGV.
12534 Fixes crashes in vertical-motion.
12535 (next_element_from_buffer): Improve commentary for when
12536 the iterator is before prev_stop.
12537 (init_iterator): Initialize bidi_p from the default value of
12538 bidi-display-reordering, not from buffer-local value. Use the
12539 buffer-local value only if initializing for buffer iteration.
12540 (handle_invisible_prop): Support invisible properties on strings
12541 that are being bidi-reordered.
12542 (set_iterator_to_next): Support bidi reordering of C strings and
12543 Lisp strings.
12544 (next_element_from_string): Support bidi reordering of Lisp
12545 strings.
12546 (handle_stop_backwards): Support Lisp strings as well.
12547 (display_string): Support display of R2L glyph rows.
12548 Use IT_STRING_CHARPOS when displaying from a Lisp string.
12549 (init_iterator): Don't initialize it->bidi_p for strings
12550 here.
12551 (reseat_to_string): Initialize it->bidi_p for strings here.
12552 (next_element_from_string, next_element_from_c_string)
12553 (next_element_from_buffer): Add xassert's for correspondence
12554 between IT's object being iterated and it->bidi_it.string
12555 structure.
12556 (face_before_or_after_it_pos): Support bidi iteration.
12557 (next_element_from_c_string): Handle the case of the first string
12558 character that is not the first one in the visual order.
12559 (get_visually_first_element): New function, refactored from common
12560 parts of next_element_from_buffer, next_element_from_string, and
12561 next_element_from_c_string.
12562 (tool_bar_lines_needed, redisplay_tool_bar)
12563 (display_menu_bar): Force left-to-right direction. Add a FIXME
12564 comment for making that be controlled by a user option.
12565 (push_it, pop_it): Save and restore the state of the
12566 bidi iterator. Save and restore the bidi_p flag.
12567 (pop_it): Iterate out of display property for string iteration as
12568 well.
12569 (iterate_out_of_display_property): Support iteration over strings.
12570 (handle_single_display_spec): Set up it->bidi_it for iteration
12571 over a display string, and call bidi_init_it.
12572 (handle_single_display_spec, next_overlay_string)
12573 (get_overlay_strings_1, push_display_prop): Set up the bidi
12574 iterator for displaying display or overlay strings.
12575 (forward_to_next_line_start): Don't use the shortcut if
12576 bidi-iterating.
12577 (back_to_previous_visible_line_start): If handle_display_prop
12578 pushed the iterator stack, restore the internal state of the bidi
12579 iterator by calling bidi_pop_it same number of times.
12580 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12581 and we are bidi-iterating, don't decrement the iterator position;
12582 instead, set the first_elt flag in the bidi iterator, to produce
12583 the same effect.
12584 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12585 (push_display_prop): xassert that we are iterating a buffer.
12586 (push_it, pop_it): Save and restore paragraph_embedding member.
12587 (handle_single_display_spec, next_overlay_string)
12588 (get_overlay_strings_1, reseat_1, reseat_to_string)
12589 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12590 correctly. Don't assume unibyte strings are not bidi-reordered.
12591 (compute_display_string_pos)
12592 (compute_display_string_end): Fix handling the case of C string.
12593 (push_it, pop_it): Save and restore from_disp_prop_p.
12594 (handle_single_display_spec, push_display_prop): Set the
12595 from_disp_prop_p flag.
12596 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12597 (pop_it): Call iterate_out_of_display_property only if we are
12598 popping after iteration over a string that came from a display
12599 property. Fix a typo in popping stretch info. Add an assertion
12600 for verifying that the iterator position is in sync with the bidi
12601 iterator.
12602 (handle_single_display_spec, get_overlay_strings_1)
12603 (push_display_prop): Fix initialization of paragraph direction for
12604 string when that of the parent object is not yet determined.
12605 (reseat_1): Call bidi_init_it to resync the bidi
12606 iterator with IT's position. (Bug#7616)
12607 (find_row_edges): If ROW->start.pos gives position
12608 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12609 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12610 Reset the from_disp_prop_p flag.
12611 (SAVE_IT, RESTORE_IT): New macros.
12612 (pos_visible_p, face_before_or_after_it_pos)
12613 (back_to_previous_visible_line_start)
12614 (move_it_in_display_line_to, move_it_in_display_line)
12615 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12616 (try_scrolling, redisplay_window, display_line): Use them when
12617 saving a temporary copy of the iterator and restoring it back.
12618 (back_to_previous_visible_line_start, reseat_1)
12619 (init_iterator): Empty the bidi cache "stack".
12620 (move_it_in_display_line_to): If iterator ended up at
12621 EOL, but we never saw any buffer positions smaller than
12622 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12623 motion in bidi-reordered lines.
12624 (move_it_in_display_line_to): Record prev_method and prev_pos
12625 immediately before the call to set_iterator_to_next. Fixes cursor
12626 motion in bidi-reordered lines with stretch glyphs and strings
12627 displayed in margins. (Bug#8133) (Bug#8867)
12628 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12629 TO_CHARPOS.
12630 (pos_visible_p): Support positions in bidi-reordered lines.
12631 Save and restore bidi cache.
12632
12633 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12634 (bidi_paragraph_info): Delete unused struct.
12635 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12636 (bidi_cache_start): New variable.
12637 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12638 to zero.
12639 (bidi_cache_fetch_state, bidi_cache_search)
12640 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12641 (bidi_cache_find, bidi_peek_at_next_level)
12642 (bidi_level_of_next_char, bidi_find_other_level_edge)
12643 (bidi_move_to_visually_next): Compare cache index with
12644 bidi_cache_start rather than with zero.
12645 (bidi_fetch_char): Accept new argument STRING; all callers
12646 changed. Support iteration over a string. Support strings with
12647 display properties. Support unibyte strings. Fix the type of
12648 `len' according to what STRING_CHAR_AND_LENGTH expects.
12649 (bidi_paragraph_init, bidi_resolve_explicit_1)
12650 (bidi_resolve_explicit, bidi_resolve_weak)
12651 (bidi_level_of_next_char, bidi_move_to_visually_next):
12652 Support iteration over a string.
12653 (bidi_set_sor_type, bidi_resolve_explicit_1)
12654 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12655 can now be zero (for strings); special values 0 and -1 were
12656 changed to -1 and -2, respectively.
12657 (bidi_char_at_pos): New function.
12658 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12659 Call it instead of FETCH_MULTIBYTE_CHAR.
12660 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12661 initialized to valid values.
12662 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12663 values.
12664 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12665 the test for valid cached positions. Fix the logic for looking up
12666 the sentinel state in the cache. GCPRO the Lisp string we are
12667 iterating.
12668 (bidi_push_it, bidi_pop_it): New functions.
12669 (bidi_initialize): Initialize the bidi cache start stack pointer.
12670 (bidi_cache_ensure_space): New function, refactored from part of
12671 bidi_cache_iterator_state. Don't assume the required size is just
12672 one BIDI_CACHE_CHUNK away.
12673 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12674 (bidi_count_bytes, bidi_char_at_pos): New functions.
12675 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12676 always valid if bidi_cache_idx is valid.
12677 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12678 is valid if it's going to be used.
12679 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12680 (bidi_cache_fetch_state, bidi_cache_search)
12681 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12682 (bidi_cache_iterator_state, bidi_cache_find)
12683 (bidi_find_other_level_edge, bidi_cache_start_stack):
12684 All variables related to cache indices are now EMACS_INT.
12685
12686 * dispextern.h (struct bidi_string_data): New structure.
12687 (struct bidi_it): New member `string'. Make flag members be 1-bit
12688 fields, and put them last in the struct.
12689 (compute_display_string_pos, compute_display_string_end):
12690 Update prototypes.
12691 (bidi_push_it, bidi_pop_it): Add prototypes.
12692 (struct iterator_stack_entry): New members bidi_p,
12693 paragraph_embedding, and from_disp_prop_p.
12694 (struct it): Member bidi_p is now a bit field 1 bit wide.
12695 (bidi_shelve_cache, bidi_unshelve_cache):
12696 Declare prototypes.
12697
12698 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12699 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12700 and vector-like objects.
12701
12702 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12703 cache around display iteration.
12704
12705 * window.c (Fwindow_end, window_scroll_pixel_based)
12706 (displayed_window_lines, Frecenter): Save and restore the bidi
12707 cache around display iteration.
12708
127092011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12710
12711 * editfns.c (Fdelete_region): Clarify the use of the named
12712 parameters (bug#6788).
12713
127142011-07-14 Martin Rudalics <rudalics@gmx.at>
12715
12716 * indent.c (Fvertical_motion): Set and restore w->pointm when
12717 saving and restoring the window's buffer (Bug#9006).
12718
127192011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12720
12721 * editfns.c (Fstring_to_char): Clarify just what is returned
12722 (bug#6576). Text by Eli Zaretskii.
12723
127242011-07-13 Juanma Barranquero <lekktu@gmail.com>
12725
12726 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12727
127282011-07-13 Eli Zaretskii <eliz@gnu.org>
12729
12730 * buffer.c (mmap_find): Fix a typo.
12731
127322011-07-13 Johan Bockgård <bojohan@gnu.org>
12733
12734 Fix execution of x selection hooks.
12735 * xselect.c (Qx_lost_selection_functions)
12736 (Qx_sent_selection_functions): New vars.
12737 (syms_of_xselect): DEFSYM them.
12738 (x_handle_selection_request): Pass Qx_sent_selection_functions
12739 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12740 (x_handle_selection_clear,x_clear_frame_selections):
12741 Pass Qx_lost_selection_functions rather than
12742 Vx_lost_selection_functions to Frun_hook_with_args.
12743
127442011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12745
12746 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12747 The old code sometimes used this field without initializing it.
12748
12749 * alloc.c (gc_sweep): Don't read past end of array.
12750 In theory, the old code could also have corrupted Emacs internals,
12751 though it'd be very unlikely.
12752
127532011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12754
12755 * character.c (Fcharacterp): Don't advertise optional ignored
12756 argument. (Bug#4026)
12757
127582011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12759
12760 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12761 key" (bug#4257).
12762
12763 * window.c (Fset_window_start): Doc fix (bug#4199).
12764 (Fset_window_hscroll): Ditto.
12765
127662011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12767
12768 Fix minor new problems caught by GCC 4.6.1.
12769 * term.c (init_tty): Remove unused local.
12770 * xsettings.c (store_monospaced_changed): Define this function only
12771 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12772 not used otherwise.
12773
127742011-07-12 Chong Yidong <cyd@stupidchicken.com>
12775
12776 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12777
127782011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12779
12780 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12781 are the mini-buffer and the echo area (bug#3320).
12782
12783 * term.c (init_tty): Remove support for supdup, c10 and perq
12784 terminals, which are no longer supported (bug#1482).
12785
127862011-07-10 Johan Bockgård <bojohan@gnu.org>
12787
12788 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12789
127902011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12791
12792 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12793 for non-popups (Bug#3642).
12794
127952011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12796
12797 * alloc.c (reset_malloc_hooks): Protoize.
12798 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12799 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12800 * cm.c (losecursor): Likewise.
12801 * data.c (fmod): Likewise.
12802 * dispnew.c (swap_glyphs_in_rows): Likewise.
12803 * emacs.c (memory_warning_signal): Likewise.
12804 * floatfns.c (float_error): Likewise.
12805 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12806 (otf_open, font_otf_capability, generate_otf_features)
12807 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12808 Likewise.
12809 * image.c (pbm_read_file): Likewise.
12810 * indent.c (string_display_width): Likewise.
12811 * intervals.c (check_for_interval, search_for_interval)
12812 (inc_interval_count, count_intervals, root_interval)
12813 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12814 * lread.c (defalias): Likewise.
12815 * ralloc.c (r_alloc_check): Likewise.
12816 * regex.c (set_image_of_range_1, set_image_of_range)
12817 (regex_grow_registers): Likewise.
12818 * sysdep.c (strerror): Likewise.
12819 * termcap.c (valid_filename_p, tprint, main): Likewise.
12820 * tparam.c (main): Likewise.
12821 * unexhp9k800.c (run_time_remap, save_data_space)
12822 (update_file_ptrs, read_header, write_header, calculate_checksum)
12823 (copy_file, copy_rest, display_header): Likewise.
12824 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12825 Likewise.
12826 * xdisp.c (check_it): Likewise.
12827 * xfaces.c (register_color, unregister_color, unregister_colors):
12828 Likewise.
12829 * xfns.c (print_fontset_result): Likewise.
12830 * xrdb.c (member, fatal, main): Likewise.
12831
128322011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12833
12834 Fix minor problems found by static checking (Bug#9031).
12835 * chartab.c (char_table_set_range, map_sub_char_table):
12836 Remove unused locals.
12837 (uniprop_table): Now static.
12838 * composite.c (_work_char): Remove unused static var.
12839
128402011-07-09 Juanma Barranquero <lekktu@gmail.com>
12841
12842 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12843
128442011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12845
12846 * gtkutil.c (qttip_cb): Remove code without function.
12847
128482011-07-09 Eli Zaretskii <eliz@gnu.org>
12849
12850 * w32.c (pthread_sigmask): New stub.
12851
128522011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12853
12854 Use pthread_sigmask, not sigprocmask (Bug#9010).
12855 sigprocmask is portable only for single-threaded applications, and
12856 Emacs can be multi-threaded when it uses GTK.
12857 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12858 (LIBES): Use it.
12859 * callproc.c (Fcall_process):
12860 * process.c (create_process):
12861 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12862 Use pthread_sigmask, not sigprocmask.
12863
128642011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12865
12866 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12867 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12868 wrong (Bug#8591).
12869
128702011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12871
12872 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12873 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12874 (xg_hide_tooltip): Fix comment.
12875
12876 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12877 in registerServicesMenuSendTypes.
12878 (validRequestorForSendType): Don't check ns_return_types.
12879
12880 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12881 ns_return_type.
12882
128832011-07-08 Jason Rumney <jasonr@gnu.org>
12884
12885 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12886 SH_SHOW for hidden windows (Bug#5482).
12887
12888 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12889 frame struct members of non-existent frames (Bug#6284).
12890
128912011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12892
12893 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12894 variable firstTime not needed on OSX >= 10.6.
12895 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12896 >= 10.5. Use setKnobProportion, setDoubleValue.
12897
12898 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12899 (MAC_OS_X_VERSION_10_5): Define if not defined.
12900 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12901 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12902 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12903
12904 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12905 cString and lossyCString on OSX >= 10.4.
12906
12907 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12908 sizeToFit on OSX >= 10.2.
12909
12910 * nsimage.m (allocInitFromFile): Don't use deprecated method
12911 bestRepresentationForDevice on OSX >= 10.6.
12912
12913 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12914 to avoid warning.
12915
12916 * emacs.c: Declare unexec_init_emacs_zone.
12917
12918 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12919
12920 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12921
12922 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12923 on svcsMenu (Bug#8842).
12924
12925 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12926 ns_return_types.
12927 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12928
12929 * nsterm.m (QUTF8_STRING): Declare.
12930 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12931 (validRequestorForSendType): Return type is (id).
12932 Change indexOfObjectIdenticalTo to indexOfObject.
12933 Check if we have local selection before returning self (Bug#8842).
12934 (writeSelectionToPasteboard): Put local selection into paste board
12935 if we have a local selection (Bug#8842).
12936 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12937
12938 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12939 (ns_get_local_selection): Declare.
12940
129412011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12942
12943 * keymap.c (describe_map_tree): Don't insert a double newline at
12944 the end of the buffer (bug#1169) and return whether we inserted
12945 something.
12946
12947 * callint.c (Fcall_interactively): Change "reading args" to
12948 "providing args" to try to clarify what it does (bug#1010).
12949
129502011-07-07 Kenichi Handa <handa@m17n.org>
12951
12952 * composite.c (composition_compute_stop_pos): Ignore a static
12953 composition starting before CHARPOS (Bug#8915).
12954
12955 * xdisp.c (handle_composition_prop): Likewise.
12956
129572011-07-07 Eli Zaretskii <eliz@gnu.org>
12958
12959 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12960 (Bug#9015)
12961
129622011-07-07 Kenichi Handa <handa@m17n.org>
12963
12964 * character.h (unicode_category_t): New enum type.
12965
12966 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12967 (Qchar_code_property_table): New variable.
12968 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12969 (UNIPROP_COMPRESSED_FORM_P): New macros.
12970 (char_table_ascii): Uncompress the compressed values.
12971 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12972 Uncompress the compressed values.
12973 (sub_char_table_ref_and_range): Likewise.
12974 (char_table_ref_and_range): Uncompress the compressed values.
12975 (sub_char_table_set): New arg is_uniprop. Callers changed.
12976 Uncompress the compressed values.
12977 (sub_char_table_set_range): Args changed. Callers changed.
12978 (char_table_set_range): Adjuted for the above change.
12979 (map_sub_char_table): Delete args default_val and parent. Add arg
12980 top. Give decoded values to a Lisp function.
12981 (map_char_table): Adjust for the above change. Give decoded
12982 values to a Lisp function. Gcpro more variables.
12983 (uniprop_table_uncompress)
12984 (uniprop_decode_value_run_length): New functions.
12985 (uniprop_decoder, uniprop_decoder_count): New variables.
12986 (uniprop_get_decoder, uniprop_encode_value_character)
12987 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12988 New functions.
12989 (uniprop_encoder, uniprop_encoder_count): New variables.
12990 (uniprop_get_encoder, uniprop_table)
12991 (Funicode_property_table_internal, Fget_unicode_property_internal)
12992 (Fput_unicode_property_internal): New functions.
12993 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12994 Sunicode_property_table_internal, Sget_unicode_property_internal,
12995 and Sput_unicode_property_internal. Defvar_lisp
12996 char-code-property-alist.
12997
12998 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12999 Vunicode_category_table.
13000
13001 * font.c (font_range): Adjust for the change of
13002 Vunicode_category_table.
13003
130042011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13005
13006 * m/iris4d.h: Remove file, move contents ...
13007 * s/irix6-5.h: ... here.
13008
130092011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13010
13011 Remove unportable assumption about struct layout (Bug#8884).
13012 * alloc.c (mark_buffer):
13013 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13014 (clone_per_buffer_values): Don't assume that
13015 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13016 This isn't true in general, and it's particularly not true
13017 if Emacs is configured with --with-wide-int.
13018 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13019 New macros, used in the buffer.c change.
13020
130212011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13022
13023 * xsettings.c: Use both GConf and GSettings if both are available.
13024 (store_config_changed_event): Add comment.
13025 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13026 (store_tool_bar_style_changed): New functions.
13027 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
13028 (struct xsettings): Move font inside HAVE_XFT.
13029 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13030 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13031 Move inside HAVE_XFT.
13032 (something_changed_gsettingsCB): Rename from something_changedCB.
13033 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13034 also.
13035 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13036 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
13037 (something_changed_gconfCB): Rename from something_changedCB.
13038 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13039 (parse_settings): Move check for font inside HAVE_XFT.
13040 (read_settings, apply_xft_settings): Add comment.
13041 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13042 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13043 call store_font_name_changed.
13044 (xft_settings_event): Add comment.
13045 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13046 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13047 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13048 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13049 (xsettings_initialize): Call init_gsettings last.
13050 (xsettings_get_system_font, xsettings_get_system_normal_font):
13051 Add comment.
13052
130532011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13054
13055 Random fixes. E.g., (random) never returned negative values.
13056 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13057 subseconds part to the entropy, as that's a bit more random.
13058 Prefer signed to unsigned, since the signedness doesn't matter and
13059 in general we prefer signed. When given a limit, use a
13060 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13061 latter isn't right if USE_2_TAGS_FOR_INTS.
13062 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13063 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13064
130652011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13066
13067 * textprop.c (text_property_stickiness):
13068 Obey Vtext_property_default_nonsticky.
13069 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13070 * w32fns.c (syms_of_w32fns):
13071 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13072
130732011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13074
13075 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13076 This is more efficient than Ffile_directory_p and avoids a minor race.
13077
130782011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13079
13080 * buffer.c (Foverlay_put): Say what the return value is
13081 (bug#7835).
13082
13083 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13084 is a directory before asking whether to use the file name
13085 (bug#7564).
13086 (barf_or_query_if_file_exists): Make the "File is a directory"
13087 error be more correct.
13088
13089 * fns.c (Frequire): Remove the mention of the .gz files, since
13090 that's installation-specific, but keep the mention of
13091 `get-load-suffixes'.
13092
130932011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13094
13095 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13096 Report string overflow if the output is too long.
13097
130982011-07-04 Juanma Barranquero <lekktu@gmail.com>
13099
13100 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13101 (syms_of_gnutls): Remove duplicate DEFSYM for
13102 Qgnutls_bootprop_verify_hostname_error, an error for
13103 Qgnutls_bootprop_verify_error (which is no longer used).
13104
13105 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13106 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13107 Also (re)move comments that are misplaced or no longer relevant.
13108
131092011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13110
13111 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13112
131132011-07-03 Chong Yidong <cyd@stupidchicken.com>
13114
13115 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13116 and background color parameters if they have been changed.
13117
131182011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13119
13120 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13121
131222011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13123
13124 * xsettings.c (SYSTEM_FONT): Define only when used.
13125 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13126
13127 * keymap.c (access_keymap_1): Now static.
13128
131292011-07-02 Chong Yidong <cyd@stupidchicken.com>
13130
13131 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13132 leave any prefix arg for the up event (Bug#1586).
13133
131342011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13135
13136 * lread.c (syms_of_lread): Mention single symbols defined by
13137 `defvar' or `defconst' (bug#7154).
13138
13139 * fns.c (Frequire): Mention .el.gz files (bug#7314).
13140 (Frequire): Mention get-load-suffixes.
13141
131422011-07-02 Martin Rudalics <rudalics@gmx.at>
13143
13144 * window.h (window): Remove clone_number slot.
13145 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13146 Remove.
13147 (make_parent_window, make_window, saved_window)
13148 (Fset_window_configuration, save_window_save): Don't deal with
13149 clone numbers.
13150 * buffer.c (Qclone_number): Remove declaration.
13151 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13152
131532011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13154
13155 Add multiple inheritance to keymaps.
13156 * keymap.c (Fmake_composed_keymap): New function.
13157 (Fset_keymap_parent): Simplify.
13158 (fix_submap_inheritance): Remove.
13159 (access_keymap_1): New function extracted from access_keymap to handle
13160 embedded parents and handle lists of maps.
13161 (access_keymap): Use it.
13162 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13163 (Fcopy_keymap): Handle embedded parents.
13164 (Fcommand_remapping, define_as_prefix): Simplify.
13165 (Fkey_binding): Simplify.
13166 (syms_of_keymap): Move minibuffer-local-completion-map,
13167 minibuffer-local-filename-completion-map,
13168 minibuffer-local-must-match-map, and
13169 minibuffer-local-filename-must-match-map to Elisp.
13170 (syms_of_keymap): Defsubr make-composed-keymap.
13171 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13172 (parse_menu_item): Trivial simplification.
13173
131742011-07-01 Glenn Morris <rgm@gnu.org>
13175
13176 * Makefile.in (SETTINGS_LIBS): Fix typo.
13177
131782011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13179
13180 * coding.c (Fencode_coding_string): Record the last coding system
13181 used, as the function doc string says (bug#8738).
13182
131832011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13184
13185 * xsettings.c (store_monospaced_changed): Take new font as arg and
13186 check for change against current_mono_font.
13187 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13188 (emacs_settings_constructor, emacs_settings_get_property)
13189 (emacs_settings_set_property, emacs_settings_class_init)
13190 (emacs_settings_init, gsettings_obj): Remove.
13191 (something_changedCB): New function for HAVE_GSETTINGS.
13192 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13193 with value as argument.
13194 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13195 g_settings_new (Bug#8967). Do not create gsettings_obj.
13196 Remove calls to g_settings_bind. Connect something_changedCB to
13197 "changed".
13198
13199 * xgselect.c: Add defined (HAVE_GSETTINGS).
13200 (xgselect_initialize): Ditto.
13201
13202 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13203 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13204 xg_select.
13205
132062011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13207
13208 * eval.c (struct backtrace): Simplify and port the data structure.
13209 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13210 signed bit field, as this assumption is not portable and it makes
13211 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13212 "char debug_on_exit : 1" as this is not portable either; instead,
13213 use the portable "unsigned int debug_on_exit : 1". Remove unused
13214 member evalargs. Remove obsolete comments about cc bombing out.
13215
132162011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13217
13218 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
13219 Let HAVE_GSETTINGS override HAVE_GCONF.
13220 (store_monospaced_changed): New function.
13221 (EMACS_SETTINGS): A new type derived from GObject to handle
13222 GSettings notifications.
13223 (emacs_settings_constructor, emacs_settings_get_property)
13224 (emacs_settings_set_property, emacs_settings_class_init):
13225 New functions.
13226 (gsettings_client, gsettings_obj): New variables.
13227 (GSETTINGS_SCHEMA): New define.
13228 (something_changedCB): Call store_monospaced_changed.
13229 (init_gsettings): New function.
13230 (xsettings_initialize): Call init_gsettings.
13231 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13232 to NULL.
13233
13234 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13235 GCONF_CFLAGS/LIBS.
13236
132372011-06-29 Martin Rudalics <rudalics@gmx.at>
13238
13239 * window.c (resize_root_window, grow_mini_window)
13240 (shrink_mini_window): Rename Qresize_root_window to
13241 Qwindow_resize_root_window and Qresize_root_window_vertically to
13242 Qwindow_resize_root_window_vertically.
13243
132442011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13245
13246 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13247
132482011-06-27 Juanma Barranquero <lekktu@gmail.com>
13249
13250 * makefile.w32-in: Redesign dependencies so they reflect more
13251 clearly which files are directly included by each source file,
13252 and not through other includes.
13253
132542011-06-27 Martin Rudalics <rudalics@gmx.at>
13255
13256 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13257 (sort_overlays, overlay_strings): When an overlay's clone number
13258 matches the window's clone number process the overlay even if
13259 the overlay's window property doesn't match the current window.
13260
13261 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13262 (Fwindow_hchild): Rename to Fwindow_left_child.
13263 (Fwindow_next): Rename to Fwindow_next_sibling.
13264 (Fwindow_prev): Rename to Fwindow_prev_sibling.
13265 (resize_window_check): Rename to window_resize_check.
13266 (resize_window_apply): Rename to window_resize_apply.
13267 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13268 (Fdelete_other_windows_internal, resize_frame_windows)
13269 (Fsplit_window_internal, Fdelete_window_internal)
13270 (grow_mini_window, shrink_mini_window)
13271 (Fresize_mini_window_internal): Fix callers accordingly.
13272
132732011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13274
13275 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13276 (emacs_fixed_set_min_size): Remove.
13277 (emacs_fixed_new): Take frame as argument.
13278
13279 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13280 (_EmacsFixedPrivate): Remove minwidth/height.
13281 Add struct frame *f.
13282 (emacs_fixed_init): Initialize priv->f.
13283 (get_parent_class, emacs_fixed_set_min_size): Remove.
13284 (emacs_fixed_new): Set priv->f to argument.
13285 (emacs_fixed_get_preferred_width)
13286 (emacs_fixed_get_preferred_height): Use min_width/height from
13287 frames size_hint to set minimum and natural (Bug#8919).
13288 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13289 and use min_width/height from frames size_hint to set
13290 min_width/height (Bug#8919).
13291
13292 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13293 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13294 Fix indentation.
13295
132962011-06-26 Eli Zaretskii <eliz@gnu.org>
13297
13298 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13299 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13300 called at ZV.
13301
133022011-06-26 Chong Yidong <cyd@stupidchicken.com>
13303
13304 * process.c (wait_reading_process_output): Bypass select if
13305 waiting for a cell while ignoring keyboard input, and input is
13306 pending. Suggested by Jan Djärv (Bug#8869).
13307
133082011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13309
13310 Use gnulib's dup2 module instead of rolling our own.
13311 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13312
133132011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13314
13315 * dispnew.c (scrolling_window): Before scrolling, turn off a
13316 mouse-highlight in the window being scrolled.
13317
133182011-06-24 Juanma Barranquero <lekktu@gmail.com>
13319
13320 Move DEFSYM to lisp.h and use everywhere.
13321
13322 * character.h (DEFSYM): Move declaration...
13323 * lisp.h (DEFSYM): ...here.
13324
13325 * gnutls.c:
13326 * minibuf.c:
13327 * w32menu.c:
13328 * w32proc.c:
13329 * w32select.c: Don't include character.h.
13330
13331 * alloc.c (syms_of_alloc):
13332 * buffer.c (syms_of_buffer):
13333 * bytecode.c (syms_of_bytecode):
13334 * callint.c (syms_of_callint):
13335 * casefiddle.c (syms_of_casefiddle):
13336 * casetab.c (init_casetab_once):
13337 * category.c (init_category_once, syms_of_category):
13338 * ccl.c (syms_of_ccl):
13339 * cmds.c (syms_of_cmds):
13340 * composite.c (syms_of_composite):
13341 * dbusbind.c (syms_of_dbusbind):
13342 * dired.c (syms_of_dired):
13343 * dispnew.c (syms_of_display):
13344 * doc.c (syms_of_doc):
13345 * editfns.c (syms_of_editfns):
13346 * emacs.c (syms_of_emacs):
13347 * eval.c (syms_of_eval):
13348 * fileio.c (syms_of_fileio):
13349 * fns.c (syms_of_fns):
13350 * frame.c (syms_of_frame):
13351 * fringe.c (syms_of_fringe):
13352 * insdel.c (syms_of_insdel):
13353 * keymap.c (syms_of_keymap):
13354 * lread.c (init_obarray, syms_of_lread):
13355 * macros.c (syms_of_macros):
13356 * msdos.c (syms_of_msdos):
13357 * print.c (syms_of_print):
13358 * process.c (syms_of_process):
13359 * search.c (syms_of_search):
13360 * sound.c (syms_of_sound):
13361 * syntax.c (init_syntax_once, syms_of_syntax):
13362 * terminal.c (syms_of_terminal):
13363 * textprop.c (syms_of_textprop):
13364 * undo.c (syms_of_undo):
13365 * w32.c (globals_of_w32):
13366 * window.c (syms_of_window):
13367 * xdisp.c (syms_of_xdisp):
13368 * xfaces.c (syms_of_xfaces):
13369 * xfns.c (syms_of_xfns):
13370 * xmenu.c (syms_of_xmenu):
13371 * xsettings.c (syms_of_xsettings):
13372 * xterm.c (syms_of_xterm): Use DEFSYM.
13373
133742011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13375
13376 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13377
133782011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13379
13380 Integer and buffer overflow fixes (Bug#8873).
13381
13382 * print.c (printchar, strout): Check for string overflow.
13383 (PRINTPREPARE, printchar, strout):
13384 Don't set size unless allocation succeeds.
13385
13386 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13387 for sizes. Check for string overflow more accurately.
13388 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13389
13390 * macros.c: Integer and buffer overflow fixes.
13391 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13392 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13393 Use ptrdiff_t, not int, for sizes.
13394 Don't increment bufsize until after realloc succeeds.
13395 Check for size-calculation overflow.
13396 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13397
13398 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13399
13400 * lread.c: Integer overflow fixes.
13401 (read_integer): Radix is now EMACS_INT, not int,
13402 to improve quality of diagnostics for out-of-range radices.
13403 Calculate buffer size correctly for out-of-range radices.
13404 (read1): Check for integer overflow in radices, and in
13405 read-circle numbers.
13406 (read_escape): Avoid int overflow.
13407 (Fload, openp, read_buffer_size, read1)
13408 (substitute_object_recurse, read_vector, read_list, map_obarray):
13409 Use ptrdiff_t, not int, for sizes.
13410 (read1): Use EMACS_INT, not int, for sizes.
13411 Check for size overflow.
13412
13413 * image.c (cache_image): Check for size arithmetic overflow.
13414
13415 * lread.c: Integer overflow issues.
13416 (saved_doc_string_size, saved_doc_string_length)
13417 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13418 Now ptrdiff_t, not int.
13419 (read1): Don't assume doc string length fits in int. Check for
13420 out-of-range doc string lengths.
13421 (read_list): Don't assume file position fits in int.
13422 (read_escape): Check for hex character overflow.
13423
134242011-06-22 Leo Liu <sdl.web@gmail.com>
13425
13426 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13427 Move to minibuffer.el.
13428
134292011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13430
13431 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13432 The following patches are for when GLYPH_DEBUG && !XASSERT.
13433 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13434 * dispnew.c (flush_stdout):
13435 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13436 Mark as externally visible.
13437 * dispnew.c (check_window_matrix_pointers): Now static.
13438 * dispnew.c (window_to_frame_vpos):
13439 * xfns.c (unwind_create_frame):
13440 * xterm.c (x_check_font): Remove unused local.
13441 * scroll.c (CHECK_BOUNDS):
13442 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13443 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13444 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13445 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13446 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13447 Now static.
13448 (debug_method_add): Use va_list and vsprintf rather than relying
13449 on undefined behavior with wrong number of arguments.
13450 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13451 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13452 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13453 since we're not interested in debugging glyphs with old libraries.
13454 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13455 GCC 4.6.0's static checking.
13456
134572011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13458
13459 Integer overflow and signedness fixes (Bug#8873).
13460 A few related buffer overrun fixes, too.
13461
13462 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13463
13464 * dispextern.h (struct face.stipple):
13465 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13466 (x_bitmap_mask, x_allocate_bitmap_record)
13467 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13468 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13469 (x_create_bitmap_from_xpm_data):
13470 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13471 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13472 (.bitmaps_last):
13473 * xfaces.c (load_pixmap):
13474 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13475 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13476 (.bitmaps_last, struct x_output.icon_bitmap):
13477 Use ptrdiff_t, not int, for bitmap indexes.
13478 (x_allocate_bitmap_record): Check for size overflow.
13479 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13480
13481 Use ptrdiff_t, not int, for overlay counts.
13482 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13483 * editfns.c (overlays_around, get_pos_property):
13484 * textprop.c (get_char_property_and_overlay):
13485 * xdisp.c (next_overlay_change, note_mouse_highlight):
13486 * xfaces.c (face_at_buffer_position):
13487 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13488 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13489 (Fnext_overlay_change, Fprevious_overlay_change)
13490 (mouse_face_overlay_overlaps, Foverlays_in):
13491 Use ptrdiff_t, not int, for sizes.
13492 (overlays_at, overlays_in): Check for size-calculation overflow.
13493
13494 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13495
13496 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13497 (x_session_initialize): Do not assume string length fits in int.
13498
13499 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13500 This is unlikely, but can occur if DPI is outlandish.
13501
13502 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13503 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13504
13505 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13506 * xrdb.c (magic_file_p, search_magic_path):
13507 Omit last arg SUFFIX; it was always 0. All callers changed.
13508 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13509
13510 * xfont.c (xfont_match): Avoid need for strlen.
13511
13512 * xfns.c: Don't assume strlen fits in int.
13513 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13514
13515 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13516 not unsigned long, as we prefer signed integers. All callers changed.
13517 Detect integer overflow in repeat count.
13518 (message_dolog): Don't assume print length fits in 39 bytes.
13519 (display_mode_element): Don't assume strlen fits in int.
13520
13521 * termcap.c: Don't assume sizes fit in int and never overflow.
13522 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13523 (gobble_line): Check for size-calculation overflow.
13524
13525 * minibuf.c (Fread_buffer):
13526 * lread.c (intern, intern_c_string):
13527 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13528 Don't assume string length fits in int.
13529
13530 * keyboard.c (parse_tool_bar_item):
13531 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13532
13533 * font.c: Don't assume string length fits in int.
13534 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13535 Use ptrdiff_t, not int.
13536 (font_intern_prop): Don't assume string length fits in int.
13537 Don't assume integer property fits in fixnum.
13538 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13539
13540 * filelock.c: Fix some buffer overrun and integer overflow issues.
13541 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13542 Reformulate so as not to need the command string.
13543 Invoke gzip -cd rather than gunzip, as it's more portable.
13544 (lock_info_type, lock_file_1, lock_file):
13545 Don't assume pid_t and time_t fit in unsigned long.
13546 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13547 (current_lock_owner): Prefer signed type for sizes.
13548 Use memcpy, not strncpy, where memcpy is what is really wanted.
13549 Don't assume (via atoi) that time_t and pid_t fit in int.
13550 Check for time_t and/or pid_t out of range, e.g., via a network share.
13551 Don't alloca where an auto var works fine.
13552
13553 * fileio.c: Fix some integer overflow issues.
13554 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13555 Don't assume string length fits in int.
13556 (directory_file_name): Don't assume string length fits in long.
13557 (make_temp_name): Don't assume pid fits in int, or that its print
13558 length is less than 20.
13559
13560 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13561
13562 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13563
13564 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13565
13566 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13567 We prefer signed integers, even for size calculations.
13568
13569 * emacs.c: Don't assume string length fits in 'int'.
13570 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13571 (main): Don't invoke strlen when not needed.
13572
13573 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13574 (XD_DEBUG_MESSAGE): Don't waste a byte.
13575
13576 * callproc.c (getenv_internal_1, getenv_internal)
13577 (Fgetenv_internal):
13578 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13579
13580 * lread.c (invalid_syntax): Omit length argument.
13581 All uses changed. This doesn't fix a bug, but it simplifies the
13582 code away from its former Hollerith-constant appearance, and it's
13583 one less 'int' to worry about when looking at integer-overflow issues.
13584 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13585
13586 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13587 This didn't break anything, but it didn't help either.
13588 It's confusing to put a bogus integer in a place where the actual
13589 value does not matter.
13590 (LIST_END_P): Remove unused macro and its bogus comment.
13591 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13592
13593 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13594 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13595 implementation.
13596 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13597 We prefer signed types, and the value cannot exceed the EMACS_INT
13598 range anyway (because otherwise the length would not be representable).
13599 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13600 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13601 This avoids a GCC warning when WIDE_EMACS_INT.
13602
13603 * indent.c (sane_tab_width): New function.
13604 (current_column, scan_for_column, Findent_to, position_indentation)
13605 (compute_motion): Use it. This is just for clarity.
13606 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13607
13608 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13609
13610 * lisp.h (lint_assume): New macro.
13611 * composite.c (composition_gstring_put_cache):
13612 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13613
13614 * editfns.c, insdel.c:
13615 Omit unnecessary forward decls, to simplify future changes.
13616
13617 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13618
13619 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13620
13621 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13622 Use much-faster test for byte-length change.
13623 Don't assume string byte-length fits in 'int'.
13624 Check that character arg fits in 'int'.
13625 (mapcar1): Declare byte as byte, for clarity.
13626
13627 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13628
13629 * fns.c (concat): Catch string overflow earlier.
13630 Do not rely on integer wraparound.
13631
13632 * dispextern.h (struct it.overlay_strings_charpos)
13633 (struct it.selective): Now EMACS_INT, not int.
13634 * xdisp.c (forward_to_next_line_start)
13635 (back_to_previous_visible_line_start)
13636 (reseat_at_next_visible_line_start, next_element_from_buffer):
13637 Don't arbitrarily truncate the value of 'selective' to int.
13638
13639 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13640
13641 * composite.c: Don't truncate sizes to 'int'.
13642 (composition_gstring_p, composition_reseat_it)
13643 (composition_adjust_point): Use EMACS_INT, not int.
13644 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13645 not EMACS_UINT, for indexes.
13646
13647 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13648
13649 * buffer.c: Include <verify.h>.
13650 (struct sortvec.priority, struct sortstr.priority):
13651 Now EMACS_INT, not int.
13652 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13653 (struct sortstr.size, record_overlay_string)
13654 (struct sortstrlist.size, struct sortlist.used):
13655 Don't truncate size to int.
13656 (record_overlay_string): Check for size-calculation overflow.
13657 (init_buffer_once): Check at compile-time, not run-time.
13658
136592011-06-22 Jim Meyering <meyering@redhat.com>
13660
13661 Don't leak an XBM-image-sized buffer
13662 * image.c (xbm_load): Free the image buffer after using it.
13663
136642011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13665
13666 Port to Sun C.
13667 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13668 that Sun C diagnosed.
13669 * fns.c (secure_hash): Fix pointer signedness issue.
13670 * intervals.c (static_offset_intervals): New function.
13671 (offset_intervals): Use it.
13672
136732011-06-21 Leo Liu <sdl.web@gmail.com>
13674
13675 * deps.mk (fns.o):
13676 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13677 sha512.h.
13678
13679 * fns.c (secure_hash): Rename from crypto_hash_function and change
13680 the first arg to accept symbols.
13681 (Fsecure_hash): New primitive.
13682 (syms_of_fns): New symbols.
13683
136842011-06-20 Deniz Dogan <deniz@dogan.se>
13685
13686 * process.c (Fset_process_buffer): Clarify return value in
13687 docstring.
13688
136892011-06-18 Chong Yidong <cyd@stupidchicken.com>
13690
13691 * dispnew.c (add_window_display_history): Use BVAR.
13692
13693 * xdisp.c (debug_method_add): Use BVAR.
13694 (check_window_end, dump_glyph_matrix, dump_glyph)
13695 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13696
13697 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13698 Likewise.
13699
13700 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13701 check till after the cache is created in init_frame_faces.
13702
137032011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13704
13705 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13706
137072011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13708
13709 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13710 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13711 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13712
13713 Improve buffer-overflow checking (Bug#8873).
13714 * fileio.c (Finsert_file_contents):
13715 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13716 Remove the old (too-loose) buffer overflow checks.
13717 They weren't needed, since make_gap checks for buffer overflow.
13718 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13719 The old code merely checked for Emacs fixnum overflow, and relied
13720 on undefined (wraparound) behavior. The new code avoids undefined
13721 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13722
13723 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13724 Tune. Don't use wider integers than needed. Don't use alloca.
13725 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13726
13727 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13728
13729 * insdel.c, lisp.h (buffer_overflow): New function.
13730 (insert_from_buffer_1, replace_range, replace_range_2):
13731 * insdel.c (make_gap_larger):
13732 * editfns.c (Finsert_char):
13733 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13734
13735 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13736
137372011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13738
13739 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13740
13741 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13742 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13743
13744 * fileio.c: Don't assume EMACS_INT fits in off_t.
13745 (emacs_lseek): New static function.
13746 (Finsert_file_contents, Fwrite_region): Use it.
13747 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13748
13749 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13750
13751 * fns.c: Don't overflow int when computing a list length.
13752 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13753 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13754 truncation on 64-bit hosts. Check for QUIT every
13755 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13756 faster and is responsive enough.
13757 (Flength): Report an error instead of overflowing an integer.
13758 (Fsafe_length): Return a float if the value is not representable
13759 as a fixnum. This shouldn't happen except in contrived situations.
13760 (Fnthcdr, Fsort): Don't assume list length fits in int.
13761 (Fcopy_sequence): Don't assume vector length fits in int.
13762
13763 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13764 (header_size, word_size): New constants.
13765 (allocate_vectorlike): Don't check size overflow here.
13766 (allocate_vector): Check it here instead, since this is the only
13767 caller of allocate_vectorlike that could cause overflow.
13768 Check that the new vector's length is representable as a fixnum.
13769
13770 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13771 The previous code was bogus. For example, next_almost_prime (32)
13772 returned 39, which is undesirable as it is a multiple of 3; and
13773 next_almost_prime (24) returned 25, which is a multiple of 5 so
13774 why was the code bothering to check for multiples of 7?
13775
13776 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13777
13778 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13779
13780 Variadic C functions now count arguments with ptrdiff_t.
13781 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13782 Back then I didn't know that the Emacs coding style prefers signed int.
13783 Also, in the meantime I found a few more instances where arguments
13784 were being counted with int, which may truncate counts on 64-bit
13785 machines, or EMACS_INT, which may be unnecessarily wide.
13786 * lisp.h (struct Lisp_Subr.function.aMANY)
13787 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13788 Arg counts are now ptrdiff_t, not size_t.
13789 All variadic functions and their callers changed accordingly.
13790 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13791 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13792 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13793 * callint.c (Fcall_interactively): Check arg count for overflow,
13794 to avoid potential buffer overrun. Use signed char, not 'int',
13795 for 'varies' array, so that we needn't bother to check its size
13796 calculation for overflow.
13797 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13798 * eval.c (apply_lambda):
13799 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13800 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13801 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13802
13803 * callint.c (Fcall_interactively): Don't use index var as event count.
13804
13805 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13806 * mem-limits.h (SIZE): Remove; no longer used.
13807
13808 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13809
13810 Remove unnecessary casts.
13811 * xterm.c (x_term_init):
13812 * xfns.c (x_set_border_pixel):
13813 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13814 These aren't needed now that we assume ANSI C.
13815
13816 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13817 It's more likely to cause problems (due to unsigned overflow)
13818 than to cure them.
13819
13820 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13821
13822 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13823
13824 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13825
13826 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13827
13828 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13829
13830 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13831
13832 GLYPH_CODE_FACE returns EMACS_INT, not int.
13833 * dispextern.h (merge_faces):
13834 * xfaces.c (merge_faces):
13835 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13836 Don't assume EMACS_INT fits in int.
13837
13838 * character.h (CHAR_VALID_P): Remove unused parameter.
13839 * fontset.c, lisp.h, xdisp.c: All uses changed.
13840
13841 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13842
13843 * fns.c (concat): Minor tuning based on overflow analysis.
13844 This doesn't fix any bugs. Use int to hold character, instead
13845 of constantly refetching from Emacs object. Use XFASTINT, not
13846 XINT, for value known to be a character. Don't bother comparing
13847 a single byte to 0400, as it's always less.
13848
13849 * floatfns.c (Fexpt):
13850 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13851
13852 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13853 for characters.
13854
13855 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13856
13857 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13858 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13859 incorrectly succeed when S was a string, because 4294967386 was
13860 truncated before it was used.
13861
13862 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13863 Otherwise, an out-of-range integer could cause undefined behavior
13864 on a 64-bit host.
13865
13866 * composite.c: Use int, not EMACS_INT, for characters.
13867 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13868 EMACS_INT, for values that are known to be in character range.
13869 This doesn't fix any bugs but is the usual style inside Emacs and
13870 may generate better code on 32-bit machines.
13871
13872 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13873 This is for reasons similar to the recent CHAR_STRING fix.
13874 * charset.c (Fencode_char): Check that character arg is actually
13875 a character. Pass an int to ENCODE_CHAR.
13876 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13877 wider than 'int', as a compile-time check to prevent future regressions
13878 in this area.
13879
13880 * character.c (char_string): Remove unnecessary casts.
13881
13882 Make sure a 64-bit char is never passed to CHAR_STRING.
13883 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13884 by silently ignoring the top 32 bits, allowing some values
13885 that were far too large to be valid characters.
13886 * character.h: Include <verify.h>.
13887 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13888 arguments are no wider than unsigned, as a compile-time check
13889 to prevent future regressions in this area.
13890 * data.c (Faset):
13891 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13892 (Fsubst_char_in_region):
13893 * fns.c (concat):
13894 * xdisp.c (decode_mode_spec_coding):
13895 Adjust to CHAR_STRING's new requirement.
13896 * editfns.c (Finsert_char, Fsubst_char_in_region):
13897 * fns.c (concat): Check that character args are actually
13898 characters. Without this test, these functions did the wrong
13899 thing with wildly out-of-range values on 64-bit hosts.
13900
13901 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13902 These casts should not be needed on 32-bit hosts, either.
13903 * keyboard.c (read_char):
13904 * lread.c (Fload): Remove casts to unsigned.
13905
13906 * lisp.h (UNSIGNED_CMP): New macro.
13907 This fixes comparison bugs on 64-bit hosts.
13908 (ASCII_CHAR_P): Use it.
13909 * casefiddle.c (casify_object):
13910 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13911 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13912 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13913 * dispextern.h (FACE_FROM_ID):
13914 * keyboard.c (read_char): Use UNSIGNED_CMP.
13915
13916 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13917 not to EMACS_INT, to avoid GCC warning.
13918
13919 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13920
13921 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13922 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13923 isn't needed on 32-bit machines.
13924
13925 * buffer.c (Fgenerate_new_buffer_name):
13926 Use EMACS_INT for count, not int.
13927 (advance_to_char_boundary): Return EMACS_INT, not int.
13928
13929 * data.c (Qcompiled_function): Now static.
13930
13931 * window.c (window_body_lines): Now static.
13932
13933 * image.c (gif_load): Rename local to avoid shadowing.
13934
13935 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13936 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13937 * alloc.c (make_save_value): Integer argument is now of type
13938 ptrdiff_t, not int.
13939 (mark_object): Use ptrdiff_t, not int.
13940 * lisp.h (pD): New macro.
13941 * print.c (print_object): Use it.
13942
13943 * alloc.c: Use EMACS_INT, not int, to count objects.
13944 (total_conses, total_markers, total_symbols, total_vector_size)
13945 (total_free_conses, total_free_markers, total_free_symbols)
13946 (total_free_floats, total_floats, total_free_intervals)
13947 (total_intervals, total_strings, total_free_strings):
13948 Now EMACS_INT, not int. All uses changed.
13949 (Fgarbage_collect): Compute overall total using a double, so that
13950 integer overflow is less likely to be a problem. Check for overflow
13951 when converting back to an integer.
13952 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13953 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13954 These were 'int' variables that could overflow on 64-bit hosts;
13955 they were never used, so remove them instead of repairing them.
13956 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13957 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13958 Previously, this ceilinged at INT_MAX, but that doesn't work on
13959 64-bit machines.
13960 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13961
13962 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13963 (allocate_vectorlike): Check for ptrdiff_t overflow.
13964 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13965 when a (possibly-narrower) signed value would do just as well.
13966 We prefer using signed arithmetic, to avoid comparison confusion.
13967
13968 * alloc.c: Catch some string size overflows that we were missing.
13969 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13970 for convenience in STRING_BYTES_MAX.
13971 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13972 The definition here is exact; the one in lisp.h was approximate.
13973 (allocate_string_data): Check for string overflow. This catches
13974 some instances we weren't catching before. Also, it catches
13975 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13976 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13977 and ptrdiff_t and EMACS_INT are both 64 bits.
13978
13979 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13980 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13981 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13982
13983 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13984
13985 * alloc.c (Fmake_string): Check for out-of-range init.
13986
139872011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13988
13989 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13990
139912011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13992
13993 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13994 xg_get_default_scrollbar_width.
13995
13996 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13997 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13998 (style_changed_cb): Call update_theme_scrollbar_width and call
13999 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14000 all frames (Bug#8505).
14001 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14002 Call gtk_window_set_resizable if HAVE_GTK3.
14003 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14004 and height if HAVE_GTK3 (Bug#8505).
14005 (scroll_bar_width_for_theme): New variable.
14006 (update_theme_scrollbar_width): New function.
14007 (xg_get_default_scrollbar_width): Move code to
14008 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14009 (xg_initialize): Call update_theme_scrollbar_width.
14010
14011 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14012
14013 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14014
140152011-06-12 Martin Rudalics <rudalics@gmx.at>
14016
14017 * frame.c (make_frame): Call other_buffer_safely instead of
14018 other_buffer.
14019
14020 * window.c (temp_output_buffer_show): Call display_buffer with
14021 second argument Vtemp_buffer_show_specifiers and reset latter
14022 immediately after the call.
14023 (Vtemp_buffer_show_specifiers): New variable.
14024 (auto_window_vscroll_p, next_screen_context_lines)
14025 (Vscroll_preserve_screen_position): Remove leading asterisks from
14026 doc-strings.
14027
140282011-06-12 Paul Eggert <eggert@cs.ucla.edu>
14029
14030 Fix minor problems found by GCC 4.6.0 static checking.
14031 * buffer.c (Qclone_number): Remove for now, as it's unused.
14032 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14033 (record_buffer): Remove unused local.
14034 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14035 (set_frame_buffer_list): Remove; unused.
14036 * frame.h (other_visible_frames): Remove decl.
14037 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14038 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14039 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14040 if HAVE_GPM.
14041 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14042 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14043 Define only if HAVE_GPM.
14044 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14045 (update_hints_inhibit): Remove; never set. All uses removed.
14046 * widgetprv.h (emacsFrameClassRec): Remove decl.
14047 * window.c (delete_deletable_window): Now returns void, since it
14048 wasn't returning anything.
14049 (compare_window_configurations): Remove unused locals.
14050 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14051 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14052 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14053 the same widths as pointers. This follows up on the 2011-05-06 patch.
14054 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14055 * xterm.h: Likewise.
14056 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14057
140582011-06-12 Juanma Barranquero <lekktu@gmail.com>
14059
14060 * makefile.w32-in: Update dependencies.
14061 (LISP_H): Add lib/intprops.h.
14062
140632011-06-11 Chong Yidong <cyd@stupidchicken.com>
14064
14065 * image.c (gif_load): Add animation frame delay to the metadata.
14066 (syms_of_image): Use DEFSYM. New symbol `delay'.
14067
140682011-06-11 Martin Rudalics <rudalics@gmx.at>
14069
14070 * window.c (delete_deletable_window): Re-add.
14071 (Fset_window_configuration): Rewrite to handle dead buffers and
14072 consequently deletable windows.
14073 (window_tree, Fwindow_tree): Remove. Supply functionality in
14074 window.el.
14075 (compare_window_configurations): Simplify code.
14076
140772011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14078
14079 * image.c (imagemagick_load_image): Fix type mismatch.
14080 (Fimagemagick_types): Likewise.
14081
14082 * window.h (replace_buffer_in_windows): Declare.
14083
140842011-06-11 Martin Rudalics <rudalics@gmx.at>
14085
14086 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14087 Qclone_number. Remove external declaration of Qdelete_window.
14088 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14089 code.
14090 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14091 Run Qbuffer_list_update_hook if allowed.
14092 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14093 buffer list implementation.
14094 (other_buffer_safely): New function.
14095 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14096 calls to replace_buffer_in_windows and
14097 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14098 if allowed.
14099 (record_buffer): Inhibit quitting and rewrite using quittable
14100 functions. Run Qbuffer_list_update_hook if allowed.
14101 (Frecord_buffer, Funrecord_buffer): New functions.
14102 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14103 Move switch-to-buffer to window.el.
14104 (bury-buffer): Move to window.el.
14105 (Vbuffer_list_update_hook): New variable.
14106
14107 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14108 section.
14109
14110 * window.h (resize_frame_windows): Move up in code.
14111 (Fwindow_frame): Remove EXFUN.
14112 (replace_buffer_in_all_windows): Remove prototype.
14113 (replace_buffer_in_windows_safely): Add prototype.
14114
14115 * window.c: Declare Qdelete_window static again. Move down
14116 declaration of select_count.
14117 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14118 (Fother_window): Move to window.el.
14119 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14120 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14121 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14122 window.el.
14123 (replace_buffer_in_windows): Implement by calling
14124 Qreplace_buffer_in_windows.
14125 (replace_buffer_in_all_windows): Remove with some functionality
14126 moved into replace_buffer_in_windows_safely.
14127 (replace_buffer_in_windows_safely): New function.
14128 (select_window_norecord, select_frame_norecord): Move in front
14129 of run_window_configuration_change_hook. Remove now obsolete
14130 declarations.
14131 (Fset_window_buffer): Rewrite doc-string.
14132 Call Qrecord_window_buffer.
14133 (keys_of_window): Move binding for other-window to window.el.
14134
141352011-06-11 Chong Yidong <cyd@stupidchicken.com>
14136
14137 * dispextern.h (struct image): Replace data member, whose int_val
14138 and ptr_val fields were not used by anything, with a single
14139 lisp_val object.
14140
14141 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14142 (gif_clear_image, gif_load, imagemagick_load_image)
14143 (gs_clear_image, gs_load): Callers changed.
14144
141452011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14146
14147 * buffer.h: Include <time.h>, for time_t.
14148 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14149
14150 Fix minor problems found by static checking.
14151
14152 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14153
14154 Make identifiers static if they are not used in other modules.
14155 * data.c (Qcompiled_function, Qframe, Qvector):
14156 * image.c (QimageMagick, Qsvg):
14157 * minibuf.c (Qmetadata):
14158 * window.c (resize_window_check, resize_root_window): Now static.
14159 * window.h (resize_window_check, resize_root_window): Remove decls.
14160
14161 * window.c (window_deletion_count, delete_deletable_window):
14162 Remove; unused.
14163 (window_body_lines): Now static.
14164 (Fdelete_other_windows_internal): Mark vars as initialized.
14165 Make sure 'resize_failed' is initialized.
14166 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14167 (resize_window_apply): Remove unused local.
14168 * window.h (delete_deletable_window): Remove decl.
14169
14170 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14171 (imagemagick_load_image): Fix pointer signedness problem by changing
14172 last arg from unsigned char * to char *. All uses changed.
14173 Also, fix a local for similar reasons.
14174 Remove unused locals. Remove locals to avoid shadowing.
14175 (fn_rsvg_handle_free): Remove; unused.
14176 (svg_load, svg_load_image): Fix pointer signedness problem.
14177 (imagemagick_load_image): Don't use garbage pointer image_wand.
14178
14179 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14180
141812011-06-10 Chong Yidong <cyd@stupidchicken.com>
14182
14183 * image.c (gif_load): Fix omitted cast error introduced by
14184 2011-06-06 change.
14185
141862011-06-10 Martin Rudalics <rudalics@gmx.at>
14187
14188 * window.h (resize_proportionally, orig_total_lines)
14189 (orig_top_line): Remove from window structure.
14190 (set_window_height, set_window_width, change_window_heights)
14191 (Fdelete_window): Remove prototypes.
14192 (resize_frame_windows): Remove duplicate declaration.
14193
141942011-06-10 Eli Zaretskii <eliz@gnu.org>
14195
14196 * window.h (resize_frame_windows, resize_window_check)
14197 (delete_deletable_window, resize_root_window)
14198 (resize_frame_windows): Declare prototypes.
14199
14200 * window.c (resize_window_apply): Make definition be "static" to
14201 match the prototype.
14202
142032011-06-10 Martin Rudalics <rudalics@gmx.at>
14204
14205 * window.c: Remove declarations of Qwindow_size_fixed,
14206 window_min_size_1, window_min_size_2, window_min_size,
14207 size_window, window_fixed_size_p, enlarge_window, delete_window.
14208 Remove static from declaration of Qdelete_window, it's
14209 temporarily needed by Fbury_buffer.
14210 (replace_window): Don't assign orig_top_line and
14211 orig_total_lines.
14212 (Fdelete_window, delete_window): Remove. Window deletion is
14213 handled by window.el.
14214 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14215 Replace Fdelete_window calls with calls to Qdelete_window.
14216 (Fdelete_other_windows): Remove. Deleting other windows is
14217 handled by window.el.
14218 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14219 handled in window.el.
14220 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14221 Window minimum sizes are handled in window.el.
14222 (shrink_windows, size_window, set_window_height)
14223 (set_window_width, change_window_heights, window_height)
14224 (window_width, CURBEG, CURSIZE, enlarge_window)
14225 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14226 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14227 handled in window.el.
14228 (make_dummy_parent): Rename to make_parent_window and give it a
14229 second argument horflag.
14230 (make_window): Don't set resize_proportionally any more.
14231 (Fsplit_window): Remove. Windows are split in window.el.
14232 (save_restore_action, save_restore_orig_size)
14233 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14234 Resize mini windows in window.el.
14235 (grow_mini_window, shrink_mini_window): Implement by calling
14236 Qresize_root_window_vertically, resize_window_check and
14237 resize_window_apply.
14238 (saved_window, Fset_window_configuration, save_window_save):
14239 Do not handle orig_top_line, orig_total_lines, and
14240 resize_proportionally.
14241 (window_min_height, window_min_width): Move to window.el.
14242 (keys_of_window): Move bindings for delete-other-windows,
14243 split-window, delete-window and enlarge-window to window.el.
14244
14245 * buffer.c: Temporarily extern Qdelete_window.
14246 (Fbury_buffer): Temporarily call Qdelete_window instead of
14247 Fdelete_window (Fbury_buffer will move to window.el soon).
14248
14249 * frame.c (set_menu_bar_lines_1): Remove code handling
14250 orig_top_line and orig_total_lines.
14251
14252 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14253 set_window_height but set heights directly.
14254 (change_frame_size_1): Use resize_frame_windows.
14255
14256 * xdisp.c (init_xdisp): Don't use set_window_height but set
14257 heights directly.
14258
14259 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14260 Use resize_frame_windows instead of change_window_heights and run
14261 run_window_configuration_change_hook.
14262
14263 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14264 instead of change_window_heights and run
14265 run_window_configuration_change_hook.
14266
142672011-06-09 Martin Rudalics <rudalics@gmx.at>
14268
14269 * window.c (replace_window): Rename second argument REPLACEMENT to
14270 NEW. New third argument SETFLAG. Rewrite.
14271 (delete_window, make_dummy_parent): Call replace_window with
14272 third argument 1.
14273 (window_list_1): Move down in code.
14274 (run_window_configuration_change_hook): Move set_buffer part
14275 before select_frame_norecord part in order to unwind correctly.
14276 Rename count1 to count.
14277 (recombine_windows, delete_deletable_window, resize_root_window)
14278 (Fdelete_other_windows_internal)
14279 (Frun_window_configuration_change_hook, make_parent_window)
14280 (resize_window_check, resize_window_apply, Fresize_window_apply)
14281 (resize_frame_windows, Fsplit_window_internal)
14282 (Fdelete_window_internal, Fresize_mini_window_internal):
14283 New functions.
14284 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14285
142862011-06-08 Martin Rudalics <rudalics@gmx.at>
14287
14288 * window.h (window): Add some new members to window structure -
14289 normal_lines, normal_cols, new_total, new_normal, clone_number,
14290 splits, nest, prev_buffers, next_buffers.
14291 (WINDOW_TOTAL_SIZE): Move here from window.c.
14292 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14293
14294 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14295 Remove.
14296 (make_dummy_parent): Set new members of windows structure.
14297 (make_window): Move down in code. Handle new members of window
14298 structure.
14299 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14300 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14301 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14302 (Fset_window_prev_buffers, Fwindow_next_buffers)
14303 (Fset_window_next_buffers, Fset_window_clone_number):
14304 New functions.
14305 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14306 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14307 Doc-string fixes.
14308 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14309 Argument WINDOW can be now internal window too.
14310 (Fwindow_use_time): Move up in code.
14311 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14312 Rewrite doc-string.
14313 (Fset_window_configuration, saved_window)
14314 (Fcurrent_window_configuration, save_window_save): Handle new
14315 members of window structure.
14316 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14317 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14318 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14319 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14320 Qget_mru_window, Qresize_root_window,
14321 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14322 Qauto_buffer_name; staticpro them.
14323
143242011-06-07 Martin Rudalics <rudalics@gmx.at>
14325
14326 * window.c (Fwindow_total_size, Fwindow_left_column)
14327 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14328 (Fwindow_list_1): New functions.
14329 (window_box_text_cols): Replace with window_body_cols.
14330 (Fwindow_width, Fscroll_left, Fscroll_right):
14331 Use window_body_cols instead of window_box_text_cols.
14332 (delete_window, Fset_window_configuration):
14333 Call delete_all_subwindows with window as argument.
14334 (delete_all_subwindows): Take a window as argument and not a
14335 structure. Rewrite.
14336 (window_loop): Remove handling of GET_LRU_WINDOW and
14337 GET_LARGEST_WINDOW.
14338 (Fget_lru_window, Fget_largest_window): Move to window.el.
14339
14340 * window.h: Extern window_body_cols instead of
14341 window_box_text_cols. delete_all_subwindows now takes a
14342 Lisp_Object as argument.
14343
14344 * indent.c (compute_motion, Fcompute_motion):
14345 Use window_body_cols instead of window_box_text_cols.
14346
14347 * frame.c (delete_frame): Call delete_all_subwindows with root
14348 window as argument.
14349
143502011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14351
14352 * fns.c (Fputhash): Document return value.
14353
143542011-06-06 Chong Yidong <cyd@stupidchicken.com>
14355
14356 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14357
143582011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14359
14360 Cons<->int and similar integer overflow fixes (Bug#8794).
14361
14362 Check for overflow when converting integer to cons and back.
14363 * charset.c (Fdefine_charset_internal, Fdecode_char):
14364 Use cons_to_unsigned to catch overflow.
14365 (Fencode_char): Use INTEGER_TO_CONS.
14366 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14367 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14368 * data.c (long_to_cons, cons_to_long): Remove.
14369 (cons_to_unsigned, cons_to_signed): New functions.
14370 These signal an error for invalid or out-of-range values.
14371 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14372 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14373 * font.c (Ffont_variation_glyphs):
14374 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14375 * lisp.h: Include <intprops.h>.
14376 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14377 (cons_to_signed, cons_to_unsigned): New decls.
14378 (long_to_cons, cons_to_long): Remove decls.
14379 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14380 (Fprimitive_undo): Use CONS_TO_INTEGER.
14381 * xfns.c (Fx_window_property): Likewise.
14382 * xselect.c: Include <limits.h>.
14383 (x_own_selection, selection_data_to_lisp_data):
14384 Use INTEGER_TO_CONS.
14385 (x_handle_selection_request, x_handle_selection_clear)
14386 (x_get_foreign_selection, Fx_disown_selection_internal)
14387 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14388 (lisp_data_to_selection_data): Use cons_to_unsigned.
14389 (x_fill_property_data): Use cons_to_signed.
14390 Report values out of range.
14391
14392 Check for buffer and string overflow more precisely.
14393 * buffer.h (BUF_BYTES_MAX): New macro.
14394 * lisp.h (STRING_BYTES_MAX): New macro.
14395 * alloc.c (Fmake_string):
14396 * character.c (string_escape_byte8):
14397 * coding.c (coding_alloc_by_realloc):
14398 * doprnt.c (doprnt):
14399 * editfns.c (Fformat):
14400 * eval.c (verror):
14401 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14402 since they may not be the same number.
14403 * editfns.c (Finsert_char):
14404 * fileio.c (Finsert_file_contents):
14405 Likewise for BUF_BYTES_MAX.
14406
14407 * image.c: Use ptrdiff_t, not int, for sizes.
14408 (slurp_file): Switch from int to ptrdiff_t.
14409 All uses changed.
14410 (slurp_file): Check that file size fits in both size_t (for
14411 malloc) and ptrdiff_t (for sanity and safety).
14412
14413 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14414 if b->modtime has its maximal value.
14415
14416 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14417
14418 Don't assume time_t can fit into int.
14419 * buffer.h (struct buffer.modtime): Now time_t, not int.
14420 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14421 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14422
14423 Minor fixes for signed vs unsigned integers.
14424 * character.h (MAYBE_UNIFY_CHAR):
14425 * charset.c (maybe_unify_char):
14426 * keyboard.c (read_char, reorder_modifiers):
14427 XINT -> XFASTINT, since the integer must be nonnegative.
14428 * ftfont.c (ftfont_spec_pattern):
14429 * keymap.c (access_keymap, silly_event_symbol_error):
14430 XUINT -> XFASTINT, since the integer must be nonnegative.
14431 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14432 since it makes no difference and we prefer signed.
14433 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14434 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14435 nonnegative.
14436
144372011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14438
14439 * window.h (Fwindow_frame): Declare.
14440
144412011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14442
14443 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14444 (SPARE_MEMORY): Always define.
14445 (LARGE_REQUEST): Remove.
14446 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14447
144482011-06-06 Martin Rudalics <rudalics@gmx.at>
14449
14450 * lisp.h: Move EXFUNS for Fframe_root_window,
14451 Fframe_first_window and Fset_frame_selected_window to window.h.
14452
14453 * window.h: Move EXFUNS for Fframe_root_window,
14454 Fframe_first_window and Fset_frame_selected_window here from
14455 lisp.h.
14456
14457 * frame.c (Fwindow_frame, Fframe_first_window)
14458 (Fframe_root_window, Fframe_selected_window)
14459 (Fset_frame_selected_window): Move to window.c.
14460 (Factive_minibuffer_window): Move to minibuf.c.
14461 (Fother_visible_frames_p): New function.
14462
14463 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14464
14465 * window.c (decode_window, decode_any_window): Move up in code.
14466 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14467 (inhibit_frame_unsplittable): Remove unused variable.
14468 (Fwindow_buffer): Move up and rewrite doc-string.
14469 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14470 (Fwindow_prev): New functions.
14471 (Fwindow_frame): Move here from frame.c. Accept any window as
14472 argument.
14473 (Fframe_root_window, Fframe_first_window)
14474 (Fframe_selected_window): Move here from frame.c. Accept frame
14475 or arbitrary window as argument. Update doc-strings.
14476 (Fminibuffer_window): Move up in code.
14477 (Fwindow_minibuffer_p): Move up in code and simplify.
14478 (Fset_frame_selected_window): Move here from frame.c.
14479 Marginal rewrite.
14480 (Fselected_window, select_window, Fselect_window): Move up in
14481 code. Minor doc-string fixes.
14482
144832011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14484
14485 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14486 Do not assume that spare memory exists; that assumption is valid
14487 only if SYSTEM_MALLOC.
14488 (LARGE_REQUEST): New macro, so that the issue of large requests
14489 is separated from the issue of spare memory.
14490
144912011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14492
14493 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14494 format. (Bug#8806)
14495
14496 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14497
14498 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14499 before statements.
14500
145012011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14502
14503 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14504
14505 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14506
14507 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14508 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14509
145102011-06-05 Juanma Barranquero <lekktu@gmail.com>
14511
14512 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14513
145142011-06-04 Chong Yidong <cyd@stupidchicken.com>
14515
14516 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14517 (x_clipboard_manager_save): Add return value.
14518 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14519 New error handlers.
14520 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14521 Obey Vx_select_enable_clipboard_manager. Catch errors in
14522 x_clipboard_manager_save (Bug#8779).
14523 (Vx_select_enable_clipboard_manager): New variable.
14524 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14525
145262011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
14527
14528 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14529
145302011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14531
14532 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14533 in the current matrix if keep_current_p is non-zero.
14534
145352011-06-04 Eli Zaretskii <eliz@gnu.org>
14536
14537 * bidi.c (bidi_level_of_next_char): Fix last change.
14538
145392011-06-03 Eli Zaretskii <eliz@gnu.org>
14540
14541 Support bidi reordering of text covered by display properties.
14542
14543 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14544 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14545 (bidi_cache_search, bidi_cache_iterator_state)
14546 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14547 (bidi_level_of_next_char, bidi_move_to_visually_next):
14548 Support character positions inside a run of characters covered by a
14549 display string.
14550 (bidi_paragraph_init, bidi_resolve_explicit_1)
14551 (bidi_level_of_next_char): Call bidi_fetch_char and
14552 bidi_fetch_char_advance instead of FETCH_CHAR and
14553 FETCH_CHAR_ADVANCE.
14554 (bidi_init_it): Initialize new members.
14555 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14556 definitions.
14557 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14558 instead of using explicit *_CHAR codes.
14559 (bidi_resolve_explicit, bidi_resolve_weak):
14560 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14561 bidirectional text is supported only in multibyte buffers.
14562 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14563 it to initialize the frame_window_p member of struct bidi_it.
14564 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14565 (bidi_resolve_explicit, bidi_resolve_weak)
14566 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14567 bidi_it->nchars is non-positive.
14568 (bidi_level_of_next_char): Don't try to lookup the cache for the
14569 next/previous character if nothing is cached there yet, or if we
14570 were just reseat()'ed to a new position.
14571
14572 * xdisp.c (set_cursor_from_row): Set start and stop points
14573 according to the row's direction when priming the loop that looks
14574 for the glyph on which to display cursor.
14575 (single_display_spec_intangible_p): Function deleted.
14576 (display_prop_intangible_p): Reimplement to call
14577 handle_display_spec instead of single_display_spec_intangible_p.
14578 Accept 3 additional arguments needed by handle_display_spec.
14579 This fixes incorrect cursor motion across display property with complex
14580 values: lists, `(when COND...)' forms, etc.
14581 (single_display_spec_string_p): Support property values that are
14582 lists with the argument STRING its top-level element.
14583 (display_prop_string_p): Fix the condition for processing a
14584 property that is a list to be consistent with handle_display_spec.
14585 (handle_display_spec): New function, refactored from the
14586 last portion of handle_display_prop.
14587 (compute_display_string_pos): Accept additional argument
14588 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14589 value of a `display' property is a "replacing spec".
14590 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14591 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14592 the display property, but just return a value indicating whether
14593 the display property will replace the characters it covers.
14594 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14595 frame_window_p members of struct bidi_it.
14596 (compute_display_string_pos, compute_display_string_end):
14597 New functions.
14598 (push_it): Accept second argument POSITION, where pop_it should
14599 jump to continue iteration.
14600 (reseat_1): Initialize bidi_it.disp_pos.
14601
14602 * keyboard.c (adjust_point_for_property): Adjust the call to
14603 display_prop_intangible_p to its new signature.
14604
14605 * dispextern.h (struct bidi_it): New member frame_window_p.
14606 (bidi_init_it): Update prototypes.
14607 (display_prop_intangible_p): Update prototype.
14608 (compute_display_string_pos, compute_display_string_end):
14609 Declare prototypes.
14610 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14611 EMACS_INT.
14612
146132011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14614
14615 Malloc failure behavior now depends on size of allocation.
14616 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14617 * lisp.h: Change signatures accordingly.
14618 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14619 All callers changed. (Bug#8762)
14620
14621 * gnutls.c: Use Emacs's memory allocators.
14622 Without this change, the gnutls library would invoke malloc etc.
14623 directly, which causes problems on non-SYNC_INPUT hosts, and which
14624 runs afoul of improving memory_full behavior. (Bug#8761)
14625 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14626 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14627 xfree instead of the default malloc, realloc, free.
14628 (Fgnutls_boot): No need to check for memory allocation failure,
14629 since xmalloc does that for us.
14630
14631 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14632 * category.c (hash_get_category_set):
14633 * ccl.c (ccl_driver):
14634 * charset.c (Fdefine_charset_internal):
14635 * charset.h (struct charset.hash_index):
14636 * composite.c (get_composition_id, gstring_lookup_cache)
14637 (composition_gstring_put_cache):
14638 * composite.h (struct composition.hash_index):
14639 * dispextern.h (struct image.hash):
14640 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14641 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14642 (hashfn_equal, hashfn_user_defined, make_hash_table)
14643 (maybe_resize_hash_table, hash_lookup, hash_put)
14644 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14645 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14646 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14647 * image.c (make_image, search_image_cache, lookup_image)
14648 (xpm_put_color_table_h):
14649 * lisp.h (struct Lisp_Hash_Table):
14650 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14651 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14652 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14653 * alloc.c (allocate_vectorlike):
14654 Check for overflow in vector size calculations.
14655 * ccl.c (ccl_driver):
14656 Check for overflow when converting EMACS_INT to int.
14657 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14658 need to be updated by these changes.
14659 * fns.c (make_hash_table, maybe_resize_hash_table):
14660 Check for integer overflow with large hash tables.
14661 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14662 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14663 (SXHASH_REDUCE): New macro.
14664 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14665 Use it instead of discarding useful hash info with large hash values.
14666 (sxhash_float): New function.
14667 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14668 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14669 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14670 Rewrite to use FIXNUM_BITS, as this simplifies things.
14671 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14672 Adjust signatures to match updated version of code.
14673 (consing_since_gc): Now EMACS_INT, since a single hash table can
14674 use more than INT_MAX bytes.
14675
146762011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14677
14678 Make it possible to build with GCC-4.6+ -O2 -flto.
14679
14680 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14681
146822011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14683
14684 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14685 Call minibuffer-inactive-mode.
14686
146872011-05-31 Juanma Barranquero <lekktu@gmail.com>
14688
14689 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14690 Update dependencies.
14691
146922011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14693
14694 * data.c (init_data): Remove code for UTS, this system is not
14695 supported anymore.
14696
146972011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14698
14699 Don't force ./temacs to start in terminal mode.
14700
14701 * frame.c (make_initial_frame): Initialize faces in all cases, not
14702 only when CANNOT_DUMP is defined.
14703 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14704
147052011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14706
14707 * dispnew.c (add_window_display_history): Use const for the string
14708 pointer. Remove declaration, not needed.
14709
147102011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14711
14712 Use 'inline', not 'INLINE'.
14713 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14714 * alloc.c, fontset.c (INLINE): Remove.
14715 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14716 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14717 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14718 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14719 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14720
147212011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14722
14723 Make it possible to run ./temacs.
14724
14725 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14726 syms_of_callproc does the same thing. Remove test for
14727 "initialized", do it in the caller.
14728 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14729
147302011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14731
14732 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14733 (read_minibuf): Use get_minibuffer.
14734 (syms_of_minibuf): Use DEFSYM.
14735 (Qmetadata): New var.
14736 * data.c (Qbuffer): Don't make it static.
14737 (syms_of_data): Use DEFSYM.
14738
147392011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14740
14741 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14742 (CCL_CODE_MIN): New macro.
14743
147442011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14745
14746 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14747
14748 * eval.c (Qdebug): Now static.
14749 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14750 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14751 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14752
147532011-05-29 Chong Yidong <cyd@stupidchicken.com>
14754
14755 * image.c: Various fixes to ImageMagick code comments.
14756 (Fimagemagick_types): Doc fix.
14757
147582011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14759
14760 Minor fixes prompted by GCC 4.6.0 warnings.
14761
14762 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14763
14764 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14765 (x_clipboard_manager_save_all): Move extern decl to ...
14766 * xterm.h: ... here, so that it can be checked for consistency.
14767
147682011-05-29 Chong Yidong <cyd@stupidchicken.com>
14769
14770 * xselect.c (x_clipboard_manager_save_frame)
14771 (x_clipboard_manager_save_all): New functions.
14772 (Fx_clipboard_manager_save): Lisp function deleted.
14773
14774 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14775 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14776
14777 * xterm.h: Update prototype.
14778
147792011-05-28 William Xu <william.xwl@gmail.com>
14780
14781 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14782 exiting (Bug#8239).
14783
147842011-05-28 Jim Meyering <meyering@redhat.com>
14785
14786 Avoid a sign-extension bug in crypto_hash_function.
14787 * fns.c (to_uchar): Define.
14788 (crypto_hash_function): Use it to convert some newly-signed
14789 variables to unsigned, to avoid sign-extension bugs. For example,
14790 without this change, (md5 "truc") would evaluate to
14791 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14792 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14793 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14794
147952011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14796
14797 Integer overflow fixes.
14798
14799 * dbusbind.c: Serial number integer overflow fixes.
14800 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14801 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14802 to hold a serial number that is too large for a fixnum.
14803 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14804 Check for serial numbers out of range. Decode any serial number
14805 that was so large that it became a float. (Bug#8722)
14806
14807 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14808 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14809 Use XFASTINT rather than XUINT when numbers are nonnegative.
14810 (xd_append_arg, Fdbus_method_return_internal):
14811 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14812 arguments, check that Lisp number is nonnegative, rather than
14813 silently wrapping negative numbers around. (Bug#8722)
14814 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14815 (Bug#8722)
14816
14817 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14818
14819 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14820
14821 ccl: Add integer overflow checks.
14822 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14823 (IN_INT_RANGE): New macros.
14824 (ccl_driver): Use them to check for integer overflow when
14825 decoding a CCL program. Many of the new checks are whether XINT (x)
14826 fits in int; it doesn't always, on 64-bit hosts. The new version
14827 doesn't catch all possible integer overflows, but it's an
14828 improvement. (Bug#8719)
14829
14830 * alloc.c (make_event_array): Use XINT, not XUINT.
14831 There's no need for unsigned here.
14832
14833 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14834 This follows up to the 2011-05-06 change that substituted uintptr_t
14835 for EMACS_INT. This case wasn't caught back then.
14836
14837 Rework Fformat to avoid integer overflow issues.
14838 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14839 now (part of C89). Include <verify.h>.
14840 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14841 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14842 (Fformat): Avoid the prepass trying to compute sizes; it was only
14843 approximate and thus did not catch overflow reliably. Instead, walk
14844 through the format just once, formatting and computing sizes as we go,
14845 checking for integer overflow at every step, and allocating a larger
14846 buffer as needed. Keep track separately whether the format is
14847 multibyte. Keep only the most-recently calculated precision, rather
14848 than them all. Record whether each argument has been converted to
14849 string. Use EMACS_INT, not int, for byte and char and arg counts.
14850 Support field widths and precisions larger than INT_MAX. Avoid
14851 sprintf's undefined behavior with conversion specifications such as %#d
14852 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14853 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14854 formatting out-of-range floating point numbers with int
14855 formats. (Bug#8668)
14856
14857 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14858
14859 * data.c: Avoid integer truncation in expressions involving floats.
14860 * data.c: Include <intprops.h>.
14861 (arith_driver): When there's an integer overflow in an expression
14862 involving floating point, convert the integers to floating point
14863 so that the resulting value does not suffer from catastrophic
14864 integer truncation. For example, on a 64-bit host (* 4
14865 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14866 Do not rely on undefined behavior after integer overflow.
14867
14868 merge count_size_as_multibyte, parse_str_to_multibyte
14869 * character.c, character.h (count_size_as_multibyte):
14870 Rename from parse_str_to_multibyte; all uses changed.
14871 Check for integer overflow.
14872 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14873 since it's now a duplicate of the other. This is more of
14874 a character than a buffer op, so better that it's in character.c.
14875 * fns.c, print.c: Adjust to above changes.
14876
148772011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14878
14879 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14880
148812011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14882
14883 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14884 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14885 (x_clipboard_manager_save): Now static.
14886 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14887
14888 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14889 (crypto_hash_function): Now static.
14890 Fix pointer signedness problems. Avoid unnecessary initializations.
14891
148922011-05-27 Chong Yidong <cyd@stupidchicken.com>
14893
14894 * termhooks.h (Vselection_alist): Make it terminal-local.
14895
14896 * terminal.c (create_terminal): Initialize it.
14897
14898 * xselect.c: Support for clipboard managers.
14899 (Vselection_alist): Move to termhooks.h as terminal-local var.
14900 (LOCAL_SELECTION): New macro.
14901 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14902 (symbol_to_x_atom): Remove gratuitous arg.
14903 (x_handle_selection_request, lisp_data_to_selection_data)
14904 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14905 (x_own_selection, x_get_local_selection, x_convert_selection):
14906 New arg, specifying work frame. Use terminal-local Vselection_alist.
14907 (some_frame_on_display): Delete unused function.
14908 (Fx_own_selection_internal, Fx_get_selection_internal)
14909 (Fx_disown_selection_internal, Fx_selection_owner_p)
14910 (Fx_selection_exists_p): New optional frame arg.
14911 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14912 (x_handle_selection_clear): Don't treat other terminals with the
14913 same keyboard specially. Use the terminal-local Vselection_alist.
14914 (x_clear_frame_selections): Use Frun_hook_with_args.
14915
14916 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14917
14918 * xterm.h: Add support for those atoms.
14919
149202011-05-26 Chong Yidong <cyd@stupidchicken.com>
14921
14922 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14923 (converted_selections, conversion_fail_tag): New global variables.
14924 (x_selection_request_lisp_error): Free the above.
14925 (x_get_local_selection): Remove unnecessary code.
14926 (x_reply_selection_request): Args changed; handle arbitrary array
14927 of converted selections stored in converted_selections.
14928 Separate the XChangeProperty and SelectionNotify steps.
14929 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14930 (x_convert_selection): New function.
14931 (x_handle_selection_event): Simplify.
14932 (x_get_foreign_selection): Don't ignore incoming requests while
14933 waiting for an answer; this will fail when we implement
14934 SAVE_TARGETS, and seems unnecessary anyway.
14935 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14936 (Vx_sent_selection_functions): Doc fix.
14937
149382011-05-26 Leo Liu <sdl.web@gmail.com>
14939
14940 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14941
149422011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14943
14944 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14945
14946 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14947 for fringe update if it has periodic bitmap.
14948 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14949 and fringe_bitmap_periodic_p.
14950
14951 * fringe.c (get_fringe_bitmap_data): New function.
14952 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14953 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14954 row. Mark glyph row for fringe update if periodicity changed.
14955
14956 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14957 for fringe update unless it has periodic bitmap.
14958
149592011-05-25 Kenichi Handa <handa@m17n.org>
14960
14961 * xdisp.c (get_next_display_element): Set correct it->face_id for
14962 a static composition.
14963
149642011-05-24 Leo Liu <sdl.web@gmail.com>
14965
14966 * deps.mk (fns.o):
14967 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14968
14969 * fns.c (crypto_hash_function, Fsha1): New function.
14970 (Fmd5): Use crypto_hash_function.
14971 (syms_of_fns): Add Ssha1.
14972
149732011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14974
14975 * gnutls.c: Remove unused macros.
14976 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14977 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14978 Remove macros that are defined and never used.
14979 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14980
149812011-05-22 Chong Yidong <cyd@stupidchicken.com>
14982
14983 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14984 (Fx_get_selection_internal): Minor cleanup.
14985 (Fx_own_selection_internal): Rename arguments for consistency with
14986 select.el.
14987
149882011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14989
14990 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14991
149922011-05-22 Chong Yidong <cyd@stupidchicken.com>
14993
14994 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14995
149962011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14997
14998 * dispnew.c (scrolling_window): Don't exclude the case that the
14999 last enabled row in the desired matrix touches the bottom boundary.
15000
150012011-05-21 Glenn Morris <rgm@gnu.org>
15002
15003 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15004 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15005 and add some more files.
15006
150072011-05-20 Eli Zaretskii <eliz@gnu.org>
15008
15009 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15010 report_file_error introduced by the change from 2011-05-07.
15011
150122011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15013
15014 * systime.h (Time): Define only if emacs is defined.
15015 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15016 where the include path doesn't have X11/X.h by default. See
15017 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15018
150192011-05-20 Kenichi Handa <handa@m17n.org>
15020
15021 * composite.c (find_automatic_composition): Fix previous change.
15022
150232011-05-20 Glenn Morris <rgm@gnu.org>
15024
15025 * lisp.mk: New file, split from Makefile.in.
15026 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15027 (shortlisp): Remove.
15028 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15029
150302011-05-19 Glenn Morris <rgm@gnu.org>
15031
15032 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15033 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15034 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15035 (lisp): Set the order to that of loadup.el.
15036 (shortlisp): Make it a copy of $lisp.
15037 (SOME_MACHINE_LISP): Remove.
15038 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15039 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15040
150412011-05-18 Kenichi Handa <handa@m17n.org>
15042
15043 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15044 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15045 (find_automatic_composition): Mostly rewrite for efficiency.
15046
150472011-05-18 Juanma Barranquero <lekktu@gmail.com>
15048
15049 * makefile.w32-in: Update dependencies.
15050
150512011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15052
15053 * menu.c: Include limits.h (fixes the MS-Windows build broken by
15054 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15055
150562011-05-18 Paul Eggert <eggert@cs.ucla.edu>
15057
15058 Fix some integer overflow issues, such as string length overflow.
15059
15060 * insdel.c (count_size_as_multibyte): Check for string overflow.
15061
15062 * character.c (lisp_string_width): Check for string overflow.
15063 Use EMACS_INT, not int, for string indexes and lengths; in
15064 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15065 the resulting string length overflows an EMACS_INT; instead,
15066 report a string overflow if no precision given. When checking for
15067 precision exhaustion, use a check that cannot possibly have
15068 integer overflow. (Bug#8675)
15069 * character.h (lisp_string_width): Adjust to new signature.
15070
15071 * alloc.c (string_overflow): New function.
15072 (Fmake_string): Use it. This doesn't change behavior, but saves
15073 a few bytes and will simplify future changes.
15074 * character.c (string_escape_byte8): Likewise.
15075 * lisp.h (string_overflow): New decl.
15076
15077 Fixups, following up to the user-interface timestamp change.
15078 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15079 for UI timestamps, instead of unsigned long.
15080 * msdos.c (mouse_get_pos): Likewise.
15081 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15082 * w32gui.h (Time): Define by including "systime.h" rather than by
15083 declaring it ourselves. (Bug#8664)
15084
15085 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15086 * image.c (clear_image_cache): Likewise.
15087
15088 * term.c (term_mouse_position): Don't assume time_t wraparound.
15089
15090 Be more systematic about user-interface timestamps.
15091 Before, the code sometimes used 'Time', sometimes 'unsigned long',
15092 and sometimes 'EMACS_UINT', to represent these timestamps.
15093 This change causes it to use 'Time' uniformly, as that's what X uses.
15094 This makes the code easier to follow, and makes it easier to catch
15095 integer overflow bugs such as Bug#8664.
15096 * frame.c (Fmouse_position, Fmouse_pixel_position):
15097 Use Time, not unsigned long, for user-interface timestamps.
15098 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15099 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15100 * keyboard.h (last_event_timestamp): Likewise.
15101 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15102 * menu.h (xmenu_show): Likewise.
15103 * term.c (term_mouse_position): Likewise.
15104 * termhooks.h (struct input_event.timestamp): Likewise.
15105 (struct terminal.mouse_position_hook): Likewise.
15106 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15107 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15108 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15109 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15110 what it was before.
15111 * menu.h, termhooks.h: Include "systime.h", for Time.
15112
15113 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15114 Don't assume that the difference between two unsigned long values
15115 can fit into an integer. At this point, we know button_down_time
15116 <= event->timestamp, so the difference must be nonnegative, so
15117 there's no need to cast the result if double-click-time is
15118 nonnegative, as it should be; check that it's nonnegative, just in
15119 case. This bug is triggered when events are more than 2**31 ms
15120 apart (about 25 days). (Bug#8664)
15121
15122 * xselect.c (last_event_timestamp): Remove duplicate decl.
15123 (x_own_selection): Remove needless cast to unsigned long.
15124
15125 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15126 that always fit in int. Use a sentinel instead of a counter, to
15127 avoid a temp and to allay GCC's concerns about possible int overflow.
15128 * frame.h (struct frame): Use int for menu_bar_items_used
15129 instead of EMACS_INT, since it always fits in int.
15130
15131 * menu.c (grow_menu_items): Check for int overflow.
15132
15133 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15134
15135 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15136 Before, the code was not consistent. These values cannot exceed
15137 2**31 - 1 so there's no need to make them unsigned.
15138 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15139 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15140 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15141 as modifiers.
15142 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15143
15144 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15145 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15146 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15147 presumably because the widths might not match.
15148
15149 * window.c (size_window): Avoid needless test at loop start.
15150
151512011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15152
15153 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15154
151552011-05-12 Drew Adams <drew.adams@oracle.com>
15156
15157 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15158
151592011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15160
15161 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15162 `width' to `bar_area_x' and `bar_area_width', respectively.
15163 (x_scroll_run): Take account of fringe background extension.
15164
15165 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15166 Rename local vars `left' and `width' to `bar_area_x' and
15167 `bar_area_width', respectively.
15168 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15169 background extension.
15170
151712011-05-10 Jim Meyering <meyering@redhat.com>
15172
15173 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15174
151752011-05-10 Juanma Barranquero <lekktu@gmail.com>
15176
15177 * image.c (Finit_image_library): Return t for built-in image types,
15178 like pbm and xbm. (Bug#8640)
15179
151802011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15181
15182 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15183
151842011-05-07 Eli Zaretskii <eliz@gnu.org>
15185
15186 * w32console.c (Fset_screen_color): Doc fix.
15187 (Fget_screen_color): New function.
15188 (syms_of_ntterm): Defsubr it.
15189
15190 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15191 unlink the temporary file if Fcall_process didn't create it in the
15192 first place.
15193 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15194 child process will be redirected to a file specified with `:file'.
15195 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15196 cue to call_process_cleanup not to close that handle.
15197
151982011-05-07 Ben Key <bkey76@gmail.com>
15199
15200 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15201 one of two shell specific rules, either bootstrap-temacs-CMD or
15202 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15203 to the previous implementation of the bootstrap-temacs rule.
15204 The bootstrap-temacs-CMD rule is similar to the previous
15205 implementation of the bootstrap-temacs rule except that it
15206 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15207 variable.
15208
15209 These changes, along with some changes to nt/configure.bat,
15210 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15211 earlier fix to add support for --cflags and --ldflags options
15212 that include quotes so that it works whether make uses cmd or
15213 sh as the shell.
15214
152152011-05-06 Michael Albinus <michael.albinus@gmx.de>
15216
15217 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15218 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15219 is a constant.
15220 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15221 a string. Handle both cases.
15222 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15223 (Fdbus_register_method): Use Qinvalid_function.
15224
152252011-05-06 Juanma Barranquero <lekktu@gmail.com>
15226
15227 * makefile.w32-in: Update dependencies.
15228 (LISP_H): Add inttypes.h and stdin.h.
15229 (PROCESS_H): Add unistd.h.
15230
152312011-05-06 Eli Zaretskii <eliz@gnu.org>
15232
15233 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15234 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15235
152362011-05-06 Paul Eggert <eggert@cs.ucla.edu>
15237
15238 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15239
15240 * term.c (vfatal): Remove stray call to va_end.
15241 It's not needed and the C Standard doesn't allow it here anyway.
15242
15243 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15244 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15245
15246 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15247 bytes.
15248
15249 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15250
15251 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15252
15253 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15254
15255 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15256
15257 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15258
15259 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15260 * charset.c (Fdefine_charset_internal): Don't initialize
15261 charset.code_space[15]. The value was garbage, on hosts with
15262 32-bit int (Bug#8600).
15263
15264 * lread.c (read_integer): Be more consistent with string-to-number.
15265 Use string_to_number to do the actual conversion; this avoids
15266 rounding errors and fixes some other screwups. Without this fix,
15267 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15268 (digit_to_number): Move earlier, for benefit of read_integer.
15269 Return -1 if the digit is out of range for the base, -2 if it is
15270 not a digit in any supported base. (Bug#8602)
15271
15272 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15273
15274 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15275 to match comment at start of function. This also removes a
15276 GCC warning about overflow in a 32+64-bit port.
15277
15278 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15279
15280 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15281 Reported by Stefan Monnier in
15282 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15283 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15284 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15285
15286 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15287 (EMACS_UINTPTR): Likewise, with uintptr_t.
15288
15289 * lisp.h: Prefer 64-bit EMACS_INT if available.
15290 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15291 on 32-bit hosts that have 64-bit int, so that they can access
15292 large files.
15293 However, temporarily disable this change unless the temporary
15294 symbol WIDE_EMACS_INT is defined.
15295
15296 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15297
15298 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15299 This removes an assumption that EMACS_INT and long are the same
15300 width as pointers. The assumption is true for Emacs porting targets
15301 now, but we want to make other targets possible.
15302 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15303 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15304 In the rest of the code, change types of integers that hold casted
15305 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15306 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15307 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15308 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15309 No need to cast type when ORing.
15310 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15311 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15312 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15313 assume EMACS_INT is the same width as char *.
15314 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15315 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15316 Remove no-longer-needed casts.
15317 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15318 (xg_tool_bar_help_callback, xg_make_tool_item):
15319 Use EMACS_INTPTR to hold an integer
15320 that will be cast to void *; this can avoid a GCC warning
15321 if EMACS_INT is not the same width as void *.
15322 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15323 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15324 (current_message_1, set_message_1):
15325 Use a local to convert to proper width without a cast.
15326 * xmenu.c (dialog_selection_callback): Likewise.
15327
15328 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15329 Also, don't assume VALBITS / RAND_BITS is less than 5,
15330 and don't rely on undefined behavior when shifting a 1 left into
15331 the sign bit.
15332 * lisp.h (get_random): Change signature to match.
15333
15334 * lread.c (hash_string): Use size_t, not int, for hash computation.
15335 Normally we prefer signed values; but hashing is special, because
15336 it's better to use unsigned division on hash table sizes so that
15337 the remainder is nonnegative. Also, size_t is the natural width
15338 for hashing into memory. The previous code used 'int', which doesn't
15339 retain enough info to hash well into very large tables.
15340 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15341
15342 * dbusbind.c: Don't possibly lose pointer info when converting.
15343 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15344 Use XPNTR rather than XHASH, so that the high-order bits of
15345 the pointer aren't lost when converting through void *.
15346
15347 * eval.c (Fautoload): Don't double-shift a pointer.
15348
15349 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15350
153512011-05-06 Juanma Barranquero <lekktu@gmail.com>
15352
15353 * gnutls.c (DEF_GNUTLS_FN):
15354 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15355
153562011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15357
15358 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15359 marker. (Bug#8610)
15360
153612011-05-05 Eli Zaretskii <eliz@gnu.org>
15362
15363 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15364 New version that can reserve upto 2GB of heap space.
15365
153662011-05-05 Chong Yidong <cyd@stupidchicken.com>
15367
15368 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15369
153702011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15371
15372 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15373 `gnutls_certificate_set_x509_key_file'.
15374
153752011-05-05 Juanma Barranquero <lekktu@gmail.com>
15376
15377 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15378 Update dependencies.
15379
153802011-05-04 Juanma Barranquero <lekktu@gmail.com>
15381
15382 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15383 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15384 Remove unused parameter `fildes'.
15385 * process.c (read_process_output, send_process): Don't pass it.
15386
153872011-05-04 Juanma Barranquero <lekktu@gmail.com>
15388
15389 Fix previous change: the library cache is defined in w32.c.
15390 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15391 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15392
153932011-05-04 Juanma Barranquero <lekktu@gmail.com>
15394
15395 Implement dynamic loading of GnuTLS on Windows.
15396
15397 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15398 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15399 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15400 Declare.
15401
15402 * gnutls.c (Qgnutls_dll): Define.
15403 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15404 (gnutls_*): Declare function pointers.
15405 (init_gnutls_functions): New function to initialize function pointers.
15406 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15407 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15408 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15409 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15410 (emacs_gnutls_write, emacs_gnutls_read)
15411 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15412 (Fgnutls_available_p): New function.
15413 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15414 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15415 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15416
15417 * image.c: Include w32.h.
15418 (Vimage_type_cache): Delete.
15419 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15420 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15421 (w32_delayed_load): Move to w32.c.
15422
15423 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15424
15425 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15426 (w32_delayed_load): Move from image.c. When loading a library, record
15427 its filename in the :loaded-from property of the library id.
15428 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15429 Initialize and staticpro them.
15430 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15431
15432 * process.c: Include lisp.h before w32.h, not after.
15433 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15434 instead of gnutls_record_check_pending.
15435
15436 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15437
154382011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15439
15440 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15441 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15442 as passed in.
15443
154442011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15445
15446 * xterm.c (x_set_frame_alpha): Do not set property on anything
15447 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15448
154492011-05-02 Juanma Barranquero <lekktu@gmail.com>
15450
15451 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15452
154532011-05-02 Juanma Barranquero <lekktu@gmail.com>
15454
15455 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15456 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15457 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15458 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15459 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15460 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15461 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15462 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15463 (Qgnutls_bootprop_callbacks_verify): Make static.
15464
154652011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15466
15467 * callproc.c: Indentation fixup.
15468
15469 * sysdep.c (wait_for_termination_1): Make static.
15470 (wait_for_termination, interruptible_wait_for_termination):
15471 Move after wait_for_termination_1.
15472
154732011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15474
15475 * sysdep.c (interruptible_wait_for_termination): New function
15476 which is like wait_for_termination, but allows keyboard
15477 interruptions.
15478
15479 * callproc.c (Fcall_process): Add (:file "file") as an option for
15480 the STDOUT buffer.
15481 (Fcall_process_region): Ditto.
15482
154832011-04-30 Eli Zaretskii <eliz@gnu.org>
15484
15485 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15486 rather than `XVECTOR (FOO)->size'.
15487
15488 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15489 inttypes.h, as a gnulib replacement is used if it not available in
15490 system headers.
15491
154922011-04-21 Eli Zaretskii <eliz@gnu.org>
15493
15494 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15495 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15496 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15497
15498 * coding.c (coding_alloc_by_realloc): Error out if destination
15499 will grow beyond MOST_POSITIVE_FIXNUM.
15500 (decode_coding_emacs_mule): Abort if there isn't enough place in
15501 charbuf for the composition carryover bytes. Reserve an extra
15502 space for up to 2 characters produced in a loop.
15503 (decode_coding_iso_2022): Abort if there isn't enough place in
15504 charbuf for the composition carryover bytes.
15505
155062011-04-21 Eli Zaretskii <eliz@gnu.org>
15507
15508 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15509 aborting when %lld or %lll format is passed.
15510 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15511 %llo or %llx format is passed. (Bug#8545)
15512
15513 * window.c (window_scroll_line_based): Use a marker instead of
15514 simple variables to record original value of point. (Bug#7952)
15515
15516 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15517 produced by %s or %c overflows available buffer space. (Bug#8545)
15518
155192011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15520
15521 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15522 (SIZE_MAX): Move defn after all includes, as they might #define it.
15523
155242011-04-28 Juanma Barranquero <lekktu@gmail.com>
15525
15526 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15527
155282011-04-28 Juanma Barranquero <lekktu@gmail.com>
15529
15530 * keyboard.c (Qdelayed_warnings_hook): Define.
15531 (command_loop_1): Run `delayed-warnings-hook'
15532 if Vdelayed_warnings_list is non-nil.
15533 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15534 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15535
155362011-04-28 Eli Zaretskii <eliz@gnu.org>
15537
15538 * doprnt.c (doprnt): Don't return value smaller than the buffer
15539 size if the message was truncated. (Bug#8545).
15540
155412011-04-28 Juanma Barranquero <lekktu@gmail.com>
15542
15543 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15544 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15545
155462011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15547
15548 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15549
155502011-04-27 Juanma Barranquero <lekktu@gmail.com>
15551
15552 * makefile.w32-in: Update dependencies.
15553
155542011-04-27 Eli Zaretskii <eliz@gnu.org>
15555
15556 Improve `doprnt' and its usage. (Bug#8545)
15557 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15558 `format_end'. Remove support for %l as a conversion specifier.
15559 Don't use xrealloc. Improve diagnostics when the %l size modifier
15560 is used. Update the commentary.
15561
15562 * eval.c (verror): Simplify calculation of size_t.
15563
15564 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15565 messages.
15566
155672011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15568
15569 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15570 change.
15571
155722011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15573
15574 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15575 This makes this file independent of the recent pseudovector change.
15576
155772011-04-26 Paul Eggert <eggert@cs.ucla.edu>
15578
15579 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15580
15581 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15582 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15583 Remove unused local.
15584 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15585
15586 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
15587 GCC 4.6.0 optimizes based on type-based alias analysis.
15588 For example, if b is of type struct buffer * and v of type struct
15589 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15590 != &v->size, and therefore "v->size = 1; b->size = 2; return
15591 v->size;" must therefore return 1. This assumption is incorrect
15592 for Emacs, since it type-puns struct Lisp_Vector * with many other
15593 types. To fix this problem, this patch adds a new type struct
15594 vectorlike_header that documents the constraints on layout of vectors
15595 and pseudovectors, and helps optimizing compilers not get fooled
15596 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15597 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15598 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15599 the size member.
15600 (XSETPVECTYPE): Rewrite in terms of new macro.
15601 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15602 This is a bit clearer, and further avoids the possibility of
15603 undesirable aliasing.
15604 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15605 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15606 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15607 since Lisp_Subr is a special case (no "next" field).
15608 (ASIZE): Now uses header.size rather than size.
15609 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15610 to avoid the hassle of writing XVECTOR (foo)->header.size.
15611 (struct vectorlike_header): New type.
15612 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15613 object, to help avoid aliasing.
15614 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15615 (SUBRP): Likewise, since Lisp_Subr is a special case.
15616 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15617 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15618 (struct Lisp_Hash_Table): Combine first two members into a single
15619 struct vectorlike_header member. All uses of "size" and "next" members
15620 changed to be "header.size" and "header.next".
15621 * buffer.h (struct buffer): Likewise.
15622 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15623 * frame.h (struct frame): Likewise.
15624 * process.h (struct Lisp_Process): Likewise.
15625 * termhooks.h (struct terminal): Likewise.
15626 * window.c (struct save_window_data, struct saved_window): Likewise.
15627 * window.h (struct window): Likewise.
15628 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15629 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15630 * buffer.c (init_buffer_once): Likewise.
15631 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15632 special case.
15633 * process.c (Fformat_network_address): Use local var for size,
15634 for brevity.
15635
15636 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15637
15638 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15639 * data.c (atof): Remove decl; no longer used or needed.
15640 (digit_to_number): Move to lread.c.
15641 (Fstring_to_number): Use new string_to_number function, to be
15642 consistent with how the Lisp reader treats infinities and NaNs.
15643 Do not assume that floating-point numbers represent EMACS_INT
15644 without losing information; this is not true on most 64-bit hosts.
15645 Avoid double-rounding errors, by insisting on integers when
15646 parsing non-base-10 numbers, as the documentation specifies.
15647 * lisp.h (string_to_number): New decl, replacing ...
15648 (isfloat_string): Remove.
15649 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15650 (read1): Do not accept +. and -. as integers; this
15651 appears to have been a coding error. Similarly, do not accept
15652 strings like +-1e0 as floating point numbers. Do not report
15653 overflow for integer overflows unless the base is not 10 which
15654 means we have no simple and reliable way to continue.
15655 Break out the floating-point parsing into a new
15656 function string_to_number, so that Fstring_to_number parses
15657 floating point numbers consistently with the Lisp reader.
15658 (digit_to_number): Move here from data.c. Make it static inline.
15659 (E_CHAR, EXP_INT): Remove, replacing with ...
15660 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15661 (string_to_number): New function, replacing isfloat_string.
15662 This function checks for valid syntax and produces the resulting
15663 Lisp float number too. Rework it so that string-to-number
15664 no longer mishandles examples like "1.0e+". Use strtoumax,
15665 so that overflow for non-base-10 numbers is reported only when
15666 there's no portable and simple way to convert to floating point.
15667
15668 * textprop.c (set_text_properties_1): Rewrite for clarity,
15669 and to avoid GCC warning about integer overflow.
15670
15671 * intervals.h (struct interval): Use EMACS_INT for members
15672 where EMACS_UINT might cause problems. See
15673 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15674 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15675 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15676 All uses changed.
15677 (offset_intervals): Tell GCC not to worry about length overflow
15678 when negating a negative length.
15679
15680 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15681 (overrun_check_free): Likewise.
15682
15683 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15684 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15685 word size.
15686
15687 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15688 (gnutls_make_error): Rename local to avoid shadowing.
15689 (gnutls_emacs_global_deinit): ifdef out; not used.
15690 (Fgnutls_boot): Use const for pointer to readonly storage.
15691 Comment out unused local. Fix pointer signedness problems.
15692
15693 * lread.c (openp): Don't stuff size_t into an 'int'.
15694 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15695 about possible signed overflow.
15696
15697 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15698 (GDK_KEY_g): Don't define if already defined.
15699 (xg_prepare_tooltip): Avoid pointer signedness problem.
15700 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15701
15702 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15703 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15704
15705 * xfns.c (Fx_window_property): Simplify a bit,
15706 to make a bit faster and to avoid GCC 4.6.0 warning.
15707 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15708
15709 * fns.c (internal_equal): Don't assume size_t fits in int.
15710
15711 * alloc.c (compact_small_strings): Tighten assertion a little.
15712
15713 Replace pEd with more-general pI, and fix some printf arg casts.
15714 * lisp.h (pI): New macro, generalizing old pEd macro to other
15715 conversion specifiers. For example, use "...%"pI"d..." rather
15716 than "...%"pEd"...".
15717 (pEd): Remove. All uses replaced with similar uses of pI.
15718 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15719 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15720 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15721 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15722 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15723 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15724 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15725 64-bit hosts.
15726 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15727 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15728 * print.c (safe_debug_print, print_object): Likewise.
15729 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15730 to int.
15731 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15732 avoiding the 0 flag, which is not portable.
15733 * process.c (Fmake_network_process): Use pI to avoid cast.
15734 * region-cache.c (pp_cache): Likewise.
15735 * xdisp.c (decode_mode_spec): Likewise.
15736 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15737 behavior on 64-bit hosts with printf arg.
15738 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15739 (x_stop_queuing_selection_requests): Likewise.
15740 (x_get_window_property): Don't truncate byte count to an 'int'
15741 when tracing.
15742
15743 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15744 here, since it parses constructs like leading '-' and spaces,
15745 which are not wanted; and it overflows with large numbers.
15746 Instead, simply match F[0-9]+, which is what is wanted anyway.
15747
15748 * alloc.c: Remove unportable assumptions about struct layout.
15749 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15750 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15751 (allocate_vectorlike, make_pure_vector): Use the new macros,
15752 plus offsetof, to remove unportable assumptions about struct layout.
15753 These assumptions hold on all porting targets that I know of, but
15754 they are not guaranteed, they're easy to remove, and removing them
15755 makes further changes easier.
15756
15757 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15758 This doesn't fix a bug but makes the code clearer.
15759 (string_overrun_cookie): Now const. Use initializers that
15760 don't formally overflow signed char, to avoid warnings.
15761 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15762 can cause Emacs to crash when string overrun checking is enabled.
15763 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15764 multiple of sizeof (EMACS_INT); it need not be, if
15765 alignof(EMACS_INT) < sizeof (EMACS_INT).
15766 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15767
157682011-04-26 Juanma Barranquero <lekktu@gmail.com>
15769
15770 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15771
157722011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15773
15774 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15775 supposed to be handshaking. (Bug#8556)
15776 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15777
157782011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15779
15780 * lisp.h (Qdebug): List symbol.
15781 * eval.c (Qdebug): Restore global linkage.
15782 * keyboard.c (debug-on-event): New variable.
15783 (handle_user_signal): Break into debugger when debug-on-event
15784 matches the current signal symbol.
15785
157862011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15787
15788 * alloc.c (check_sblock, check_string_bytes)
15789 (check_string_free_list): Convert to standard C.
15790
157912011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15792
15793 * w32.c (emacs_gnutls_push): Fix typo.
15794
157952011-04-25 Eli Zaretskii <eliz@gnu.org>
15796
15797 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15798 "cast to pointer from integer of different size".
15799
15800 Improve doprnt and its use in verror. (Bug#8545)
15801 * doprnt.c (doprnt): Document the set of format control sequences
15802 supported by the function. Use SAFE_ALLOCA instead of always
15803 using `alloca'.
15804
15805 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15806 is one byte too soon. Don't use xrealloc; instead xfree and
15807 xmalloc anew.
15808
158092011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15810
15811 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15812 callbacks stage.
15813
15814 * gnutls.c: Renamed global_initialized to
15815 gnutls_global_initialized. Added internals for the
15816 :verify-hostname-error, :verify-error, and :verify-flags
15817 parameters of `gnutls-boot' and documented those parameters in the
15818 docstring. Start callback support.
15819 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15820 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15821 on error. Return error code.
15822 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15823 (emacs_gnutls_read): Likewise.
15824 (Fgnutls_boot): Return handshake error code.
15825 (emacs_gnutls_handle_error): New function.
15826 (wsaerror_to_errno): Likewise.
15827
15828 * w32.h (emacs_gnutls_pull): Add prototype.
15829 (emacs_gnutls_push): Likewise.
15830
15831 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15832 (emacs_gnutls_push): Likewise.
15833
158342011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15835
15836 * process.c (wait_reading_process_output): Check if GnuTLS
15837 buffered some data internally if no FDs are set for TLS
15838 connections.
15839
15840 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15841 (LIBS): Link to USER_LIBS.
15842 ($(BLD)/gnutls.$(0)): New target.
15843
158442011-04-24 Eli Zaretskii <eliz@gnu.org>
15845
15846 * xdisp.c (handle_single_display_spec): Rename the
15847 display_replaced_before_p argument into display_replaced_p, to
15848 make it consistent with the commentary. Fix typos in the
15849 commentary.
15850
15851 * textprop.c (syms_of_textprop): Remove dead code.
15852 (copy_text_properties): Delete obsolete commentary about an
15853 interface that was deleted long ago. Fix typos in the description
15854 of arguments.
15855
15856 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15857 to changes in oldXMenu/XMenu.h from 2011-04-16.
15858 <menu_help_message, prev_menu_help_message>: Constify.
15859 (IT_menu_make_room): menu->help_text is now `const char **';
15860 adjust.
15861
15862 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15863 to changes in oldXMenu/XMenu.h from 2011-04-16.
15864 (struct XMenu): Declare `help_text' `const char **'.
15865
15866 * xfaces.c <Qunspecified>: Make extern again.
15867
15868 * syntax.c: Include sys/types.h before including regex.h, as
15869 required by POSIX.
15870
15871 * doc.c (get_doc_string): Improve the format passed to `error'.
15872
15873 * doprnt.c (doprnt): Improve commentary.
15874
15875 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15876
15877 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15878 them with etags.
15879
15880 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15881 changes in globals.h immediately force recompilation.
15882 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15883 $(CURDIR)/s/ms-w32.h.
15884 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15885
15886 * character.c (Fchar_direction): Function deleted.
15887 (syms_of_character): Don't defsubr it.
15888 <char-direction-table>: Deleted.
15889
158902011-04-23 Eli Zaretskii <eliz@gnu.org>
15891
15892 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15893 * doprnt.c: Include limits.h.
15894 (SIZE_MAX): New macro.
15895 (doprnt): Return a size_t value. 2nd arg is now size_t.
15896 Many local variables are now size_t instead of int or unsigned.
15897 Improve overflow protection. Support `l' modifier for integer
15898 conversions. Support %l conversion. Don't assume an EMACS_INT
15899 argument for integer conversions and for %c.
15900
15901 * lisp.h (doprnt): Restore prototype.
15902
15903 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15904 $(SRC)/character.h.
15905
15906 * Makefile.in (base_obj): Add back doprnt.o.
15907
15908 * deps.mk (doprnt.o): Add back prerequisites.
15909 (callint.o): Depend on character.h.
15910
15911 * eval.c (internal_lisp_condition_case): Include the handler
15912 representation in the error message.
15913 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15914 when breaking from the loop.
15915
15916 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15917
15918 * callint.c (Fcall_interactively): When displaying error message
15919 about invalid control letter, pass the character's codepoint, not
15920 a pointer to its multibyte form. Improve display of the character
15921 in octal and display also its hex code.
15922
15923 * character.c (char_string): Use %x to display the (unsigned)
15924 codepoint of an invalid character, to avoid displaying a bogus
15925 negative value.
15926
15927 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15928 `error', not SYMBOL_NAME itself.
15929
15930 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15931 character arguments to `error'.
15932
15933 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15934 to `error' in error message about FINAL_CHAR argument. Make sure
15935 FINAL_CHAR is a character, and use %c when it is passed as
15936 argument to `error'.
15937
159382011-04-23 Eli Zaretskii <eliz@gnu.org>
15939
15940 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15941
15942 * w32.c: Include <time.h>.
15943 (sys_localtime): New function.
15944
159452011-04-23 Chong Yidong <cyd@stupidchicken.com>
15946
15947 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15948
15949 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15950
159512011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15952
15953 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15954 zombies (Bug#8467).
15955
159562011-04-19 Eli Zaretskii <eliz@gnu.org>
15957
15958 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15959 gl_state.e_property when gl_state.object is Qt.
15960
15961 * insdel.c (make_gap_larger): Remove limitation of buffer size
15962 to <= INT_MAX.
15963
159642011-04-18 Chong Yidong <cyd@stupidchicken.com>
15965
15966 * xdisp.c (lookup_glyphless_char_display)
15967 (produce_glyphless_glyph): Handle cons cell entry in
15968 glyphless-char-display.
15969 (Vglyphless_char_display): Document it.
15970
15971 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15972 glyphless-char-display.
15973
159742011-04-17 Chong Yidong <cyd@stupidchicken.com>
15975
15976 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15977
15978 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15979
15980 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15981 definition for no-X builds.
15982
159832011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15984
15985 Static checks with GCC 4.6.0 and non-default toolkits.
15986
15987 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15988
15989 * process.c (keyboard_bit_set): Define only if SIGIO.
15990 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15991 (send_process): Repair possible setjmp clobbering.
15992
15993 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15994
15995 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15996
15997 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15998
15999 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16000 Define only if needed.
16001
16002 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16003 by pacifying GCC about it. Maybe it's time to retire it?
16004 * xfaces.c (USG, __TIMEVAL__): Likewise.
16005
16006 * dispextern.h (struct redisplay_interface): Rename param
16007 to avoid shadowing.
16008 * termhooks.h (struct terminal): Likewise.
16009 * xterm.c (xembed_send_message): Likewise.
16010
16011 * insdel.c (make_gap_smaller): Define only if
16012 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16013
16014 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16015 it.
16016
16017 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16018 so that we aren't warned about unused symbols.
16019
16020 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16021
16022 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16023
16024 * xfns.c (x_real_positions): Mark locals as initialized.
16025
16026 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16027
16028 * xterm.c: Fix problems found by static analysis with other toolkits.
16029 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16030 (x_dispatch_event): Declare static if USE_GTK, and
16031 define if USE_GTK || USE_X_TOOLKIT.
16032 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16033 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16034 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16035 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16036
16037 * xmenu.c (menu_help_callback): Pointer type fixes.
16038 Use const pointers when pointing at readonly data. Avoid pointer
16039 signedness clashes.
16040 (FALSE): Remove unused macro.
16041 (update_frame_menubar): Remove unused decl.
16042
16043 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16044
16045 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16046 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16047 (single_menu_item): Rename local to avoid shadowing.
16048
16049 * keyboard.c (make_lispy_event): Remove unused local var.
16050
16051 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16052 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16053
16054 * bitmaps: Change bitmaps from unsigned char back to the X11
16055 compatible char. Avoid the old compiler warnings about
16056 out-of-range initializers by using, for example, '\xab' rather
16057 than 0xab.
16058
16059 * xgselect.c (xgselect_initialize): Check vs interface
16060 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16061
16062 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16063
16064 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16065 to read-only memory.
16066
16067 * fns.c (vector): Remove; this old hack is no longer needed.
16068
16069 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16070 Remove unused var.
16071 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16072
16073 * xrdb.c (x_load_resources): Omit unused local.
16074
16075 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16076 (x_window): Rename locals to avoid shadowing.
16077 (USG): Use the kludged USG macro, to pacify gcc.
16078
16079 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16080 (x_term_init): Remove local to avoid shadowing.
16081
16082 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16083
16084 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16085 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16086
160872011-04-16 Eli Zaretskii <eliz@gnu.org>
16088
16089 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16090
16091 Fix regex.c, syntax.c and friends for buffers > 2GB.
16092 * syntax.h (struct gl_state_s): Declare character position members
16093 EMACS_INT.
16094
16095 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16096
16097 * textprop.c (verify_interval_modification, interval_of):
16098 Declare arguments EMACS_INT.
16099
16100 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16101 EMACS_INT.
16102
16103 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16104
16105 * indent.c (Fvertical_motion): Local variable it_start is now
16106 EMACS_INT.
16107
16108 * regex.c (re_match, re_match_2, re_match_2_internal)
16109 (bcmp_translate, regcomp, regexec, print_double_string)
16110 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16111 (re_compile_pattern, re_exec): Declare arguments and local
16112 variables `size_t' and `ssize_t' and return values `regoff_t', as
16113 appropriate.
16114 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16115 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16116 <compile_stack_type>: `size' and `avail' are now `size_t'.
16117
16118 * regex.h <regoff_t>: Use ssize_t, not int.
16119 (re_search, re_search_2, re_match, re_match_2): Arguments that
16120 specify buffer/string position and length are now ssize_t and
16121 size_t. Return type is regoff_t.
16122
161232011-04-16 Ben Key <bkey76@gmail.com>
16124
16125 * nsfont.m: Fixed bugs in ns_get_family and
16126 ns_descriptor_to_entity that were caused by using free to
16127 deallocate memory blocks that were allocated by xmalloc (via
16128 xstrdup). This caused Emacs to crash when compiled with
16129 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16130 --enable-checking=xmallocoverrun). xfree is now used to
16131 deallocate these memory blocks.
16132
161332011-04-15 Paul Eggert <eggert@cs.ucla.edu>
16134
16135 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16136
16137 emacs_write: Accept and return EMACS_INT for sizes.
16138 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16139 et seq.
16140 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16141 Accept and return EMACS_INT.
16142 (emacs_gnutls_write): Return the number of bytes written on
16143 partial writes.
16144 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16145 (emacs_read, emacs_write): Remove check for negative size, as the
16146 Emacs source code has been audited now.
16147 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16148 (emacs_read, emacs_write): Use it.
16149 * process.c (send_process): Adjust to the new signatures of
16150 emacs_write and emacs_gnutls_write. Do not attempt to store
16151 a byte offset into an 'int'; it might overflow.
16152 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16153
16154 * sound.c: Don't assume sizes fit in 'int'.
16155 (struct sound_device.period_size, alsa_period_size):
16156 Return EMACS_INT, not int.
16157 (struct sound_device.write, vox_write, alsa_write):
16158 Accept EMACS_INT, not int.
16159 (wav_play, au_play): Use EMACS_INT to store sizes and to
16160 record read return values.
16161
161622011-04-15 Ben Key <bkey76@gmail.com>
16163
16164 * keyboard.c (Qundefined): Don't declare static since it is used
16165 in nsfns.m.
16166 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16167 static since they are used in nsfont.m.
16168
161692011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16170
16171 * process.c (Qprocessp): Don't declare static.
16172 * lisp.h (Qprocessp): Declare again.
16173
161742011-04-15 Juanma Barranquero <lekktu@gmail.com>
16175
16176 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16177
161782011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16179
16180 Improve C-level modularity by making more things 'static'.
16181
16182 Don't publish debugger-only interfaces to other modules.
16183 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16184 (verify_bytepos, count_markers): Move decls to the only modules
16185 that need them.
16186 * region-cache.h (pp_cache): Likewise.
16187 * window.h (check_all_windows): Likewise.
16188 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16189
16190 * sysdep.c (croak): Now static, if
16191 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16192 * syssignal.h (croak): Declare only if not static.
16193
16194 * alloc.c (refill_memory_reserve): Now static if
16195 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16196 * lisp.h (refill_memory_reserve): Declare only if not static.
16197
16198 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16199 Define only if USE_LUCID.
16200
16201 * xrdb.c (x_customization_string, x_rm_string): Now static.
16202
16203 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16204 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16205
16206 * xdisp.c (draw_row_with_mouse_face): Now static.
16207 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16208
16209 * window.h (check_all_windows): Mark externally visible.
16210
16211 * window.c (window_deletion_count): Now static.
16212
16213 * undo.c: Make symbols static if they're not exported.
16214 (last_undo_buffer, last_boundary_position, pending_boundary):
16215 Now static.
16216
16217 * textprop.c (interval_insert_behind_hooks): Now static.
16218 (interval_insert_in_front_hooks): Likewise.
16219
16220 * term.c: Make symbols static if they're not exported.
16221 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16222 (max_frame_lines, tty_set_terminal_modes):
16223 (tty_reset_terminal_modes, tty_turn_off_highlight):
16224 (get_tty_terminal): Now static.
16225 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16226 * termhooks.h (term_mouse_moveto): Do not declare if
16227 HAVE_WINDOW_SYSTEM.
16228 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16229 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16230
16231 * sysdep.c: Make symbols static if they're not exported.
16232 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16233 Now static.
16234 (sigprocmask_set, full_mask): Remove; unused.
16235 (wait_debugging): Mark as visible.
16236 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16237 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16238
16239 * syntax.c (syntax_temp): Define only if !__GNUC__.
16240
16241 * sound.c (current_sound_device, current_sound): Now static.
16242
16243 * search.c (searchbufs, searchbuf_head): Now static.
16244
16245 * scroll.c (scroll_cost): Remove; unused.
16246 * dispextern.h (scroll_cost): Remove decl.
16247
16248 * region-cache.h (pp_cache): Mark as externally visible.
16249
16250 * process.c: Make symbols static if they're not exported.
16251 (process_tick, update_tick, create_process, chan_process):
16252 (Vprocess_alist, proc_buffered_char, datagram_access):
16253 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16254 (deactivate_process): Mark defn as static, as well as decl.
16255 * lisp.h (create_process): Remove decl.
16256 * process.h (chan_process, Vprocess_alist): Remove decls.
16257
16258 * print.c: Make symbols static if they're not exported.
16259 (print_depth, new_backquote_output, being_printed, print_buffer):
16260 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16261 (print_interval, print_number_index, initial_stderr_stream):
16262 Now static.
16263 * lisp.h (Fprinc): Remove decl.
16264 (debug_output_compilation_hack): Mark as externally visible.
16265
16266 * sysdep.c (croak): Move decl from here to syssignal.h.
16267 * syssignal.h (croak): Put it here, so the API can be checked when
16268 'croak' is called from dissociate_if_controlling_tty.
16269
16270 * minibuf.c: Make symbols static if they're not exported.
16271 (minibuf_save_list, choose_minibuf_frame): Now static.
16272 * lisp.h (choose_minibuf_frame): Remove decl.
16273
16274 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16275
16276 * lread.c: Make symbols static if they're not exported.
16277 (read_objects, initial_obarray, oblookup_last_bucket_number):
16278 Now static.
16279 (make_symbol): Remove; unused.
16280 * lisp.h (initial_obarray, make_symbol): Remove decls.
16281
16282 * keyboard.c: Make symbols static if they're not exported.
16283 (single_kboard, recent_keys_index, total_keys, recent_keys):
16284 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16285 (this_single_command_key_start, echoing, last_auto_save):
16286 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16287 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16288 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16289 (Vlispy_mouse_stem, double_click_count):
16290 Now static.
16291 (force_auto_save_soon): Define only if SIGDANGER.
16292 (ignore_mouse_drag_p): Now static if
16293 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16294 (print_help): Remove; unused.
16295 (stop_character, last_timer_event): Mark as externally visible.
16296 * keyboard.h (ignore_mouse_drag_p): Declare only if
16297 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16298 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16299 * lisp.h (echoing): Remove decl.
16300 (force_auto_save_soon): Declare only if SIGDANGER.
16301 * xdisp.c (redisplay_window): Simplify code, to make it more
16302 obvious that ignore_mouse_drag_p is not accessed if !defined
16303 USE_GTK && !defined HAVE_NS.
16304
16305 * intervals.c: Make symbols static if they're not exported.
16306 (merge_properties_sticky, merge_interval_right, delete_interval):
16307 Now static.
16308 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16309
16310 * insdel.c: Make symbols static if they're not exported.
16311 However, leave prepare_to_modify_buffer alone. It's never
16312 called from outside this function, but that appears to be a bug.
16313 (combine_after_change_list, combine_after_change_buffer):
16314 (adjust_after_replace, signal_before_change): Now static.
16315 (adjust_after_replace_noundo): Remove; unused.
16316 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16317 (signal_before_change): Remove decls.
16318
16319 * indent.c (val_compute_motion, val_vmotion): Now static.
16320
16321 * image.c: Make symbols static if they're not exported.
16322 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16323 if USE_GTK.
16324 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16325 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16326
16327 * fringe.c (standard_bitmaps): Now static.
16328 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16329
16330 * frame.c: Make symbols static if they're not exported.
16331 (x_report_frame_params, make_terminal_frame): Now static.
16332 (get_frame_param): Now static, unless HAVE_NS.
16333 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16334 (x_get_resource_string): Remove; not used.
16335 * frame.h (make_terminal_frame, x_report_frame_params):
16336 (x_get_resource_string); Remove decls.
16337 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16338 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16339
16340 * font.c, fontset.c: Make symbols static if they're not exported.
16341 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16342 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16343 * font.c (font_close_object): Now static.
16344 * font.h (font_close_object): Remove.
16345 * fontset.c (FONTSET_OBJLIST): Remove.
16346 (free_realized_fontset) #if-0 the body, which does nothing.
16347 (face_suitable_for_char_p): #if-0, as it's never called.
16348 * fontset.h (face_suitable_for_char_p): Remove decl.
16349 * xfaces.c (face_at_string_position):
16350 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16351 since 0 is always ASCII.
16352
16353 * fns.c (weak_hash_tables): Now static.
16354
16355 * fileio.c: Make symbols static if they're not exported.
16356 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16357 (Vwrite_region_annotation_buffers): Now static.
16358
16359 * eval.c: Make symbols static if they're not exported.
16360 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16361 * lisp.h (backtrace_list): Remove decl.
16362
16363 * emacs.c: Make symbols static if they're not exported.
16364 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16365 (fatal_error_code, fatal_error_signal_hook, standard_args):
16366 Now static.
16367 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16368 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16369 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16370 * lisp.h (fatal_error_signal_hook): Remove decl.
16371 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16372
16373 * editfns.c: Move a (normally-unused) function to its only use.
16374 * editfns.c, lisp.h (get_operating_system_release): Remove.
16375 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16376 worth the hassle of breaking this out.
16377
16378 * xterm.c: Make symbols static if they're not exported.
16379 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16380 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16381 (x_destroy_window, x_delete_display):
16382 Now static.
16383 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16384 (x_mouse_leave): Remove; unused.
16385 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16386 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16387 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16388 Remove decls.
16389 (x_mouse_leave): Declare only if WINDOWSNT.
16390 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16391 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16392 USE_X_TOOLKIT.
16393
16394 * ftxfont.c: Make symbols static if they're not exported.
16395 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16396 HAVE_FREETYPE.
16397 * font.h (ftxfont_driver): Likewise.
16398
16399 * xfns.c: Make symbols static if they're not exported.
16400 (x_last_font_name, x_display_info_for_name):
16401 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16402 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16403 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16404 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16405 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16406 (last_show_tip_args): Now static.
16407 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16408 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16409 (x_screen_planes): Remove; unused.
16410 * dispextern.h (x_screen_planes): Remove decl.
16411
16412 * dispnew.c: Make symbols static if they're not exported.
16413 * dispextern.h (redraw_garbaged_frames, scrolling):
16414 (increment_row_positions): Remove.
16415 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16416 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16417 Now static.
16418 (redraw_garbaged_frames): Remove; unused.
16419
16420 * xfaces.c: Make symbols static if they're not exported.
16421 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16422 Remove decls.
16423 * xterm.h (defined_color): Remove decls.
16424 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16425 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16426 (menu_face_changed_default, defined_color, free_realized_face):
16427 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16428 (ascii_face_of_lisp_face): Remove; unused.
16429
16430 * xdisp.c: Make symbols static if they're not exported.
16431 * dispextern.h (scratch_glyph_row, window_box_edges):
16432 (glyph_to_pixel_coords, set_cursor_from_row):
16433 (get_next_display_element, set_iterator_to_next):
16434 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16435 (show_mouse_face): Remove decls
16436 * frame.h (message_buf_print): Likewise.
16437 * lisp.h (pop_message, set_message, check_point_in_composition):
16438 Likewise.
16439 * xterm.h (set_vertical_scroll_bar): Likewise.
16440 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16441 (message_buf_print, scratch_glyph_row, displayed_buffer):
16442 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16443 (get_next_display_element, show_mouse_face, window_box_edges):
16444 (frame_to_window_pixel_xy, check_point_in_composition):
16445 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16446 (glyph_to_pixel_coords): Remove; unused.
16447
16448 * dired.c (file_name_completion): Now static.
16449
16450 * dbusbind.c (xd_in_read_queued_messages): Now static.
16451
16452 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16453 * data.c (circular_list_error): Remove.
16454
16455 * commands.h (last_point_position, last_point_position_buffer):
16456 (last_point_position_window): Remove decls.
16457 * keyboard.c: Make these variables static.
16458
16459 * coding.h (coding, code_convert_region, encode_coding_gap):
16460 Remove decls.
16461 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16462 (iso_code_class, detect_coding, code_convert_region): Now static.
16463 (encode_coding_gap): Remove; unused.
16464
16465 * chartab.c (chartab_chars, chartab_bits): Now static.
16466
16467 * charset.h (charset_iso_8859_1): Remove decl.
16468 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16469 Now static.
16470
16471 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16472 * ccl.c (Vccl_program_table): Now static.
16473 (check_ccl_update): Remove; unused.
16474
16475 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16476 * category.h: ... from here.
16477 * category.c (check_category_table, set_category_set): Now static.
16478
16479 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16480 * lisp.h: Remove these decls.
16481
16482 * buffer.c (buffer_count): Remove unused var.
16483
16484 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16485 so that it's not optimized away.
16486 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16487 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16488 exported only to the debugger.
16489
16490 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16491 * atimer.h (run_all_atimers): Remove; not exported.
16492
16493 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16494 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16495 was inaccessible from Lisp.
16496 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16497 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16498
16499 alloc.c: Import and export fewer symbols, and remove unused items.
16500 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16501 is defined.
16502 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16503 it's not optimized away by whole-program optimization.
16504 (message_enable_multibyte, free_misc): Remove.
16505 (catchlist, handlerlist, mark_backtrace):
16506 Declare only if BYTE_MARK_STACK.
16507 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16508 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16509 (message_enable_multibyte): Remove decl.
16510 (free_misc, interval_free_list, float_block, float_block_index):
16511 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16512 (cons_free_list, last_marked_index):
16513 Now static.
16514 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16515 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16516 (mark_backtrace): Define only if BYTE_MARK_STACK.
16517 * xdisp.c (message_enable_multibyte): Now static.
16518
16519 Declare Lisp_Object Q* variables to be 'static' if not exported.
16520 This makes it easier for human readers (and static analyzers)
16521 to see whether these variables are used from other modules.
16522 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16523 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16524 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16525 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16526 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16527 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16528 * xmenu.c, xselect.c:
16529 Declare Q* vars static if they are not used in other modules.
16530 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16531 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16532 Remove decls of unexported vars.
16533 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16534
16535 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16536
16537 Make Emacs functions such as Fatom 'static' by default.
16538 This makes it easier for human readers (and static analyzers)
16539 to see whether these functions can be called from other modules.
16540 DEFUN now defines a static function. To make the function external
16541 so that it can be used in other C modules, use the new macro DEFUE.
16542 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16543 (Finit_image_library):
16544 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16545 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16546 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16547 Remove decls, since these functions are now static.
16548 (Funintern, Fget_internal_run_time): New decls, since these functions
16549 were already external.
16550
16551 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16552 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16553 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16554 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16555 * keyboard.c, keymap.c, lread.c:
16556 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16557 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16558 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16559 Mark functions with DEFUE instead of DEFUN,
16560 if they are used in other modules.
16561 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16562 decls for now-static functions.
16563 * buffer.h (Fdelete_overlay): Remove decl.
16564 * callproc.c (Fgetenv_internal): Mark as internal.
16565 * composite.c (Fremove_list_of_text_properties): Remove decl.
16566 (Fcomposition_get_gstring): New forward static decl.
16567 * composite.h (Fcomposite_get_gstring): Remove decl.
16568 * dired.c (Ffile_attributes): New forward static decl.
16569 * doc.c (Fdocumntation_property): New forward static decl.
16570 * eval.c (Ffetch_bytecode): New forward static decl.
16571 (Funintern): Remove extern decl; now in .h file where it belongs.
16572 * fileio.c (Fmake_symbolic_link): New forward static decl.
16573 * image.c (Finit_image_library): New forward static decl.
16574 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16575 * intervals.h (Fprevious_property_change):
16576 (Fremove_list_of_text_properties): Remove decls.
16577 * keyboard.c (Fthis_command_keys): Remove decl.
16578 (Fcommand_execute): New forward static decl.
16579 * keymap.c (Flookup_key): New forward static decl.
16580 (Fcopy_keymap): Now static.
16581 * keymap.h (Flookup_key): Remove decl.
16582 * process.c (Fget_process): New forward static decl.
16583 (Fprocess_datagram_address): Mark as internal.
16584 * syntax.c (Fsyntax_table_p): New forward static decl.
16585 (skip_chars): Remove duplicate decl.
16586 * textprop.c (Fprevious_property_change): New forward static decl.
16587 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16588 Now internal.
16589 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16590 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16591
16592 * editfns.c (Fformat): Remove unreachable code.
16593
165942011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16595
16596 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16597 change. (Bug#8496)
16598
165992011-04-13 Eli Zaretskii <eliz@gnu.org>
16600
16601 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16602 when at ZV. (Bug#8487)
16603
166042011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16605
16606 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16607 (Bug#8437)
16608 * keyboard.c (parse_tool_bar_item): Likewise.
16609 * sound.c (sound_cleanup, alsa_close): Likewise.
16610 * termcap.c (tgetent): Likewise.
16611 * xfns.c (x_default_font_parameter): Likewise.
16612 * xsettings.c (read_and_apply_settings): Likewise.
16613
16614 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16615 (overrun_check_free): Protoize.
16616
166172011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16618
16619 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16620 since callers should never pass a negative size.
16621 Change the signature to match that of plain 'read' and 'write'; see
16622 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16623 * lisp.h: Update prototypes of emacs_write and emacs_read.
16624
166252011-04-11 Eli Zaretskii <eliz@gnu.org>
16626
16627 * xdisp.c (redisplay_window): Don't try to determine the character
16628 position of the scroll margin if the window start point w->startp
16629 is outside the buffer's accessible region. (Bug#8468)
16630
166312011-04-10 Eli Zaretskii <eliz@gnu.org>
16632
16633 Fix write-region and its subroutines for buffers > 2GB.
16634 * fileio.c (a_write, e_write): Modify declaration of arguments and
16635 local variables to support buffers larger than 2GB.
16636 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16637
16638 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16639 argument, local variables, and return value.
16640
16641 * lisp.h: Update prototypes of emacs_write and emacs_read.
16642
16643 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16644
166452011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16646
16647 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16648
16649 Fix more problems found by GCC 4.6.0's static checks.
16650
16651 * xdisp.c (vmessage): Use a better test for character truncation.
16652
16653 * charset.c (load_charset_map): <, not <=, for optimization,
16654 and to avoid potential problems with integer overflow.
16655 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16656 * casetab.c (set_identity, shuffle): Likewise.
16657 * editfns.c (Fformat): Likewise.
16658 * syntax.c (skip_chars): Likewise.
16659
16660 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16661 This also lets GCC 4.6.0 generate slightly better loop code.
16662
16663 * callint.c (Fcall_interactively): <, not <=, for optimization.
16664 (Fcall_interactively): Count the number of arguments produced,
16665 not the number of arguments given. This is simpler and lets GCC
16666 4.6.0 generate slightly better code.
16667
16668 * ftfont.c: Distingish more carefully between FcChar8 and char.
16669 The previous code passed unsigned char * to a functions like
16670 strlen and xstrcasecmp that expect char *, which does not
16671 conform to the C standard.
16672 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16673 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16674 char * when the C standard requires it.
16675
16676 * keyboard.c (read_char): Remove unused var.
16677
16678 * eval.c: Port to Windows vsnprintf (Bug#8435).
16679 Include <limits.h>.
16680 (SIZE_MAX): Define if the headers do not.
16681 (verror): Do not give up if vsnprintf returns a negative count.
16682 Instead, grow the buffer. This ports to Windows vsnprintf, which
16683 does not conform to C99. Problem reported by Eli Zaretskii.
16684 Also, simplify the allocation scheme, by avoiding the need for
16685 calling realloc, and removing the ALLOCATED variable.
16686
16687 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16688
16689 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16690 But keep the doprint source code for now, as we might revamp it
16691 and use it again (Bug#8435).
16692 * lisp.h (doprnt): Remove.
16693 * Makefile.in (base_obj): Remove doprnt.o.
16694 * deps.mk (doprnt.o): Remove.
16695
16696 error: Print 32- and 64-bit integers portably (Bug#8435).
16697 Without this change, on typical 64-bit hosts error ("...%d...", N)
16698 was used to print both 32- and 64-bit integers N, which relied on
16699 undefined behavior.
16700 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16701 * lisp.h (error, verror): Mark as printf-like functions.
16702 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16703 Report overflow in size calculations when allocating printf buffer.
16704 Do not truncate output string at its first null byte.
16705 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16706 Truncate the output at a character boundary, since vsnprintf does not
16707 do that.
16708 * charset.c (check_iso_charset_parameter): Convert internal
16709 character to string before calling 'error', since %c now has the
16710 printf meaning.
16711 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16712 overflow when computing char to be passed to 'error'. Do not
16713 pass Lisp_Object to 'error'; pass the integer instead.
16714 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16715 formatted with plain %d.
16716
16717 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16718
16719 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16720
16721 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16722
16723 * xterm.c (x_catch_errors): Remove duplicate declaration.
16724
16725 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16726
16727 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16728
167292011-04-10 Jim Meyering <meyering@redhat.com>
16730
16731 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16732 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16733 return ssize_t not "int", and use size_t as the buffer length.
16734 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16735 * gnutls.h: Update declarations.
16736 * process.c (read_process_output): Use ssize_t, to match.
16737 (send_process): Likewise.
16738
167392011-04-09 Chong Yidong <cyd@stupidchicken.com>
16740
16741 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16742
167432011-04-09 Chong Yidong <cyd@stupidchicken.com>
16744
16745 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16746 Use unsigned char, to match FcChar8 type definition.
16747
16748 * xterm.c (handle_one_xevent):
16749 * xmenu.c (create_and_show_popup_menu):
16750 * xselect.c (x_decline_selection_request)
16751 (x_reply_selection_request): Avoid type-punned deref of X events.
16752
167532011-04-09 Eli Zaretskii <eliz@gnu.org>
16754
16755 Fix some uses of `int' instead of EMACS_INT.
16756 * search.c (string_match_1, fast_string_match)
16757 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16758 (scan_buffer, find_next_newline_no_quit)
16759 (find_before_next_newline, search_command, Freplace_match)
16760 (Fmatch_data): Make some `int' variables be EMACS_INT.
16761
16762 * xdisp.c (display_count_lines): 3rd argument and return value now
16763 EMACS_INT. All callers changed.
16764 (pint2hrstr): Last argument is now EMACS_INT.
16765
16766 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16767 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16768 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16769 (decode_coding_utf_16, decode_coding_emacs_mule)
16770 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16771 (decode_coding_ccl, decode_coding_charset)
16772 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16773 (decode_coding_iso_2022, decode_coding_emacs_mule)
16774 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16775 <char_offset, last_offset>: Declare EMACS_INT.
16776 (encode_coding_utf_8, encode_coding_utf_16)
16777 (encode_coding_emacs_mule, encode_invocation_designation)
16778 (encode_designation_at_bol, encode_coding_iso_2022)
16779 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16780 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16781 Declare EMACS_INT.
16782 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16783 (encode_invocation_designation): Last argument P_NCHARS is now
16784 EMACS_INT.
16785 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16786 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16787
16788 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16789 All users changed.
16790
16791 * ccl.c (Fccl_execute_on_string): Declare some variables
16792 EMACS_INT.
16793
167942011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16795
16796 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16797
167982011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16799
16800 * process.c (Fformat_network_address): Doc fix.
16801
168022011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16803
16804 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16805
168062011-04-08 Chong Yidong <cyd@stupidchicken.com>
16807
16808 * keyboard.c (read_char): Call Lisp function help-form-show,
16809 instead of using internal_with_output_to_temp_buffer.
16810 (Qhelp_form_show): New var.
16811 (syms_of_keyboard): Use DEFSYM macro.
16812
16813 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16814
16815 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16816
168172011-04-06 Chong Yidong <cyd@stupidchicken.com>
16818
16819 * process.c (Flist_processes): Remove to Lisp.
16820 (list_processes_1): Delete.
16821
168222011-04-06 Eli Zaretskii <eliz@gnu.org>
16823
16824 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16825
16826 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16827
168282011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16829
16830 Fix more problems found by GCC 4.6.0's static checks.
16831
16832 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16833
16834 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16835
16836 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16837
16838 * xdisp.c (vmessage): Mark as a printf-like function.
16839
16840 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16841
16842 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16843
16844 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16845 printf-like functions.
16846 (tiff_load): Add casts to remove these marks before passing them
16847 to system-supplied API.
16848
16849 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16850
16851 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16852 This avoids several warnings with gcc -Wstrict-overflow.
16853 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16854 directly, rather than having caller test rule sign. This avoids
16855 some unnecessary tests.
16856 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16857 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16858 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16859
16860 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16861 (xfont_open): Avoid unnecessary tests.
16862
16863 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16864
16865 * composite.h, composite.c (composition_gstring_put_cache):
16866 Use EMACS_INT, not int, for length.
16867
16868 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16869 breaking out part of COMPOSITION_DECODE_RULE.
16870 (COMPOSITION_DECODE_RULE): Use it.
16871 * composite.c (get_composition_id): Remove unused local vars,
16872 by using the new macro.
16873
16874 * textprop.c (set_text_properties_1): Change while to do-while,
16875 since the condition is always true at first.
16876
16877 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16878 (interval_deletion_adjustment): Return unsigned value.
16879 All uses changed.
16880
16881 * process.c (list_processes_1, create_pty, read_process_output):
16882 (exec_sentinel): Remove vars that were set but not used.
16883 (create_pty): Remove unnecessary "volatile"s.
16884 (Fnetwork_interface_info): Avoid possibility of int overflow.
16885 (read_process_output): Do adaptive read buffering even if carryover.
16886 (read_process_output): Simplify nbytes computation if buffered.
16887
16888 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16889
16890 * syntax.c (scan_words): Remove var that was set but not used.
16891 (update_syntax_table): Use unsigned instead of int.
16892
16893 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16894 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16895 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16896
16897 * print.c (print_error_message): Avoid int overflow.
16898
16899 * font.c (font_list_entities): Redo for clarity,
16900 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16901
16902 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16903 (font_score): Avoid potential overflow in diff calculation.
16904
16905 * fns.c (substring_both): Remove var that is set but not used.
16906 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16907
16908 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16909
16910 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16911 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16912 can always succeed if overflow has undefined behavior.
16913
16914 * search.c (boyer_moore, wordify): Remove vars set but not used.
16915 (wordify): Omit three unnecessary tests.
16916
16917 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16918 All callers changed. This avoids the need for an unused var.
16919
16920 * casefiddle.c (casify_region): Remove var that is set but not used.
16921
16922 * dired.c (file_name_completion): Remove var that is set but not used.
16923
16924 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16925
16926 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16927 (Finsert_file_contents): Remove unnecessary code checking fd.
16928
16929 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16930 Check for integer overflow on size calculations.
16931
16932 * buffer.c (Fprevious_overlay_change): Remove var that is set
16933 but not used.
16934
16935 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16936 Remove vars that are set but not used.
16937 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16938 (timer_check_2): Mark vars as initialized.
16939
16940 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16941
16942 * image.c (lookup_image): Remove var that is set but not used.
16943 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16944
16945 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16946 that are set but not used.
16947
16948 * xfns.c (make_invisible_cursor): Don't return garbage
16949 if XCreateBitmapFromData fails (Bug#8410).
16950
16951 * xselect.c (x_get_local_selection, x_handle_property_notify):
16952 Remove vars that are set but not used.
16953
16954 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16955 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16956
16957 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16958 Remove var that is set but not used.
16959 (scroll_bar_windows_size): Now size_t, not int.
16960 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16961 Check for overflow.
16962
16963 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16964 (map_tty_color) [!defined MSDOS]: Likewise.
16965
16966 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16967
16968 * coding.c: Remove vars that are set but not used.
16969 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16970 All callers changed.
16971 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16972 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16973 (decode_coding_charset): Remove vars that are set but not used.
16974
16975 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16976 that is set but not used.
16977
16978 * print.c (print_object): Remove var that is set but not used.
16979
16980 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16981 The gnulib version avoids calling malloc in the usual case,
16982 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16983 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16984 * filelock.c (current_lock_owner): Likewise.
16985 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16986 * sysdep.c: Include allocator.h, careadlinkat.h.
16987 (emacs_no_realloc_allocator): New static constant.
16988 (emacs_readlink): New function.
16989 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16990 ../lib/careadlinkat.h.
16991
169922011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16993
16994 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16995 first non-nil return value).
16996
169972011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16998
16999 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17000 if not defined (Bug#8403).
17001
170022011-04-02 Juanma Barranquero <lekktu@gmail.com>
17003
17004 * xdisp.c (display_count_lines): Remove parameter `start',
17005 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17006 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17007 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17008 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17009 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17010 and thereabouts. All callers changed.
17011 (get_per_char_metric): Remove parameter `f', unused since
17012 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17013
170142011-04-02 Jim Meyering <meyering@redhat.com>
17015
17016 do not dereference NULL upon failed strdup
17017 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17018 (ns_get_family): Likewise.
17019
170202011-04-02 Juanma Barranquero <lekktu@gmail.com>
17021
17022 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17023
170242011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17025
17026 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17027 later (Bug#8403).
17028
170292011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17030
17031 Add lexical binding.
17032
17033 * window.c (Ftemp_output_buffer_show): New fun.
17034 (Fsave_window_excursion):
17035 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17036
17037 * lread.c (lisp_file_lexically_bound_p): New function.
17038 (Fload): Bind Qlexical_binding.
17039 (readevalloop): Remove `evalfun' arg.
17040 Bind Qinternal_interpreter_environment.
17041 (Feval_buffer): Bind Qlexical_binding.
17042 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17043 Mark as dynamic.
17044 (syms_of_lread): Declare `lexical-binding'.
17045
17046 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17047
17048 * keyboard.c (eval_dyn): New fun.
17049 (menu_item_eval_property): Use it.
17050
17051 * image.c (parse_image_spec): Use Ffunctionp.
17052
17053 * fns.c (concat, mapcar1): Accept byte-code-functions.
17054
17055 * eval.c (Fsetq): Handle lexical vars.
17056 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17057 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17058 (FletX, Flet): Obey lexical binding.
17059 (Fcommandp): Handle closures.
17060 (Feval): New `lexical' arg.
17061 (eval_sub): New function extracted from Feval. Use it almost
17062 everywhere where Feval was used. Look up vars in lexical env.
17063 Handle closures.
17064 (Ffunctionp): Move from subr.el.
17065 (Ffuncall): Handle closures.
17066 (apply_lambda): Remove `eval_flags'.
17067 (funcall_lambda): Handle closures and new byte-code-functions.
17068 (Fspecial_variable_p): New function.
17069 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17070 but without exporting it to Lisp.
17071
17072 * doc.c (Fdocumentation, store_function_docstring):
17073 * data.c (Finteractive_form): Handle closures.
17074
17075 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17076 interactive spec.
17077
17078 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17079 New byte-codes.
17080 (exec_byte_code): New function extracted from Fbyte_code to handle new
17081 calling convention for byte-code-functions. Add new byte-codes.
17082
17083 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17084
17085 * alloc.c (Fmake_symbol): Init new `declared_special' field.
17086
170872011-03-31 Juanma Barranquero <lekktu@gmail.com>
17088
17089 * xdisp.c (redisplay_internal): Fix prototype.
17090
170912011-03-31 Eli Zaretskii <eliz@gnu.org>
17092
17093 * xdisp.c (SCROLL_LIMIT): New macro.
17094 (try_scrolling): Use it when setting scroll_limit.
17095 Limit scrolling to 100 screen lines.
17096 (redisplay_window): Even when falling back on "recentering",
17097 position point in the window according to scroll-conservatively,
17098 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17099
17100 (try_scrolling): When point is above the window, allow searching
17101 as far as scroll_max, or one screenful, to compute vertical
17102 distance from PT to the scroll margin position. This prevents
17103 try_scrolling from unnecessarily failing when
17104 scroll-conservatively is set to a value slightly larger than the
17105 window height. Clean up the case of PT below the margin at bottom
17106 of window: scroll_max can no longer be INT_MAX. When aggressive
17107 scrolling is in use, don't let point enter the opposite scroll
17108 margin as result of the scroll.
17109 (syms_of_xdisp) <scroll-conservatively>: Document the
17110 threshold of 100 lines for never-recentering scrolling.
17111
171122011-03-31 Juanma Barranquero <lekktu@gmail.com>
17113
17114 * dispextern.h (move_it_by_lines):
17115 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17116 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17117 (message_log_check_duplicate): Remove parameters `prev_bol' and
17118 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17119 (redisplay_internal): Remove parameter `preserve_echo_area',
17120 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17121
17122 * indent.c (Fvertical_motion):
17123 * window.c (window_scroll_pixel_based, Frecenter):
17124 Don't pass `need_y_p' to `move_it_by_lines'.
17125
171262011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17127
17128 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17129 steal a few bits to be more compact.
17130 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17131 Remove unneeded casts.
17132
17133 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17134
171352011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17136
17137 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17138 binding" message (bug#7967).
17139
171402011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17141
17142 Fix more problems found by GCC 4.6.0's static checks.
17143
17144 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17145 Remove unused local var.
17146
17147 * editfns.c (Fmessage_box): Remove unused local var.
17148
17149 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17150 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17151 Omit unused local vars.
17152 * window.c (shrink_windows): Omit unused local var.
17153 * menu.c (digest_single_submenu): Omit unused local var.
17154 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17155 Omit unused local var.
17156
17157 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17158 Don't assume string length fits in int.
17159 (keyremap_step, read_key_sequence): Use size_t for sizes.
17160 (read_key_sequence): Don't check last_real_key_start redundantly.
17161
17162 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17163 instead of alloca (Bug#8344).
17164
17165 * eval.c (Fbacktrace): Don't assume nargs fits in int.
17166 (Fbacktrace_frame): Don't assume nframes fits in int.
17167
17168 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17169
17170 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17171 concerns.
17172
17173 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17174
17175 * cm.c (calccost): Turn while-do into do-while, for clarity.
17176
17177 * keyboard.c (syms_of_keyboard): Use the same style as later
17178 in this function when indexing through an array. This also
17179 works around GCC bug 48267.
17180
17181 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17182
17183 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17184
17185 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17186 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17187
17188 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17189 This avoids undefined behavior on integer overflow, and is a bit
17190 more convenient anyway since it is compared to a size_t variable.
17191
17192 Variadic C functions now count arguments with size_t, not int.
17193 This avoids an unnecessary limitation on 64-bit machines, which
17194 caused (substring ...) to crash on large vectors (Bug#8344).
17195 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17196 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
17197 All variadic functions and their callers changed accordingly.
17198 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17199 * data.c (arith_driver, float_arith_driver): Likewise.
17200 * editfns.c (general_insert_function): Likewise.
17201 * eval.c (struct backtrace.nargs, interactive_p)
17202 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17203 (funcall_lambda, mark_backtrace): Likewise.
17204 * fns.c (concat): Likewise.
17205 * frame.c (x_set_frame_parameters): Likewise.
17206 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17207 0 if not found, not -1. All callers changed.
17208
17209 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17210 (stack_copy_size): Now size_t, not int.
17211 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17212
172132011-03-28 Juanma Barranquero <lekktu@gmail.com>
17214
17215 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17216 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17217 All callers changed.
17218
17219 * lisp.h (multibyte_char_to_unibyte):
17220 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17221 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17222 * character.h (CHAR_TO_BYTE8):
17223 * cmds.c (internal_self_insert):
17224 * editfns.c (general_insert_function):
17225 * keymap.c (push_key_description):
17226 * search.c (Freplace_match):
17227 * xdisp.c (message_dolog, set_message_1): All callers changed.
17228
172292011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17230
17231 * keyboard.c (safe_run_hook_funcall): New function.
17232 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17233 don't set the hook to nil, but remove the offending function instead.
17234 (Qcommand_hook_internal): Remove, unused.
17235 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17236 Vcommand_hook_internal.
17237
17238 * eval.c (enum run_hooks_condition): Remove.
17239 (funcall_nil, funcall_not): New functions.
17240 (run_hook_with_args): Call each function through a `funcall' argument.
17241 Remove `cond' argument, now redundant.
17242 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17243 (Frun_hook_with_args_until_failure): Adjust accordingly.
17244 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17245
172462011-03-28 Juanma Barranquero <lekktu@gmail.com>
17247
17248 * dispextern.h (string_buffer_position): Remove declaration.
17249
17250 * print.c (strout): Remove parameter `multibyte', unused since
17251 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17252
17253 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17254 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17255 All callers changed.
17256
17257 * w32.c (_wsa_errlist): Use braces for struct initializers.
17258
17259 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17260 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17261 All callers changed.
17262 (string_buffer_position): Likewise. Also, make static (it's never
17263 used outside xdisp.c).
17264 (cursor_row_p): Remove parameter `w', unused since
17265 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17266 (decode_mode_spec): Remove parameter `precision', introduced during
17267 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17268 All callers changed.
17269
172702011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17271
17272 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17273
172742011-03-27 Anders Lindgren <andlind@gmail.com>
17275
17276 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17277 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17278 (ns_update_auto_hide_menu_bar): New functions.
17279 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17280 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17281 ns_constrain_all_frames.
17282 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17283 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17284
172852011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17286
17287 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17288
172892011-03-27 Glenn Morris <rgm@gnu.org>
17290
17291 * syssignal.h: Replace RETSIGTYPE with void.
17292 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17293 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17294 Replace SIGTYPE with void everywhere.
17295 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17296 * s/template.h (SIGTYPE): Remove commented out definition.
17297
172982011-03-26 Eli Zaretskii <eliz@gnu.org>
17299
17300 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17301 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17302
173032011-03-26 Juanma Barranquero <lekktu@gmail.com>
17304
17305 * w32.c (read_unc_volume): Use parameter `henum', instead of
17306 global variable `wget_enum_handle'.
17307
17308 * keymap.c (describe_vector): Remove parameters `indices' and
17309 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17310 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17311
17312 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17313
17314 * keyboard.c (timer_check): Remove parameter `do_it_now',
17315 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17316 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17317 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17318
17319 * keyboard.c (read_char):
17320 * w32menu.c (w32_menu_display_help):
17321 * xmenu.c (show_help_event, menu_help_callback):
17322 Adjust calls to `show_help_echo'.
17323
17324 * gtkutil.c (xg_maybe_add_timer):
17325 * keyboard.c (readable_events):
17326 * process.c (wait_reading_process_output):
17327 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17328
17329 * insdel.c (adjust_markers_gap_motion):
17330 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17331 (gap_left, gap_right): Don't call it.
17332
173332011-03-25 Chong Yidong <cyd@stupidchicken.com>
17334
17335 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17336 incurred during fontification.
17337
173382011-03-25 Juanma Barranquero <lekktu@gmail.com>
17339
17340 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17341 (DEFVAR_PER_BUFFER): Don't pass it.
17342
17343 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17344 (scrolling_window): Don't pass it.
17345
173462011-03-25 Juanma Barranquero <lekktu@gmail.com>
17347
17348 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17349
17350 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17351 and `suffix'.
17352 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17353 of variables specific to SELinux and computation of `encoded_absname'.
17354
17355 * image.c (XPutPixel): Remove unused variable `height'.
17356
17357 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17358
17359 * unexw32.c (get_section_info): Remove unused variable `section'.
17360
17361 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17362 (system_process_attributes): Remove unused variable `sess'.
17363 (sys_read): Remove unused variable `err'.
17364
17365 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17366 (w32_wnd_proc): Remove unused variable `isdead'.
17367 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17368 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17369 (x_create_tip_frame): Remove unused variable `tem'.
17370
17371 * w32inevt.c (w32_console_read_socket):
17372 Remove unused variable `no_events'.
17373
17374 * w32term.c (x_draw_composite_glyph_string_foreground):
17375 Remove unused variable `width'.
17376
173772011-03-24 Juanma Barranquero <lekktu@gmail.com>
17378
17379 * w32term.c (x_set_glyph_string_clipping):
17380 Don't pass uninitialized region to CombineRgn.
17381
173822011-03-23 Juanma Barranquero <lekktu@gmail.com>
17383
17384 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17385 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17386 (Fx_close_connection): Remove unused variable `i'.
17387
17388 * w32font.c (w32font_draw): Return number of glyphs.
17389 (w32font_open_internal): Remove unused variable `i'.
17390 (w32font_driver): Add missing initializer.
17391
17392 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17393 (fill_in_menu): Remove unused variable `items_added'.
17394
17395 * w32term.c (last_mouse_press_frame): Remove static global variable.
17396 (w32_clip_to_row): Remove unused variable `f'.
17397 (x_delete_terminal): Remove unused variable `i'.
17398
17399 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17400 (NOTHING): Remove unused static global variable.
17401 (uniscribe_check_otf): Remove unused variable `table'.
17402 (uniscribe_font_driver): Add missing initializers.
17403
174042011-03-23 Julien Danjou <julien@danjou.info>
17405
17406 * term.c (Fsuspend_tty, Fresume_tty):
17407 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17408 * window.c (temp_output_buffer_show):
17409 * insdel.c (signal_before_change):
17410 * frame.c (Fhandle_switch_frame):
17411 * fileio.c (Fdo_auto_save):
17412 * emacs.c (Fkill_emacs):
17413 * editfns.c (save_excursion_restore):
17414 * cmds.c (internal_self_insert):
17415 * callint.c (Fcall_interactively):
17416 * buffer.c (Fkill_all_local_variables):
17417 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17418 Use Frun_hooks.
17419 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17420 unconditionally since it does the check itself.
17421
174222011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17423
17424 Fix more problems found by GCC 4.5.2's static checks.
17425
17426 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17427 the first time through the loop, since we know p0 < p1 then.
17428 This also avoids a gcc -Wstrict-overflow warning.
17429
17430 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17431 leading to a memory leak, possible in functions like
17432 load_charset_map_from_file that can allocate an unbounded number
17433 of objects (Bug#8318).
17434
17435 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17436 that could (at least in theory) be that large.
17437
17438 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17439 This is less likely to overflow, and avoids undefined behavior if
17440 overflow does occur. All callers changed. Use strtoul to scan
17441 for the unsigned long integer.
17442 (pint2hrstr): Simplify and tune code slightly.
17443 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17444
17445 * scroll.c (do_scrolling): Work around GCC bug 48228.
17446 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17447
17448 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17449 This also avoids a warning with gcc -Wstrict-overflow.
17450 (validate_x_resource_name): Simplify count usage.
17451 This also avoids a warning with gcc -Wstrict-overflow.
17452
17453 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17454 fail (Bug#8306).
17455
17456 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17457
17458 * process.c (Fmake_network_process): Use socklen_t, not int,
17459 where POSIX says socklen_t is required in portable programs.
17460 This fixes a porting bug on hosts like 64-bit HP-UX, where
17461 socklen_t is wider than int (Bug#8277).
17462 (Fmake_network_process, server_accept_connection):
17463 (wait_reading_process_output, read_process_output):
17464 Likewise.
17465
17466 * process.c: Rename or move locals to avoid shadowing.
17467 (list_processes_1, Fmake_network_process):
17468 (read_process_output_error_handler, exec_sentinel_error_handler):
17469 Rename or move locals.
17470 (Fmake_network_process): Define label "retry_connect" only if needed.
17471 (Fnetwork_interface_info): Fix pointer signedness.
17472 (process_send_signal): Add cast to avoid pointer signedness problem.
17473 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17474 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17475
17476 Make tparam.h and terminfo.c consistent.
17477 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17478 Include tparam.h instead, since it declares them.
17479 * cm.h (PC): Remove extern decl; tparam.h now does this.
17480 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17481 * terminfo.c: Include tparam.h, to check interfaces.
17482 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17483 (tparam): Adjust signature to match interface in tparam.h;
17484 this removes some undefined behavior. Check that outstring and len
17485 are zero, which they always are with Emacs.
17486 * tparam.h (PC, BC, UP): New extern decls.
17487
17488 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17489 (xftfont_open): Rename locals to avoid shadowing.
17490
17491 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17492 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17493 (OTF_TAG_SYM): Omit macro if not needed.
17494 (ftfont_list): Remove unused local.
17495 (get_adstyle_property, ftfont_pattern_entity):
17496 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17497 Rename locals to avoid shadowing.
17498
17499 * xfont.c (xfont_list_family): Mark var as initialized.
17500
17501 * xml.c (make_dom): Now static.
17502
17503 * composite.c (composition_compute_stop_pos): Rename local to
17504 avoid shadowing.
17505 (composition_reseat_it): Remove unused locals.
17506 (find_automatic_composition, composition_adjust_point): Likewise.
17507 (composition_update_it): Mark var as initialized.
17508 (find_automatic_composition): Mark vars as initialized,
17509 with a FIXME (Bug#8290).
17510
17511 character.h: Rename locals to avoid shadowing.
17512 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17513 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17514 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17515 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17516 to avoid shadowing.
17517
17518 * textprop.c (property_change_between_p): Remove; unused.
17519
17520 * intervals.c (interval_start_pos): Now static.
17521
17522 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17523
17524 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17525 Rename locals to avoid shadowing.
17526
17527 * sound.c (wav_play, au_play, Fplay_sound_internal):
17528 Fix pointer signedness.
17529 (alsa_choose_format): Remove unused local var.
17530 (wav_play): Initialize a variable to 0, to prevent undefined
17531 behavior (Bug#8278).
17532
17533 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17534
17535 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17536
17537 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17538 clobbering (Bug#8298).
17539 * sysdep.c (sys_subshell): Likewise.
17540 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17541
17542 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17543 This should get cleaned up, so that child_setup has the
17544 same signature on all platforms.
17545
17546 * callproc.c (call_process_cleanup): Now static.
17547 (relocate_fd): Rename locals to avoid shadowing.
17548
175492011-03-22 Chong Yidong <cyd@stupidchicken.com>
17550
17551 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17552 not to be necessary, and produces flickering.
17553
175542011-03-20 Glenn Morris <rgm@gnu.org>
17555
17556 * config.in: Remove file.
17557
175582011-03-20 Juanma Barranquero <lekktu@gmail.com>
17559
17560 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17561 are now in src/globals.h.
17562 (syms_of_minibuf): Remove spurious & from previous change.
17563
175642011-03-20 Leo Liu <sdl.web@gmail.com>
17565
17566 * minibuf.c (completing-read-function): New variable.
17567 (completing-read-default): Rename from completing-read.
17568 (completing-read): Call completing-read-function.
17569
175702011-03-19 Juanma Barranquero <lekktu@gmail.com>
17571
17572 * xfaces.c (Fx_load_color_file):
17573 Read color file from absolute filename (bug#8250).
17574
175752011-03-19 Juanma Barranquero <lekktu@gmail.com>
17576
17577 * makefile.w32-in: Update dependencies.
17578
175792011-03-17 Eli Zaretskii <eliz@gnu.org>
17580
17581 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17582
175832011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17584
17585 Fix more problems found by GCC 4.5.2's static checks.
17586
17587 * process.c (make_serial_process_unwind, send_process_trap):
17588 (sigchld_handler): Now static.
17589
17590 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17591 That way, the code declares only the vars that it needs.
17592 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17593 * s/cygwin.h (PTY_ITERATION): Likewise.
17594 * s/darwin.h (PTY_ITERATION): Likewise.
17595 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17596
17597 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17598 * process.c (allocate_pty): Don't declare stb unless it's needed.
17599
17600 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17601 (CONSTANTLIM): Remove; unused.
17602 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17603 Define only if needed.
17604
17605 * unexelf.c (unexec): Name an expression,
17606 to avoid gcc -Wbad-function-cast warning.
17607 Use a different way to cause a compilation error if anyone uses
17608 n rather than nn, a way that does not involve shadowing.
17609 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17610
17611 * deps.mk (unexalpha.o): Remove; unused.
17612
17613 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17614 * unexec.h: New file.
17615 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17616 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17617 Depend on unexec.h.
17618 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17619 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17620 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17621 Change as necessary to match prototype in unexec.h.
17622
17623 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17624 shadowing.
17625 (back_comment, skip_chars): Mark vars as initialized.
17626
17627 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17628 Rename locals to avoid shadowing.
17629
17630 * lread.c (read1): Rewrite so as not to use empty "else".
17631 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17632
17633 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17634
17635 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17636 warning when compiling print.c.
17637
17638 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17639 instead of using an uninitialized var.
17640 (font_sort_entities): Mark var as initialized.
17641
17642 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17643
17644 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17645 pointers to constants.
17646 (font_parse_fcname): Remove unused vars.
17647 (font_delete_unmatched): Now static.
17648 (font_get_spec): Remove; unused.
17649 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17650 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17651 Rename or move locals to avoid shadowing.
17652
17653 * fns.c (require_nesting_list, require_unwind): Now static.
17654 (Ffillarray): Rename locals to avoid shadowing.
17655
17656 * floatfns.c (domain_error2): Define only if needed.
17657 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17658
17659 * alloc.c (mark_backtrace): Move decl from here ...
17660 * lisp.h: ... to here, so that it can be checked.
17661
17662 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17663 (Fdefvar): Rewrite so as not to use empty "else".
17664 (lisp_indirect_variable): Name an expression,
17665 to avoid gcc -Wbad-function-cast warning.
17666 (Fdefvar): Rename locals to avoid shadowing.
17667
17668 * callint.c (quotify_arg, quotify_args): Now static.
17669 (Fcall_interactively): Rename locals to avoid shadowing.
17670 Use const pointer when appropriate.
17671
17672 * lisp.h (get_system_name, get_operating_system_release):
17673 Move decls here, to check interfaces.
17674 * process.c (get_operating_system_release): Move decl to lisp.h.
17675 * xrdb.c (get_system_name): Likewise.
17676 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17677 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17678 some of which prompt warnings from gcc -Wbad-function-cast.
17679 (Fformat_time_string, Fencode_time, Finsert_char):
17680 (Ftranslate_region_internal, Fformat):
17681 Rename or remove local vars to avoid shadowing.
17682 (Ftranslate_region_internal): Mark var as initialized.
17683
17684 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17685 avoid shadowing.
17686
17687 * lisp.h (eassert): Check that the argument compiles, even if
17688 ENABLE_CHECKING is not defined.
17689
17690 * data.c (Findirect_variable): Name an expression, to avoid
17691 gcc -Wbad-function-cast warning.
17692 (default_value, arithcompare, arith_driver, arith_error): Now static.
17693 (store_symval_forwarding): Rename local to avoid shadowing.
17694 (Fmake_variable_buffer_local, Fmake_local_variable):
17695 Mark variables as initialized.
17696 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17697
17698 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17699 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17700 Rename locals to avoid shadowing.
17701 (mark_stack): Move local variables into the #ifdef region where
17702 they're used.
17703 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17704 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17705 needed otherwise.
17706 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17707 (GC_STRING_CHARS): Remove; not used.
17708 (Fmemory_limit): Cast sbrk's returned value to char *.
17709
17710 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17711 avoids undefined behavior in theory.
17712
17713 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17714
17715 Use functions, not macros, for up- and down-casing (Bug#8254).
17716 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17717 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17718 to use the following functions instead of these macros.
17719 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17720 EMACS_INT, since callers assume the returned value fits in int.
17721 (upcase1): Likewise, for UPCASE_TABLE.
17722 (uppercasep, lowercasep, upcase): New static inline functions.
17723 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17724 the race-condition problem in the old DOWNCASE.
17725
17726 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17727 Rename locals to avoid shadowing.
17728 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17729 (regex_compile, re_search_2, re_match_2_internal):
17730 Remove unused local vars.
17731 (FREE_VAR): Rewrite so as not to use empty "else",
17732 which gcc can warn about.
17733 (regex_compile, re_match_2_internal): Mark locals as initialized.
17734 (RETALLOC_IF): Define only if needed.
17735 (WORDCHAR_P): Likewise. This one is never needed, but is used
17736 only in a comment talking about a compiler bug, so put inside
17737 the #if 0 of that comment.
17738 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17739 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17740 Remove; unused.
17741
17742 * search.c (boyer_moore): Rename locals to avoid shadowing.
17743 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17744 (PREV_CHAR_BOUNDARY): Likewise.
17745
17746 * search.c (simple_search): Remove unused var.
17747
17748 * dired.c (compile_pattern): Move decl from here ...
17749 * lisp.h: ... to here, so that it can be checked.
17750 (struct re_registers): New forward decl.
17751
17752 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17753
17754 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17755 All uses changed.
17756 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17757 Rename locals to avoid shadowing.
17758 (Fvertical_motion): Mark locals as initialized.
17759
17760 * casefiddle.c (casify_object, casify_region): Now static.
17761 (casify_region): Mark local as initialized.
17762
17763 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17764
17765 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17766 New macros, so that the caller can use some names other than
17767 gcpro1, gcpro2, etc.
17768 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17769 of the new macros.
17770 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17771 argument, for consistency with GCPRO2_VAR, etc: it is now the
17772 prefix of the variable, not the variable itself. All uses
17773 changed.
17774 * dired.c (directory_files_internal, file_name_completion):
17775 Rename locals to avoid shadowing.
17776
17777 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17778 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17779 dired.c's scmp function, had undefined behavior.
17780 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17781 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17782 * buffer.h: ... to here, because these macros use current_buffer,
17783 and the new implementation with inline functions needs to have
17784 current_buffer in scope now, rather than later when the macros
17785 are used.
17786 (downcase, upcase1): New static inline functions.
17787 (DOWNCASE, UPCASE1): Reimplement using these functions.
17788 This avoids undefined behavior in expressions like
17789 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17790 from race conditions in accessing the global variables
17791 case_temp1 and case_temp2.
17792 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17793 * lisp.h (case_temp1, case_temp2): Remove their decls.
17794 * character.h (ASCII_CHAR_P): Move from here ...
17795 * lisp.h: ... to here, so that the inline functions mentioned
17796 above can use them.
17797
17798 * dired.c (directory_files_internal_unwind): Now static.
17799
17800 * fileio.c (file_name_as_directory, directory_file_name):
17801 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17802 Now static.
17803 (file_name_as_directory): Use const pointers when appropriate.
17804 (Fexpand_file_name): Likewise. In particular, newdir might
17805 point at constant storage, so make it a const pointer.
17806 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17807 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17808 signedness issues.
17809 (Fset_file_times, Finsert_file_contents, auto_save_error):
17810 Rename locals to avoid shadowing.
17811
17812 * minibuf.c (choose_minibuf_frame_1): Now static.
17813 (Ftry_completion, Fall_completions): Rename or remove locals
17814 to avoid shadowing.
17815
17816 * marker.c (bytepos_to_charpos): Remove; unused.
17817
17818 * lisp.h (verify_bytepos, count_markers): New decls,
17819 so that gcc does not warn that these functions aren't declared.
17820
17821 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17822 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17823 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17824 (copy_text): Remove unused local var.
17825
17826 * filelock.c (within_one_second): Now static.
17827 (lock_file_1): Rename local to avoid shadowing.
17828
17829 * buffer.c (fix_overlays_before): Mark locals as initialized.
17830 (fix_start_end_in_overlays): Likewise. This function should be
17831 simplified by using pointers-to-pointers, but that's a different
17832 matter.
17833 (switch_to_buffer_1): Now static.
17834 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17835 (report_overlay_modification): Rename locals to avoid shadowing.
17836
17837 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17838 Fix pointer signedness issue.
17839 (sys_subshell): Mark local as volatile if checking for lint,
17840 to suppress a gcc -Wclobbered warning that does not seem to be right.
17841 (MAXPATHLEN): Define only if needed.
17842
17843 * process.c (serial_open, serial_configure): Move decls from here ...
17844 * systty.h: ... to here, so that they can be checked.
17845
17846 * fns.c (get_random, seed_random): Move extern decls from here ...
17847 * lisp.h: ... to here, so that they can be checked.
17848
17849 * sysdep.c (reset_io): Now static.
17850 (wait_for_termination_signal): Remove; unused.
17851
17852 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17853 (copy_keymap_item, append_key, push_text_char_description):
17854 Now static.
17855 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17856 (DENSE_TABLE_SIZE): Remove; unused.
17857 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17858 (describe_map_tree):
17859 Rename locals to avoid shadowing.
17860
17861 * keyboard.c: Declare functions static if they are not used elsewhere.
17862 (echo_char, echo_dash, cmd_error, top_level_2):
17863 (poll_for_input, handle_async_input): Now static.
17864 (read_char, kbd_buffer_get_event, make_lispy_position):
17865 (make_lispy_event, make_lispy_movement, apply_modifiers):
17866 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17867 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17868 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17869 (read_key_sequence, read_char): Mark locals as initialized.
17870 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17871
17872 * keyboard.h (make_ctrl_char): New decl.
17873 (mark_kboards): Move decl here ...
17874 * alloc.c (mark_kboards): ... from here.
17875
17876 * lisp.h (force_auto_save_soon): New decl.
17877
17878 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17879 (DEFINE_DUMMY_FUNCTION): New macro.
17880 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17881 Use it.
17882 (main): Add casts to avoid warnings
17883 if GCC considers string literals to be constants.
17884
17885 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17886
17887 * dbusbind.c: Pointer signedness fixes.
17888 (xd_signature, xd_append_arg, xd_initialize):
17889 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17890 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17891 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17892 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17893
17894 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17895 if GCC considers string literals to be constants.
17896 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17897
178982011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17899
17900 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17901 (print_preprocess, print_object): New macro to fix last change.
17902
17903 * print.c (print_preprocess): Don't forget font objects.
17904
179052011-03-16 Juanma Barranquero <lekktu@gmail.com>
17906
17907 * emacs.c (USAGE3): Doc fixes.
17908
179092011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17910
17911 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17912 structure.
17913
179142011-03-14 Juanma Barranquero <lekktu@gmail.com>
17915
17916 * lisp.h (VWindow_system, Qfile_name_history):
17917 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17918 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17919 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17920
17921 * w32select.c: Don't #include "keyboard.h".
17922 (run_protected): Add extern declaration for waiting_for_input.
17923
17924 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17925 * w32console.c (detect_input_pending, read_input_pending)
17926 (encode_terminal_code):
17927 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17928 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17929 (w32_system_caret_y, Qfile_name_history):
17930 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17931 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17932 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17933 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17934 * w32proc.c (Qlocal, report_file_error):
17935 * w32term.c (Vwindow_system, updating_frame):
17936 * w32uniscribe.c (initialized, uniscribe_font_driver):
17937 Remove unneeded extern declarations.
17938
179392011-03-14 Chong Yidong <cyd@stupidchicken.com>
17940
17941 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17942
179432011-03-13 Chong Yidong <cyd@stupidchicken.com>
17944
17945 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17946 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17947 These macros can no longer be used for assignment.
17948
17949 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17950 Assign struct members directly, instead of using BUF_BEGV etc.
17951 (record_buffer_markers, fetch_buffer_markers): New functions for
17952 recording and fetching special buffer markers.
17953 (set_buffer_internal_1, set_buffer_temp): Use them.
17954
17955 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17956
17957 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17958
17959 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17960 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17961
17962 * xdisp.c (hscroll_window_tree):
17963 (reconsider_clip_changes): Use PT instead of BUF_PT.
17964
179652011-03-13 Eli Zaretskii <eliz@gnu.org>
17966
17967 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17968 $(EMACS_ROOT)/lib/intprops.h.
17969
179702011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17971
17972 Fix more problems found by GCC 4.5.2's static checks.
17973
17974 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17975 to unsigned char * to avoid compiler diagnostic.
17976 (xg_free_frame_widgets): Make it clear that a local variable is
17977 needed only if USE_GTK_TOOLTIP.
17978 (gdk_window_get_screen): Make it clear that this macro is needed
17979 only if USE_GTK_TOOLTIP.
17980 (int_gtk_range_get_value): New function, which avoids a diagnostic
17981 from gcc -Wbad-function-cast.
17982 (xg_set_toolkit_scroll_bar_thumb): Use it.
17983 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17984 diagnostic from gcc -Wbad-function-cast.
17985 (get_utf8_string, xg_get_file_with_chooser):
17986 Rename locals to avoid shadowing.
17987 (create_dialog): Move locals to avoid shadowing.
17988
17989 * xgselect.c (xg_select): Remove unused var.
17990
17991 * image.c (four_corners_best): Mark locals as initialized.
17992 (gif_load): Initialize transparent_p to zero (Bug#8238).
17993 Mark another local as initialized.
17994 (my_png_error, my_error_exit): Mark with NO_RETURN.
17995
17996 * image.c (clear_image_cache): Now static.
17997 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17998 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17999 (x_edge_detection): Remove unnecessary cast that
18000 gcc -Wbad-function-cast diagnoses.
18001 (gif_load): Fix pointer signedness.
18002 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18003 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18004
180052011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18006
18007 Improve quality of tests for time stamp overflow.
18008 For example, without this patch (encode-time 0 0 0 1 1
18009 1152921504606846976) returns the obviously-bogus value (-948597
18010 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18011 reports time overflow. See
18012 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18013 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18014 * editfns.c: Include limits.h and intprops.h.
18015 (TIME_T_MIN, TIME_T_MAX): New macros.
18016 (time_overflow): Move earlier, to before first use.
18017 (hi_time, lo_time): New functions, for an accurate test for
18018 out-of-range times.
18019 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18020 (Fget_internal_run_time): Don't assume time_t fits in int.
18021 (make_time): Use list2 instead of Fcons twice.
18022 (Fdecode_time): More accurate test for out-of-range times.
18023 (check_tm_member): New function.
18024 (Fencode_time): Use it, to test for out-of-range times.
18025 (lisp_time_argument): Don't rely on undefined left-shift and
18026 right-shift behavior when checking for time stamp overflow.
18027
18028 * editfns.c (time_overflow): New function, refactoring common code.
18029 (Fformat_time_string, Fdecode_time, Fencode_time):
18030 (Fcurrent_time_string): Use it.
18031
18032 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18033 * dired.c (make_time): Move to ...
18034 * editfns.c (make_time): ... here.
18035 * systime.h: Note the move.
18036
180372011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18038
18039 * fringe.c (update_window_fringes): Remove unused variables.
18040
18041 * unexmacosx.c (copy_data_segment): Also copy __got section.
18042 (Bug#8223)
18043
180442011-03-12 Eli Zaretskii <eliz@gnu.org>
18045
18046 * termcap.c [MSDOS]: Include "msdos.h".
18047 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18048 Constify `char *' arguments and their references according to
18049 prototypes in tparam.h.
18050
18051 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18052
18053 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18054 Adapt all references accordingly.
18055
18056 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18057
180582011-03-11 Tom Tromey <tromey@redhat.com>
18059
18060 * buffer.c (syms_of_buffer): Remove obsolete comment.
18061
180622011-03-11 Eli Zaretskii <eliz@gnu.org>
18063
18064 * termhooks.h (encode_terminal_code): Declare prototype.
18065
18066 * msdos.c (encode_terminal_code): Don't declare prototype.
18067
18068 * term.c (encode_terminal_code): Now external again, used by
18069 w32console.c and msdos.c.
18070
18071 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18072 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18073
180742011-03-11 Paul Eggert <eggert@cs.ucla.edu>
18075
18076 Fix some minor problems found by GCC 4.5.2's static checks.
18077
18078 * fringe.c (update_window_fringes): Mark locals as initialized
18079 (Bug#8227).
18080 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18081
18082 * alloc.c (mark_fringe_data): Move decl from here ...
18083 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18084 to check its interface.
18085 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18086
18087 * fontset.c (free_realized_fontset): Now static.
18088 (Fset_fontset_font): Rename local to avoid shadowing.
18089 (fontset_font): Mark local as initialized.
18090 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18091
18092 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18093
18094 * xselect.c (x_disown_buffer_selections): Remove; not used.
18095 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18096 (x_own_selection, Fx_disown_selection_internal): Rename locals
18097 to avoid shadowing.
18098 (x_handle_dnd_message): Remove local to avoid shadowing.
18099
18100 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18101 so that the caller can use some name other than gcpro1.
18102 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18103 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18104 (Fx_backspace_delete_keys_p):
18105 Use them to avoid shadowing, and rename vars to avoid shadowing.
18106 (x_decode_color, x_set_name, x_window): Now static.
18107 (Fx_create_frame): Add braces to silence GCC warning.
18108 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18109 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18110 Remove unused locals.
18111 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18112 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18113 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18114 macros.
18115
18116 * xterm.h (x_mouse_leave): New decl.
18117
18118 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18119 Remove unused functions.
18120 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18121 (x_calc_absolute_position): Now static.
18122 (XTread_socket): Don't define label "out" unless it's used.
18123 Don't declare local "event" unless it's used.
18124 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18125 unless they are used.
18126 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18127 (x_fatal_error_signal): Remove; not used.
18128 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18129 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18130 (x_error_catcher, x_connection_closed, x_error_handler):
18131 (x_error_quitter, xembed_send_message, x_iconify_frame):
18132 (my_log_handler): Rename locals to avoid shadowing.
18133 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18134 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18135
18136 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18137 Rename or move locals to avoid shadowing.
18138 (tty_defined_color, merge_face_heights): Now static.
18139 (free_realized_faces_for_fontset): Remove; not used.
18140 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18141 does not deduce is never used uninitialized.
18142 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18143 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18144
18145 * terminal.c (store_terminal_param): Now static.
18146
18147 * xmenu.c (menu_highlight_callback): Now static.
18148 (set_frame_menubar): Remove unused local.
18149 (xmenu_show): Rename parameter to avoid shadowing.
18150 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18151 since they might point to immutable storage.
18152 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18153 since it's unused otherwise.
18154
18155 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18156 Add a FIXME, since the code still doesn't look right. (Bug#8215)
18157 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18158 avoids a gcc -Wuninitialized diagnostic.
18159 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18160 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18161 does not deduce are never used uninitialized.
18162
18163 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18164
18165 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18166 * window.c (window_loop, size_window):
18167 (run_window_configuration_change_hook, enlarge_window): Likewise.
18168
18169 * window.c (display_buffer): Now static.
18170 (size_window): Mark variables that gcc -Wuninitialized
18171 does not deduce are never used uninitialized.
18172 * window.h (check_all_windows): New decl, to forestall
18173 gcc -Wmissing-prototypes diagnostic.
18174 * dispextern.h (bidi_dump_cached_states): Likewise.
18175
18176 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18177 shadowing.
18178 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18179 Include <limits.h>.
18180 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18181 and to avoid gcc -Wuninitialized warning.
18182 (load_charset_map): Mark variables that gcc -Wuninitialized
18183 does not deduce are never used uninitialized.
18184 (load_charset): Abort instead of using uninitialized var (Bug#8229).
18185
18186 * coding.c (coding_set_source, coding_set_destination):
18187 Use "else { /* comment */ }" rather than "else /* comment */;"
18188 for clarity, and to avoid gcc -Wempty-body warning.
18189 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18190 a block, when the outer 'i' will do.
18191 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18192 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18193 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18194 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18195 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18196 Rename locals to avoid shadowing.
18197 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
18198 * coding.c (emacs_mule_char, encode_invocation_designation):
18199 Now static, since they're not used elsewhere.
18200 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
18201 (decode_coding_object, encode_coding_object, detect_coding_system):
18202 (decode_coding_emacs_mule): Mark variables that gcc
18203 -Wuninitialized does not deduce are never used uninitialized.
18204 (detect_coding_iso_2022): Initialize a local variable that might
18205 be used uninitialized. Leave a FIXME because it's not clear that
18206 this initialization is needed. (Bug#8211)
18207 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18208 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18209 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18210 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18211 Remove unused macros.
18212
18213 * category.c (hash_get_category_set): Remove unused local var.
18214 (copy_category_table): Now static, since it's not used elsewhere.
18215 * character.c (string_count_byte8): Likewise.
18216
18217 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18218 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18219
18220 * chartab.c (copy_sub_char_table): Now static, since it's not used
18221 elsewhere.
18222 (sub_char_table_ref_and_range, char_table_ref_and_range):
18223 Rename locals to avoid shadowing.
18224 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
18225
18226 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18227 (BIDI_BOB): Remove unused macro.
18228
18229 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18230 deduce are never used uninitialized.
18231 * term.c (encode_terminal_code): Likewise.
18232
18233 * term.c (encode_terminal_code): Now static. Remove unused local.
18234
18235 * tparam.h: New file.
18236 * term.c, tparam.h: Include it.
18237 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18238 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18239 Move these decls to tparam.h, and make them agree with what
18240 is actually in tparam.c. The previous trick of using incompatible
18241 decls in different modules does not conform to the C standard.
18242 All callers of tparam changed to use tparam's actual API.
18243 * tparam.c (tparam1, tparam, tgoto):
18244 Use const pointers where appropriate.
18245
18246 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18247 * cm.h (struct cm): Likewise.
18248 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18249 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18250 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18251 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18252 (turn_on_face, init_tty): Likewise.
18253 * termchar.h (struct tty_display_info): Likewise.
18254
18255 * term.c (term_mouse_position): Rename local to avoid shadowing.
18256
18257 * alloc.c (mark_ttys): Move decl from here ...
18258 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18259
182602011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18261
18262 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18263
182642011-03-09 Juanma Barranquero <lekktu@gmail.com>
18265
18266 * search.c (compile_pattern_1): Remove argument regp, unused since
18267 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18268 (compile_pattern): Don't pass it.
18269
182702011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18271
18272 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18273 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18274 for ! HAVE_GTK3.
18275 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18276
18277 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18278
18279 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18280 gdk_window_get_screen, gdk_window_get_geometry,
18281 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18282 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18283 (xg_get_pixbuf_from_pixmap): New function.
18284 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18285 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18286 Call xg_get_pixbuf_from_pixmap instead of
18287 gdk_pixbuf_get_from_drawable.
18288 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18289 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18290 (xg_check_special_colors): Use GtkStyleContext and its functions
18291 for HAVE_GTK3.
18292 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18293 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18294 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18295 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18296 Call gtk_widget_get_preferred_size.
18297 (xg_frame_resized): gdk_window_get_geometry only takes 5
18298 parameters.
18299 (xg_win_to_widget, xg_event_is_for_menubar):
18300 Call gdk_x11_window_lookup_for_display.
18301 (xg_set_widget_bg): New function.
18302 (delete_cb): New function.
18303 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18304 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18305 (xg_set_background_color): Call xg_set_widget_bg.
18306 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18307 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18308 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18309 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18310 if ! HAVE_GTK3.
18311 (update_frame_tool_bar): Call gtk_widget_hide.
18312 (xg_initialize): Use GDK_KEY_g.
18313
18314 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18315 if ! HAVE_GTK3
18316 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18317
18318 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18319 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18320 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18321
183222011-03-08 Juanma Barranquero <lekktu@gmail.com>
18323
18324 * w32xfns.c (select_palette): Check success of RealizePalette against
18325 GDI_ERROR, not zero.
18326
18327See ChangeLog.11 for earlier changes.
18328
18329;; Local Variables:
18330;; coding: utf-8
18331;; End:
18332
18333 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18334
18335 This file is part of GNU Emacs.
18336
18337 GNU Emacs is free software: you can redistribute it and/or modify
18338 it under the terms of the GNU General Public License as published by
18339 the Free Software Foundation, either version 3 of the License, or
18340 (at your option) any later version.
18341
18342 GNU Emacs is distributed in the hope that it will be useful,
18343 but WITHOUT ANY WARRANTY; without even the implied warranty of
18344 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18345 GNU General Public License for more details.
18346
18347 You should have received a copy of the GNU General Public License
18348 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.