Prefer plain 'static' to 'static inline'.
[bpt/emacs.git] / src / ChangeLog
1 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2
3 Prefer plain 'static' to 'static inline' (Bug#12541).
4 With static functions, modern compilers inline pretty well by
5 themselves; advice from programmers often hurts as much as it helps.
6 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
7 this change shrinks the text size of the Emacs executable by 1.1%
8 without affecting CPU significantly in my benchmark.
9 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
10 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
11 (mark_maybe_object, mark_maybe_pointer, bounded_number):
12 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
13 (bset_auto_fill_function, bset_auto_save_file_format)
14 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
15 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
16 (bset_cache_long_line_scans, bset_case_fold_search)
17 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
18 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
19 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
20 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
21 (bset_header_line_format, bset_indicate_buffer_boundaries)
22 (bset_indicate_empty_lines, bset_invisibility_spec)
23 (bset_left_fringe_width, bset_major_mode, bset_mark)
24 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
25 (bset_name, bset_overwrite_mode, bset_pt_marker)
26 (bset_right_fringe_width, bset_save_length)
27 (bset_scroll_bar_width, bset_scroll_down_aggressively)
28 (bset_scroll_up_aggressively, bset_selective_display)
29 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
30 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
31 (set_buffer_overlays_after):
32 * category.c (bset_category_table):
33 * charset.c (read_hex):
34 * coding.c (produce_composition, produce_charset)
35 (handle_composition_annotation, handle_charset_annotation)
36 (char_encodable_p):
37 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
38 (assign_row, set_frame_matrix_frame, make_current)
39 (add_row_entry):
40 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
41 * fns.c (maybe_resize_hash_table):
42 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
43 * gmalloc.c (register_heapinfo):
44 * image.c (lookup_image_type):
45 * intervals.c (set_interval_object, set_interval_left)
46 (set_interval_right, copy_interval_parent, rotate_right)
47 (rotate_left, balance_possible_root_interval):
48 * keyboard.c (kset_echo_string, kset_kbd_queue)
49 (kset_keyboard_translate_table, kset_last_prefix_arg)
50 (kset_last_repeatable_command, kset_local_function_key_map)
51 (kset_overriding_terminal_local_map, kset_real_last_command)
52 (kset_system_key_syms, clear_event, set_prop):
53 * lread.c (digit_to_number):
54 * marker.c (attach_marker, live_buffer, set_marker_internal):
55 * nsterm.m (ns_compute_glyph_string_overhangs):
56 * process.c (pset_buffer, pset_command)
57 (pset_decode_coding_system, pset_decoding_buf)
58 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
59 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
60 (pset_status, pset_tty_name, pset_type, pset_write_queue):
61 * syntax.c (bset_syntax_table, dec_bytepos):
62 * terminal.c (tset_param_alist):
63 * textprop.c (interval_has_some_properties)
64 (interval_has_some_properties_list):
65 * window.c (wset_combination_limit, wset_dedicated)
66 (wset_display_table, wset_hchild, wset_left_fringe_width)
67 (wset_left_margin_cols, wset_new_normal, wset_new_total)
68 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
69 (wset_right_fringe_width, wset_right_margin_cols)
70 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
71 (wset_vertical_scroll_bar_type, wset_window_parameters):
72 * xdisp.c (wset_base_line_number, wset_base_line_pos)
73 (wset_column_number_displayed, wset_region_showing)
74 (window_box_edges, run_window_scroll_functions)
75 (append_glyph_string_lists, prepend_glyph_string_lists)
76 (append_glyph_string, set_glyph_string_background_width)
77 (append_glyph, append_composite_glyph)
78 (take_vertical_position_into_account):
79 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
80 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
81 (lface_hash, lface_same_font_attributes_p, lookup_face):
82 * xml.c (libxml2_loaded_p):
83 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
84 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
85 Now 'static', not 'static inline'.
86
87 * bidi.c: Tune.
88 (bidi_copy_it): Do the whole copy with a single memcpy.
89 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
90
91 Revert the FOLLOW-SYMLINKS change for file-attributes.
92 Doing it right would require several changes to Tramp, and there's
93 not enough time to get that tested before the freeze today.
94 * dired.c (directory_files_internal, Ffile_attributes):
95 Undo last change.
96
97 * frame.c (x_report_frame_params): Port better to wider ints.
98 Do not assume that EMACS_UINT is the same width as uprintmax_t,
99 or that pointers can be printed in 15 decimal digits.
100 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
101
102 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
103
104 Support x64 build on MS-Windows.
105 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
106 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
107 compatibility with x64.
108 (x_get_focus_frame): Add prototype.
109
110 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
111 defining an XRectangle structure.
112
113 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
114 arithmetics for compatibility with x64.
115
116 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
117 compatibility with x64.
118
119 * w32heap.h: Adjust prototypes and declarations.
120
121 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
122 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
123 DWORD, long, and unsigned long, for compatibility with x64.
124 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
125 (sbrk): Argument is now of type ptrdiff_t.
126
127 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
128 less than 0x0500.
129 (w32_msg_pump): Use WPARAM type for 'result'.
130
131 * w32.c (init_environment, get_emacs_configuration): Support AMD64
132 architecture.
133 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
134 compatibility with x64.
135
136 * vm-limit.c (lim_data): Now size_t.
137 (check_memory_limits): Adjust prototypes of real_morecore and
138 __morecore to receive argument of type ptrdiff_t. Use size_t for
139 five_percent and data_size.
140
141 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
142 variables, for compatibility with x64.
143 (rva_to_section, offset_to_section, relocate_offset)
144 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
145 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
146 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
147 for compatibility with x64.
148
149 * sysdep.c (STDERR_FILENO): Define if not already defined.
150
151 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
152 (__morecore): Argument type is now ptrdiff_t.
153 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
154 (relinquish): Use ptrdiff_t type for 'excess'.
155 (r_alloc_sbrk): Argument type is now ptrdiff_t.
156
157 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
158 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
159 instead of a literal number.
160
161 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
162 (min): Define only if not already defined.
163
164 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
165 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
166 hosts.
167
168 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
169 'bitmaps' is a pointer.
170
171 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
172
173 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
174
175 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
176
177 file-attributes has a new optional arg FOLLOW-SYMLINKS.
178 * dired.c (directory_files_internal, Ffile_attributes):
179 New arg follow_symlinks. All uses changed.
180
181 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
182
183 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
184
185 2012-09-30 Eli Zaretskii <eliz@gnu.org>
186
187 Support atimers and CPU profiler via profile.c on MS-Windows.
188 * w32proc.c (sig_mask, crit_sig): New static variables.
189 (sys_signal): Support SIGALRM and SIGPROF.
190 (sigemptyset, sigaddset, sigfillset, sigprocmask)
191 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
192 sigfillset, and sigprocmask are no longer no-ops.
193 (sigismember): New function.
194 (struct itimer_data): New definition.
195 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
196 (crit_prof): New static variables.
197 (MAX_SINGLE_SLEEP): New definition.
198 (timer_loop, stop_timer_thread, term_timers, init_timers)
199 (start_timer_thread, getitimer, setitimer): New functions.
200 (alarm): No longer a no-op, calls setitimer.
201
202 * w32.c (term_ntproc): Call term_timers.
203 (init_ntproc): Make sure all signals are unblocked at startup, to
204 erase any traces of dumping. Call init_timers.
205
206 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
207 Windows-specific code to display the hourglass mouse pointer is no
208 longer used.
209 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
210 to hourglass timer expiration.
211 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
212 Remove, no longer used.
213 (w32_note_current_window, show_hourglass, hide_hourglass):
214 New functions, in support of hourglass cursor display similar to other
215 window systems.
216 (syms_of_w32fns): Don't initialize hourglass_timer.
217
218 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
219 WINDOWSNT as well.
220 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
221
222 * w32.h (init_timers, term_timers): Add prototypes.
223
224 2012-09-30 Kenichi Handa <handa@gnu.org>
225
226 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
227 to the buffer relocation which may be caused by ccl_driver.
228
229 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
230
231 * xfns.c (Fx_file_dialog): Update comment.
232
233 * w32fns.c (Fx_file_dialog): Update comment.
234
235 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
236 Initialize panel name field if OSX >= 10.6.
237
238 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
239
240 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
241
242 * nsterm.m (NEW_STYLE_FS): New define.
243 (ns_fullscreen_hook, windowWillEnterFullScreen)
244 (windowDidEnterFullScreen, windowWillExitFullScreen)
245 (windowDidExitFullScreen, toggleFullScreen, handleFS)
246 (setFSValue): New functions.
247 (EmacsFSWindow): New implementation.
248 (canBecomeKeyWindow): New function for EmacsFSWindow.
249 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
250 (dealloc): Release nonfs_window if in fullscreen.
251 (updateFrameSize:): Call windowDidMove to update top/left.
252 (windowWillResize:toSize:): Check if frame is still maximized.
253 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
254 next_maximized, maximized_width, maximized_height and nonfs_window.
255 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
256 tbar_height.
257 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
258 fullscreen. Set maximized_width/height. Act on next_maximized.
259
260 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
261 (EmacsView): Add variables for fullscreen.
262 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
263 (EmacsFSWindow): New interface for fullscreen.
264
265 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
266
267 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
268
269 2012-09-30 Chong Yidong <cyd@gnu.org>
270
271 * fns.c (Frandom): Doc fix.
272
273 2012-09-30 Martin Rudalics <rudalics@gmx.at>
274
275 * window.c (Vwindow_combination_limit): New default value.
276 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
277
278 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
279
280 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
281 Suggested by Eli Zaretskii in
282 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
283
284 2012-09-30 Eli Zaretskii <eliz@gnu.org>
285
286 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
287 HAVE_TIMER_SETTIME is defined.
288
289 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
290
291 Profiler improvements: more-accurate timers, overflow checks.
292 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
293 signal.h, setjmp.h. Include systime.h instead.
294 (saturated_add): New function.
295 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
296 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
297 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
298 New static vars.
299 (enum profiler_cpu_running): New enum.
300 (profiler_cpu_running): Now of that enum type, not bool.
301 All uses changed to store the new value.
302 (handle_profiler_signal): Rename from sigprof_handler_1,
303 for consistency with other handlers. Do not check whether
304 cpu_log is a hash-table if garbage collecting, since it
305 doesn't matter in that case.
306 (deliver_profiler_signal): Rename from sigprof_handler,
307 for consistency with other handlers.
308 (setup_cpu_timer): New function, with much of what used to be in
309 Fprofiler_cpu_start. Check for out-of-range argument.
310 Prefer timer_settime if available, and prefer
311 thread cputime clocks, then process cputime clocks, then
312 monotonic clocks, to the old realtime clock. Use make_timeval
313 to round more-correctly when falling back to setitimer.
314 (Fprofiler_cpu_start): Use it.
315 (Fprofiler_cpu_stop): Prefer timer_settime if available.
316 Don't assume that passing NULL as the 2nd argument of setitimer
317 is the same as passing a pointer to all-zero storage.
318 Ignore SIGPROF afterwards.
319 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
320 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
321 non-fatal signal handlers. Ignore SIGPROF on startup.
322 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
323 in profiler.c, since sysdep.c now uses it.
324
325 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
326 Suggested by Eli Zaretskii in
327 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
328
329 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
330
331 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
332
333 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
334
335 * lisp.h (struct backtrace): Remove indirection for `function' field.
336 * xdisp.c (redisplay_internal):
337 * profiler.c (record_backtrace, sigprof_handler_1):
338 * alloc.c (Fgarbage_collect):
339 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
340 (Fbacktrace_frame): Adjust accordingly.
341
342 2012-09-28 Glenn Morris <rgm@gnu.org>
343
344 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
345 (Frun_hook_with_args_until_failure): Doc fixes.
346
347 2012-09-28 Eli Zaretskii <eliz@gnu.org>
348
349 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
350 Qautomatic_redisplay and change the symbol name. All users changed.
351
352 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
353
354 * profiler.c (sigprof_handler): Fix race condition.
355
356 2012-09-28 Glenn Morris <rgm@gnu.org>
357
358 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
359
360 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
361
362 Check more robustly for timer_settime.
363 * Makefile.in (LIB_TIMER_TIME): New macro.
364 (LIBES): Add it.
365 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
366 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
367 call timer_settime.
368
369 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
370
371 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
372
373 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
374
375 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
376
377 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
378
379 * character.h (MAYBE_UNIFY_CHAR): Remove.
380 * charset.c, charset.h (maybe_unify_char): Now static.
381 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
382 Since this stuff is now private to charset.c, there's no need for
383 a public macro and no need to inline by hand.
384
385 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
386 Stefan Monnier <monnier@iro.umontreal.ca>
387 Juanma Barranquero <lekktu@gmail.com>
388
389 * profiler.c: New file.
390 * Makefile.in (base_obj): Add profiler.o.
391 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
392 ($(BLD)/profiler.$(O)): New target.
393 * emacs.c (main): Call syms_of_profiler.
394 * alloc.c (Qautomatic_gc): New constant.
395 (MALLOC_PROBE): New macro.
396 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
397 (total_bytes_of_live_objects): New function.
398 (Fgarbage_collect): Use it. Record itself in backtrace_list.
399 Call malloc_probe for the memory profiler.
400 (syms_of_alloc): Define Qautomatic_gc.
401 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
402 race condition.
403 (struct backtrace): Move definition...
404 * lisp.h (struct backtrace): ..here.
405 (Qautomatic_gc, profiler_memory_running): Declare vars.
406 (malloc_probe, syms_of_profiler): Declare functions.
407 * xdisp.c (Qautomatic_redisplay): New constant.
408 (redisplay_internal): Record itself in backtrace_list.
409 (syms_of_xdisp): Define Qautomatic_redisplay.
410
411 2012-09-25 Eli Zaretskii <eliz@gnu.org>
412 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
413
414 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
415
416 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
417
418 Prefer POSIX timers if available.
419 They avoid a race if the timer is too close to the current time.
420 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
421 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
422 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
423
424 2012-09-25 Eli Zaretskii <eliz@gnu.org>
425
426 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
427 CHAR_STRING_ADVANCE.
428 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
429 STRING_CHAR_ADVANCE.
430
431 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
432
433 Move Vlibrary_cache to emacs.c and reset before dumping.
434
435 * lisp.h (reset_image_types): Declare.
436 [WINDOWSNT] (Vlibrary_cache): Declare.
437
438 * image.c (reset_image_types): New function.
439
440 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
441 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
442 (Fdump_emacs): Reset Vlibrary_cache and image_types.
443
444 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
445 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
446
447 * w32.h (Vlibrary_cache): Do not declare.
448
449 2012-09-25 Eli Zaretskii <eliz@gnu.org>
450
451 * w32proc.c (sys_signal): Handle all signals defined by the
452 MS-Windows runtime, not just SIGCHLD. Actually install the signal
453 handlers for signals supported by Windows. Don't override
454 term_ntproc as the handler for SIGABRT.
455 (sigaction): Rewrite to call sys_signal instead of duplicating its
456 code.
457 (sys_kill): Improve commentary.
458
459 * w32.c (term_ntproc): Accept (and ignore) one argument, for
460 consistency with a signature of a signal handler. All callers
461 changed.
462 (init_ntproc): Accept an argument DUMPING. If dumping, don't
463 install term_ntproc as a signal handler for SIGABRT, as that
464 should be done by the dumped Emacs.
465
466 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
467
468 * w32select.c (term_w32select): Protect against repeated
469 invocation by setting clipboard_owner to NULL after calling
470 DestroyWindow.
471
472 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
473 and term_ntproc to their modified signatures.
474
475 * character.c (char_string, string_char): Remove calls to
476 MAYBE_UNIFY_CHAR. See the discussion starting at
477 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
478 for the details.
479
480 2012-09-25 Chong Yidong <cyd@gnu.org>
481
482 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
483
484 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
485
486 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
487 when encountering an unknown bytecode.
488
489 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
490
491 image.c, indent.c: Use bool for booleans.
492 * dispextern.h (struct image_type): Members valid_p, load, init
493 now return bool, not int. All uses changed.
494 * image.c: Omit unnecessary static decls.
495 (x_create_bitmap_mask, x_build_heuristic_mask):
496 Return void, not int, since callers don't care about the return value.
497 (x_create_bitmap_mask, define_image_type, valid_image_p)
498 (struct image_keyword, parse_image_spec, image_spec_value)
499 (check_image_size, image_background)
500 (image_background_transparent, x_clear_image_1)
501 (postprocess_image, lookup_image, x_check_image_size)
502 (x_create_x_image_and_pixmap, xbm_image_p)
503 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
504 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
505 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
506 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
507 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
508 (png_image_p, init_png_functions, png_load_body, png_load)
509 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
510 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
511 (init_gif_functions, gif_load, imagemagick_image_p)
512 (imagemagick_load_image, imagemagick_load, svg_image_p)
513 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
514 (gs_load):
515 * nsimage.m (ns_load_image):
516 * nsterm.m (ns_defined_color):
517 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
518 * xfns.c (x_defined_color):
519 * xterm.c (x_alloc_lighter_color_for_widget)
520 (x_alloc_nearest_color_1, x_alloc_nearest_color)
521 (x_alloc_lighter_color):
522 * indent.c (disptab_matches_widthtab, current_column)
523 (scan_for_column, string_display_width, indented_beyond_p)
524 (compute_motion, vmotion, Fvertical_motion):
525 Use bool for booleans.
526
527 2012-09-24 Chong Yidong <cyd@gnu.org>
528
529 * chartab.c (Fset_char_table_default): Obsolete function removed.
530
531 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
532
533 Move pid_t related decls out of lisp.h.
534 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
535 (interruptible_wait_for_termination):
536 Move these decls from lisp.h to syswait.h, since they use pid_t.
537 Needed on FreeBSD; see Herbert J. Skuhra in
538 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
539 * callproc.c: Include syswait.h.
540
541 gnutls.c, gtkutil.c: Use bool for boolean.
542 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
543 (emacs_gnutls_handle_error):
544 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
545 (xg_hide_tooltip, xg_create_frame_widgets)
546 (create_dialog, xg_uses_old_file_dialog)
547 (xg_get_file_with_chooser, xg_get_file_with_selection)
548 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
549 (xg_item_label_same_p, xg_update_menubar)
550 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
551 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
552 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
553 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
554 (update_frame_tool_bar, free_frame_tool_bar):
555 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
556 * nsmenu.m (ns_update_menubar):
557 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
558 * xfns.c (Fx_show_tip) [USE_GTK]:
559 Use bool for boolean.
560 * gtkutil.c (xg_update_frame_menubar):
561 * xmenu.c (update_frame_menubar):
562 Return void, not int, since caller ignores return value.
563 * gtkutil.c (xg_change_toolbar_position):
564 Return void, not 1.
565
566 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
567
568 * makefile.w32-in (BLOCKINPUT_H): Remove.
569 (SYSSIGNAL_H): New macro.
570 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
571 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
572 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
573 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
574 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
575 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
576 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
577 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
578 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
579 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
580 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
581 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
582 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
583 ($(BLD)/w32xfns.$(O)): Update dependencies.
584
585 2012-09-23 Eli Zaretskii <eliz@gnu.org>
586
587 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
588 fatal_error_backtrace.
589
590 * w32proc.c (sys_kill): Undo last change: don't do anything when
591 invoked to deliver SIGABRT to our own process. This is now
592 handled by emacs_raise.
593
594 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
595
596 * w32term.c (w32_read_socket): Remove leftover reference to
597 interrupt_input_pending.
598
599 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
600
601 Do not use SA_NODEFER.
602 Problem reported by Dani Moncayo in
603 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
604 * alloc.c (die):
605 * sysdep.c (emacs_abort): Do not reset signal handler.
606 * emacs.c (terminate_due_to_signal): Reset signal handler here.
607 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
608 wanted even on POSIXish hosts, and it doesn't work on Windows.
609
610 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
611
612 * xterm.c (x_term_init): Call fixup_locale before and after calling
613 gtk_init (Bug#12392).
614
615 2012-09-23 Chong Yidong <cyd@gnu.org>
616
617 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
618 Vdynamic_library_alist.
619
620 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
621 (Fgnutls_available_p): Caller changed.
622
623 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
624 (Flibxml_parse_xml_region): Likewise.
625
626 * dispextern.h (struct image_type): Remove arg from init function.
627
628 * image.c (Finit_image_library, lookup_image_type)
629 (define_image_type): Remove now-unneeded second arg.
630 (init_xpm_functions, init_png_functions, init_jpeg_functions)
631 (init_tiff_functions, init_gif_functions, init_svg_functions):
632 Arglist and w32_delayed_load calling convention changed.
633 (gs_type): Remove init_gs_functions; there is no such function.
634 (valid_image_p, make_image): Fix caller to lookup_image_type.
635
636 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
637
638 Simplify and avoid signal-handling races (Bug#12471).
639 * alloc.c (die):
640 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
641 Avoid recursive loop if there's a fatal error in the function itself.
642 * atimer.c (pending_atimers):
643 * blockinput.h: Don't include "atimer.h"; no longer needed.
644 (interrupt_input_pending): Remove. All uses removed.
645 pending_signals now counts both atimers and ordinary interrupts.
646 This is less racy than having three separate pending-signal flags.
647 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
648 (input_blocked_p):
649 Rename from their upper-case counterparts BLOCK_INPUT,
650 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
651 INPUT_BLOCKED_P, and turn into functions. All uses changed.
652 This makes it easier to access volatile variables more accurately.
653 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
654 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
655 that's more reliable if the code is buggy and sets
656 interrupt_input_blocked to a negative value. All uses changed.
657 * atimer.c (deliver_alarm_signal):
658 Remove. No need to deliver this to the parent; any thread can
659 handle this signal now. All uses replaced by underlying handler.
660 * atimer.c (turn_on_atimers):
661 * dispnew.c (handle_window_change_signal):
662 * emacs.c (handle_danger_signal):
663 * keyboard.c (kbd_buffer_get_event):
664 Don't reestablish signal handler; not needed with sigaction.
665 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
666 (UNBLOCK_INPUT_TO):
667 Rework to avoid unnecessary accesses to volatile variables.
668 (UNBLOCK_INPUT_TO): Now a function.
669 (totally_unblock_input, unblock_input): New decls.
670 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
671 (init_data): Remove. Necessary stuff now done in init_signal.
672 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
673 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
674 (fatal_error_code): Remove; no longer needed.
675 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
676 it doesn't always backtrace. All uses changed. No need to reset
677 signal to default, since sigaction and/or die does that for us now.
678 Use emacs_raise (FOO), not kill (getpid (), FOO).
679 (main): Check more-accurately whether we're dumping.
680 Move fatal-error setup to sysdep.c
681 * floatfns.c: Do not include "syssignal.h"; no longer needed.
682 * gtkutil.c (xg_get_file_name, xg_get_font):
683 Remove no-longer-needed signal-mask manipulation.
684 * keyboard.c, process.c (POLL_FOR_INPUT):
685 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
686 * keyboard.c (read_avail_input): Remove.
687 All uses replaced by gobble_input.
688 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
689 (kbd_buffer_store_event_hold, gobble_input):
690 (record_asynch_buffer_change) [USABLE_SIGIO]:
691 (store_user_signal_events):
692 No need to mess with signal mask.
693 (gobble_input): If blocking input and there are terminals, simply
694 set pending_signals to 1 and return. All hooks changed to not
695 worry about whether input is blocked.
696 (process_pending_signals): Clear pending_signals before processing
697 them, in case a signal comes in while we're processing.
698 By convention callers now test pending_signals before calling us.
699 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
700 New functions, to support changes to blockinput.h.
701 (handle_input_available_signal): Now extern.
702 (reinvoke_input_signal): Remove. All uses replaced by
703 handle_async_input.
704 (quit_count): Now volatile, since a signal handler uses it.
705 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
706 All callers changed. Block SIGINT only if not already blocked.
707 Clear sigmask reliably, even if Fsignal returns, which it can.
708 Omit unnecessary accesses to volatile var.
709 (quit_throw_to_read_char): No need to restore sigmask.
710 * keyboard.c (gobble_input, handle_user_signal):
711 * process.c (wait_reading_process_output):
712 Call signal-handling code rather than killing ourselves.
713 * lisp.h: Include <float.h>, for...
714 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
715 (pending_signals): Now volatile.
716 (syms_of_data): Now const if IEEE floating point.
717 (handle_input_available_signal) [USABLE_SIGIO]:
718 (terminate_due_to_signal, record_child_status_change): New decls.
719 * process.c (create_process): Avoid disaster if memory is exhausted
720 while we're processing a vfork, by tightening the critical section
721 around the vfork.
722 (send_process_frame, process_sent_to, handle_pipe_signal)
723 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
724 ignores SIGPIPE.
725 (send_process): No need for setjmp/longjmp any more, since the
726 SIGPIPE stuff is now gone. Instead, report an error if errno
727 is EPIPE.
728 (record_child_status_change): Now extern. PID and W are now args.
729 Return void, not bool. All callers changed.
730 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
731 Remove. All uses removed. This bug should be fixed now in a
732 different way.
733 (wait_for_termination_1): Use waitpid rather than sigsuspend,
734 and record the child status change directly. This avoids the
735 need to futz with the signal mask.
736 (process_fatal_action): Move here from emacs.c.
737 (emacs_sigaction_flags): New function, containing
738 much of what used to be in emacs_sigaction_init.
739 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
740 caught by emacs, to make races less likely.
741 (deliver_process_signal): Rename from handle_on_main_thread.
742 All uses changed.
743 (BACKTRACE_LIMIT_MAX): Now at top level.
744 (thread_backtrace_buffer, threadback_backtrace_pointers):
745 New static vars.
746 (deliver_thread_signal, deliver_fatal_thread_signal):
747 New functions, for more-accurate delivery of thread-specific signals.
748 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
749 (deliver_arith_signal): Handle in this thread, not
750 in the main thread, since it's triggered by this thread.
751 (maybe_fatal_sig): New function.
752 (init_signals): New arg DUMPING so that we can be more accurate
753 about whether we're dumping. Caller changed.
754 Treat thread-specific signals differently from process-general signals.
755 Block all signals while handling fatal error; that's safer.
756 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
757 on IEEE hosts.
758 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
759 Ignore SIGPIPE unless batch.
760 (emacs_backtrace): Output backtrace for the appropriate thread,
761 which is not necessarily the main thread.
762 * syssignal.h: Include <stdbool.h>.
763 (emacs_raise): New macro.
764 * xterm.c (x_connection_signal): Remove; no longer needed
765 now that we use sigaction.
766 (x_connection_closed): No need to mess with sigmask now.
767 (x_initialize): No need to reset SIGPIPE handler here, since
768 init_signals does this for us now.
769
770 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
771
772 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
773 background rect may be larger (Bug#12245).
774
775 2012-09-23 Chong Yidong <cyd@gnu.org>
776
777 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
778
779 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
780
781 * .gdbinit: Just stop at fatal_error_backtrace.
782 See Stefan Monnier's request in
783 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
784 Remove no-longer-used query of system type.
785
786 2012-09-22 Chong Yidong <cyd@gnu.org>
787
788 * search.c (Freplace_match): Doc fix (Bug#12325).
789
790 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
791
792 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
793 (Fline_end_position): Doc fix.
794
795 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
796
797 2012-09-22 Chong Yidong <cyd@gnu.org>
798
799 * dispextern.h (struct image_type): Add new slot, storing a type
800 initialization function.
801
802 * image.c (define_image_type): Call the image initializer function
803 if it is defined. Arguments and return value changed.
804 (valid_image_p, make_image): Callers changed.
805 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
806 (gif_type, imagemagick_type, svg_type, gs_type):
807 Add initialization functions.
808 (Finit_image_library): Call lookup_image_type.
809 (CHECK_LIB_AVAILABLE): Macro deleted.
810 (lookup_image_type): Call define_image_type here, rather than via
811 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
812 (syms_of_image): Move define_image_type calls for xbm_type and
813 pbm_type to lookup_image_type.
814
815 2012-09-22 Eli Zaretskii <eliz@gnu.org>
816
817 * keyboard.c (timer_check_2): Move calculation of 'timers' and
818 'idle_timers' from here ...
819 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
820 lists, to avoid infloops when the timer does something stupid,
821 like reinvoke itself with the same or smaller time-out.
822 (Bug#12447)
823
824 2012-09-22 Martin Rudalics <rudalics@gmx.at>
825
826 * window.c (Fsplit_window_internal): Handle only Qt value of
827 Vwindow_combination_limit separately.
828 (Qtemp_buffer_resize): New symbol.
829 (Vwindow_combination_limit): New default value.
830 Rewrite doc-string.
831
832 2012-09-22 Eli Zaretskii <eliz@gnu.org>
833
834 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
835 the new overlay string. (Bug#10159)
836
837 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
838
839 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
840 or that fprintf is async-signal-safe. POSIX doesn't require
841 either assumption.
842
843 2012-09-22 Chong Yidong <cyd@gnu.org>
844
845 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
846 (Bug#8207).
847
848 2012-09-22 Kenichi Handa <handa@gnu.org>
849
850 * composite.c (composition_reseat_it): Handle the case that a
851 grapheme cluster is not covered by a single font (Bug#12352).
852
853 2012-09-21 Chong Yidong <cyd@gnu.org>
854
855 * image.c (define_image_type): Avoid adding duplicate types to
856 image_types (Bug#12463). Suggested by Jörg Walter.
857
858 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
859
860 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
861 (print_load_command_name): Add case LC_DATA_IN_CODE.
862 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
863
864 2012-09-21 Glenn Morris <rgm@gnu.org>
865
866 * eval.c (Frun_hook_with_args_until_success)
867 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
868
869 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
870
871 * fileio.c (Ffile_selinux_context): Only call freecon when
872 lgetfilecon succeeded.
873 (Fset_file_selinux_context): Likewise. (Bug#12444)
874
875 2012-09-21 Eli Zaretskii <eliz@gnu.org>
876
877 * xdisp.c (try_window_reusing_current_matrix): Under bidi
878 reordering, locate the cursor by calling set_cursor_from_row; if
879 that fails, clear the desired glyph matrix before returning a
880 failure indication to the caller. Fixes leaving garbled display
881 when fast scrolling with a down-key. (Bug#12403)
882 (compute_stop_pos_backwards): Fix a typo that caused crashes while
883 scrolling through multibyte text.
884
885 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
886
887 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
888 calling mark_vectorlike since that's the one that marks the window.
889 (mark_discard_killed_buffers): Mark the final cdr.
890 * window.h (struct window): Move prev/next_buffers to the
891 non-standard fields.
892 * window.c (make_window): Initialize prev/next_buffers manually.
893
894 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
895
896 Omit unused arg EXPECTED from socket hooks.
897 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
898 * nsterm.m (ns_term_init):
899 * termhooks.h (struct terminal.read_socket_hook):
900 * w32inevt.c (w32_console_read_socket):
901 * w32term.c (w32_read_socket):
902 * xterm.c (XTread_socket):
903 Omit unused arg EXPECTED. All callers changed.
904 (store_user_signal_events): Return void, not int, since callers no
905 longer care about the return value. All uses changed.
906
907 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
908
909 * w32gui.h (XParseGeometry): Do not declare.
910
911 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
912
913 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
914 Ignore 'expected'. See Eli Zaretskii in
915 <http://bugs.gnu.org/12471#8> (last line).
916
917 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
918 (XParseGeometry): Now static. Substitute extremal values for
919 values that are out of range.
920
921 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
922
923 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
924
925 * nsfns.m (XParseGeometry): Remove.
926 (Fx_create_frame): Call x_set_offset to correctly interpret
927 top_pos in geometry.
928
929 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
930 (Fx_parse_geometry): If there is a space in string, call
931 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
932
933 2012-09-17 Eli Zaretskii <eliz@gnu.org>
934
935 * search.c (scan_buffer): Use character positions in calls to
936 region_cache_forward and region_cache_backward, not byte
937 positions. (Bug#12196)
938
939 * w32term.c (w32_read_socket): Set pending_signals to 1, like
940 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
941
942 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
943 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
944 emacs_blocked_malloc, now deleted.
945
946 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
947
948 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
949 The workaround was for improving performance on Solaris 2.4, but
950 is getting in the way now. Emacs will still work if someone is
951 still running Solaris 2.4 in a museum somewhere; Sun dropped
952 support for Solaris 2.4 in 2003.
953 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
954 * process.c (create_process) [HAVE_WORKING_VFORK]:
955 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
956 since Emacs no longer uses vfork on that platform.
957
958 2012-09-17 Glenn Morris <rgm@gnu.org>
959
960 * emacs.c: Use COPYRIGHT.
961
962 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
963
964 Remove configure's --without-sync-input option (Bug#12450).
965 When auditing signal-handling in preparation for cleaning it up,
966 I found that SYNC_INPUT has race conditions and would be a real
967 pain to fix. Since it's an undocumented and deprecated
968 configure-time option, now seems like a good time to remove it.
969 Also see <http://bugs.gnu.org/11080#16>.
970 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
971 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
972 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
973 (malloc_hysteresis):
974 (check_depth) [XMALLOC_OVERRUN_CHECK]:
975 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
976 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
977 (dont_register_blocks, bytes_used_when_reconsidered)
978 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
979 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
980 [!SYSTEM_MALLOC && !SYNC_INPUT]:
981 Remove. All uses removed.
982 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
983 implementation, one that depends on whether the new macro
984 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
985 is defined.
986 * atimer.c (run_timers, handle_alarm_signal):
987 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
988 (handle_async_input, process_pending_signals)
989 (handle_input_available_signal, init_keyboard):
990 * nsterm.m (ns_read_socket):
991 * process.c (wait_reading_process_output):
992 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
993 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
994 (emacs_write):
995 * xterm.c (XTread_socket):
996 Assume SYNC_INPUT.
997 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
998 * eval.c (handling_signal): Remove. All uses removed.
999 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1000 All uses replaced with the SYNC_INPUT version.
1001 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1002 Remove decls.
1003 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1004 Now static.
1005
1006 * font.c (Ffont_shape_gstring): Remove unused local.
1007
1008 2012-09-16 Glenn Morris <rgm@gnu.org>
1009
1010 * Makefile.in (clean): No longer run nextstep's clean.
1011
1012 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1013 (ns_frag): Remove.
1014 (ns-app): Move here from ns.mk, and simplify.
1015 (clean): Simplify nextstep entry.
1016 * ns.mk: Remove file.
1017
1018 2012-09-17 Kenichi Handa <handa@gnu.org>
1019
1020 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1021 not covert the last few charactes.
1022
1023 2012-09-16 Kenichi Handa <handa@gnu.org>
1024
1025 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1026 here, but just check the validity of glyphs in the glyph-string.
1027
1028 2012-09-16 Martin Rudalics <rudalics@gmx.at>
1029
1030 * window.c (Fwindow_parameter, Fset_window_parameter):
1031 Accept any window as argument (Bug#12452).
1032
1033 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1034
1035 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1036 to ns_term_init to avoid memory leak.
1037
1038 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1039 explicit retain/release.
1040 (ns_term_init): Only allow one display. Initialize outerpool and
1041 ns_*_types.
1042
1043 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1044
1045 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1046 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1047 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1048 the Microsoft problem in a different way, by altering ../nt/config.nt.
1049
1050 2012-09-15 Eli Zaretskii <eliz@gnu.org>
1051
1052 * w32xfns.c:
1053 * w32uniscribe.c:
1054 * w32term.c:
1055 * w32select.c:
1056 * w32reg.c:
1057 * w32proc.c:
1058 * w32menu.c:
1059 * w32inevt.c:
1060 * w32heap.c:
1061 * w32font.c:
1062 * w32fns.c:
1063 * w32console.c:
1064 * w32.c:
1065 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1066 by lisp.h. This completes removal of setjmp.h inclusion
1067 erroneously announced in the previous commit. (Bug#12446)
1068
1069 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1070 more accurate.
1071
1072 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1073 not defined as a macro. The latter happens on MS-Windows.
1074 (Bug#12446)
1075
1076 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1077
1078 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1079 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1080 Some instances of '#include <setjmp.h>' removed, if the
1081 only reason for the instance was because "lisp.h" was included.
1082 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1083 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1084 and _longjmp with the new symbols. Emacs already uses _setjmp if
1085 available, so this change affects only POSIXish hosts that have
1086 sigsetjmp but not _setjmp, such as some versions of Solaris and
1087 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1088 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1089 (png_load_body) [HAVE_PNG]:
1090 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1091 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1092 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1093 since PNG requires jmp_buf. This is the only exception to the
1094 general rule that we now use sys_setjmp and sys_longjmp.
1095 This exception is OK since this code does not change the signal
1096 mask or longjmp out of a signal handler.
1097
1098 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1099
1100 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1101 Include "syssignal.h", for 'main_thread'.
1102
1103 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1104
1105 Avoid out-of-range marker position (Bug#12426).
1106 * insdel.c (replace_range, replace_range_2):
1107 Adjust markers before overlays, as suggested by comments.
1108 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1109 Remove redundant check before calling offset_intervals.
1110
1111 2012-09-14 Martin Rudalics <rudalics@gmx.at>
1112
1113 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1114 current buffer (Bug#12387).
1115
1116 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
1117
1118 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1119
1120 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1121
1122 Use a more backwards-compatible timer format (Bug#12430).
1123 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1124 vector element, not from the 4th, since PSECS is now at the end.
1125 (Fcurrent_idle_time): Doc fix.
1126
1127 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1128
1129 Function to mark objects and remove killed buffers at once.
1130 * alloc.c (discard_killed_buffers): Rename to ...
1131 (mark_discard_killed buffers) ... new name. Add marking
1132 of remaining objects. Fix comment. Adjust users.
1133 (mark_object): Do not touch frame buffer lists here.
1134 * frame.c (delete_frame): Reset frame buffer lists here.
1135
1136 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1137
1138 Better workaround for GNOME bug when --enable-gcc-warnings.
1139 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1140 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1141 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1142
1143 Simplify SIGIO usage (Bug#12408).
1144 The code that dealt with SIGIO was crufty and confusing, e.g., it
1145 played tricks like "#undef SIGIO" but these tricks were not used
1146 consistently. Simplify mostly by not #undeffing standard symbols,
1147 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1148 or not as we please) rather than "defined SIGIO" (standard symbol
1149 that we probably shouldn't #undef).
1150 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1151 Modules that need it can include it.
1152 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1153 * dispextern.h (ignore_sigio): New decl.
1154 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1155 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1156 * emacs.c (shut_down_emacs):
1157 * keyboard.c (kbd_buffer_store_event_hold):
1158 Use ignore_sigio rather than invoking 'signal' directly.
1159 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1160 for FIONREAD.
1161 (FIONREAD, SIGIO): Do not #undef.
1162 (tty_read_avail_input): Use #error rather than a syntax error.
1163 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1164 for I_PIPE, used by SETUP_SLAVE_PTY.
1165 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1166 * sysdep.c (croak): Remove; no longer needed. This bit of
1167 temporary code, with Fred N. Fish's comment that it's temporary,
1168 has been in Emacs since at least 1992!
1169 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1170 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1171 * syssignal.h (croak): Remove decl.
1172 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1173 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1174 now that we're termios-only.
1175 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1176 * term.c (dissociate_if_controlling_tty): Use #error rather than
1177 a run-time error.
1178
1179 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1180 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1181 to work around GNOME bug 683906.
1182 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1183 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1184 This works around GCC bug 54561.
1185
1186 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1187
1188 More fixes for 'volatile' and setjmp/longjmp.
1189 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1190 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1191 (png_load_body) [HAVE_PNG]:
1192 (jpeg_load_body) [HAVE_JPEG]:
1193 New function, with most of the old parent function's body.
1194 (png_load) [HAVE_PNG]:
1195 (jpeg_load) [HAVE_JPEG]:
1196 Invoke the new function, to avoid longjmp munging our locals.
1197 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1198 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1199 longjmp is passed 2, as the C standard doesn't guarantee this.
1200 Instead, store the failure code into mgr->failure_code.
1201
1202 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1203
1204 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1205 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1206 (syms_of_keyboard): Remove support for unread-command-char.
1207
1208 2012-09-12 Eli Zaretskii <eliz@gnu.org>
1209
1210 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1211 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1212 violation. (Bug#12426)
1213
1214 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1215
1216 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1217
1218 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1219
1220 * eval.c: Add `inhibit-debugger'.
1221 (Qinhibit_debugger): New symbol.
1222 (call_debugger): Bind it instead of Qdebug_on_error.
1223 (maybe_call_debugger): Test Vinhibit_debugger.
1224 (syms_of_eval): Define inhibit-debugger.
1225 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1226 (syms_of_xdisp): Remove inhibit-debug-on-message.
1227
1228 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1229
1230 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1231 If a nonvolatile local variable is written before a _longjmp to
1232 the frame containing the variable, and is read after the _longjmp,
1233 the value read is indeterminate. Some local variables of type
1234 'struct handler' and 'struct catchtag' are used in this way, so
1235 mark each of their slots as volatile if the slot can be set before
1236 _longjmp and read afterwards.
1237 * lisp.h (struct handler): var and chosen_clause are now volatile.
1238 (struct catchtag): val, next, and pdlcount are now volatile.
1239
1240 * bidi.c (bidi_push_it, bidi_pop_it):
1241 * fns.c (copy_hash_table):
1242 * image.c (define_image_type):
1243 * keyboard.c (kbd_buffer_store_event_hold):
1244 * process.c (Fprocess_send_eof):
1245 * xfaces.c (x_create_gc) [HAVE_NS]:
1246 * xgselect.c (xg_select):
1247 Prefer assignment to memcpy when either will do.
1248
1249 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1250 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1251 time an item is removed. No need to mark this function 'inline';
1252 the compiler knows better than we do.
1253
1254 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1255
1256 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1257 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1258 to change_frame_size (Bug#12388).
1259 (windowDidResize:): Pass YES to updateFrameSize.
1260
1261 * nsterm.h: Add delay parameter to updateFrameSize.
1262
1263 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1264
1265 Discard killed buffers from deleted window and frame objects.
1266 This reduces an amount of references to killed buffers and
1267 helps GC to reclaim them faster.
1268 * alloc.c (discard_killed_buffers): New function.
1269 (mark_object): Use it for deleted windows and frames.
1270 (mark_object): If symbol's value is set up for a killed buffer
1271 or deleted frame, restore it's global binding.
1272 * data.c (swap_in_global_binding): Add GC notice.
1273 (swap_in_symval_forwarding): Use convenient set_blv_where.
1274 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1275 * window.h: ... to here.
1276
1277 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1278
1279 Convenient macro to check whether the buffer is live.
1280 * buffer.h (BUFFER_LIVE_P): New macro.
1281 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1282 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1283
1284 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1285
1286 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1287 composition cases (Bug#12364).
1288
1289 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1290 overhang of succeeding glyphs overlapping box cursor.
1291
1292 * w32term.c (x_draw_glyph_string): Likewise.
1293
1294 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1295
1296 Simplify, document, and port floating-point (Bug#12381).
1297 The porting part of this patch fixes bugs on non-IEEE platforms
1298 with frexp, ldexp, logb.
1299 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1300 Now static.
1301 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1302 support, by removing commented-out code and briefly listing the
1303 C89 functions excluded. The commented-out stuff was confusing
1304 maintenance, e.g., we thought we needed cbrt but it was commented out.
1305 (logb): Remove decl; no longer needed.
1306 (isfinite): New macro, if not already supplied.
1307 (isnan): Don't replace any existing macro.
1308 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1309 are present on all C89 platforms.
1310 (Ffrexp): Do not special-case zero, as frexp does the right thing
1311 for that case.
1312 (Flogb): Do not use logb, as it doesn't have the desired meaning
1313 on hosts that use non-base-2 floating point. Instead, stick with
1314 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1315 frexp, to avoid getting an unspecified result.
1316
1317 * xdisp.c (Qinhibit_debug_on_message): Now static.
1318
1319 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1320
1321 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1322 NSBezierPath (Bug#12131).
1323
1324 2012-09-10 Chong Yidong <cyd@gnu.org>
1325
1326 * fns.c (Fdelq, Fdelete): Doc fix.
1327
1328 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1329
1330 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1331 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1332
1333 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1334
1335 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1336 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1337 Use it.
1338
1339 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1340
1341 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1342 left fringe if the window has a left margin. This avoids leaving
1343 traces of the cursor because its leftmost pixel is not drawn over.
1344
1345 * dispnew.c (update_window_line): When the left margin area of a
1346 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1347 that screen line. (Bug#12277)
1348
1349 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1350
1351 Assume C89 or later for math functions (Bug#12381).
1352 This simplifies the code, and makes it a bit smaller and faster,
1353 and (most important) makes it easier to clean up signal handling
1354 since we can stop worring about floating-point exceptions in
1355 library code. That was a problem before C89, but the problem
1356 went away many years ago on all practical Emacs targets.
1357 * data.c, image.c, lread.c, print.c:
1358 Don't include <math.h>; no longer needed.
1359 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1360 might be autoconfigured, as that never happens.
1361 * data.c (fmod):
1362 * doprnt.c (DBL_MAX_10_EXP):
1363 * print.c (DBL_DIG):
1364 Remove. C89 or later always defines these.
1365 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1366 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1367 (arith_error, domain_error, domain_error2):
1368 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1369 no longer needed -- we simply return what C returns. All uses removed.
1370 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1371 the wrapped code.
1372 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1373 Remove. All uses expanded, as these macros are no longer used
1374 more than once and are now more trouble than they're worth.
1375 (Ftan): Use tan, not sin / cos.
1376 (Flogb): Assume C89 frexp.
1377 (fmod_float): Assume C89 fmod.
1378 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1379 (init_floatfns): Remove. All uses removed.
1380
1381 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1382
1383 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1384 compositeToPoint for OSX < 10.6 (Bug#12390).
1385
1386 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1387
1388 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1389 This produces more-accurate results.
1390
1391 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1392
1393 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1394 changes (Bug#12088).
1395
1396 2012-09-08 Chong Yidong <cyd@gnu.org>
1397
1398 * syntax.c (Fstring_to_syntax): Doc fix.
1399
1400 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1401
1402 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1403 in the internal border.
1404 (x_set_window_size): Remove static variables and their usage.
1405 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1406 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1407 Remove fringe/internal border adjustment (Bug#11052).
1408 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1409 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1410 (ns_fix_rect_ibw): Remove.
1411 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1412 (ns_dumpglyphs_box_or_relief): Ditto.
1413 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1414 adjustment.
1415 (ns_dumpglyphs_image): Ditto.
1416 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1417 border adjustment.
1418 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1419 their usage. Add fringe_extended_p and its use as in other terms.
1420 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1421 scroll bar was removed.
1422 (updateFrameSize): New function.
1423 (windowDidResize): Move code to updateFrameSize and call it.
1424
1425 * nsterm.h (EmacsView): Add updateFrameSize.
1426
1427 2012-09-07 Chong Yidong <cyd@gnu.org>
1428
1429 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1430
1431 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1432
1433 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1434
1435 More signal-handler cleanup (Bug#12327).
1436 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1437 Problem introduced when merging patches. Noted by Eli Zaretskii in
1438 <http://bugs.gnu.org/12327#67>.
1439 * floatfns.c: Comment fix.
1440 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1441 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1442 and anyway the declaration is harmless even if SIGDANGER is not defined.
1443 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1444 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1445 source files not surprisingly expected syssignal.h to define, or
1446 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1447 Include <sys/ioctl.h>, for FIONREAD.
1448 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1449 This eliminates a problem whereby other files mysteriously had
1450 to include "syssignal.h" before including "systty.h" if they
1451 wanted to use "#ifdef SIGIO".
1452
1453 2012-09-07 Eli Zaretskii <eliz@gnu.org>
1454
1455 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1456
1457 * w32.c (sigemptyset): Empty the set.
1458 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1459
1460 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1461
1462 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1463
1464 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1465 (mark_object): Likewise for frame objects.
1466
1467 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1468
1469 * syssignal.h (handle_on_main_thread): Always declare,
1470 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1471 This ports to platforms without HAVE_PTHREAD.
1472
1473 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1474
1475 Signal-handler cleanup (Bug#12327).
1476 Emacs's signal handlers were written in the old 4.2BSD style with
1477 sigblock and sigmask and so forth, and this led to some
1478 inefficiencies and confusion. Rewrite these to use
1479 pthread_sigmask etc. without copying signal sets around. Also,
1480 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1481 'signal', and instead use functions that do not attempt to take
1482 over the system name space. This patch causes Emacs's text
1483 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1484 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1485 Do not include <signal.h> or "syssignal.h", as these
1486 modules do not use signals.
1487 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1488 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1489 Do not include <signal.h>, as "syssignal.h" does that for us now.
1490 * atimer.c (sigmask_atimers): New function.
1491 (block_atimers, unblock_atimers): New functions,
1492 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1493 All uses replaced.
1494 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1495 no longer needed here.
1496 * emacs.c (main): Inspect existing signal handler with sigaction,
1497 so that there's no need to block and unblock SIGHUP.
1498 * sysdep.c (struct save_signal): New member 'action', replacing
1499 old member 'handler'.
1500 (save_signal_handlers, restore_signal_handlers):
1501 Use sigaction instead of 'signal' to save and restore.
1502 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1503 New function. All users of 'signal' modified to use set_sighandler
1504 if they're writeonly, and to use sys_signal if they're read+write.
1505 (emacs_sigaction_init, forwarded_signal): New functions.
1506 (sys_signal): Remove. All uses replaced by calls to sigaction
1507 and emacs_sigaction_init, or by direct calls to 'signal'.
1508 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1509 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1510 all uses replaced by pthread_sigmask etc. calls.
1511 * syssignal.h: Include <signal.h>.
1512 (emacs_sigaction_init, forwarded_signal): New decls.
1513 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1514 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1515 (sigmask, sys_sigmask): Remove; no longer needed.
1516 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1517 (sigblock, sigunblock, sigfree):
1518 (sigsetmask) [!defined sigsetmask]:
1519 Remove. All uses replaced by pthread_sigmask.
1520 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1521 no longer need to be replaced, and its typical old uses
1522 are now done via emacs_sigaction_init and sigaction.
1523 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1524 (sys_sigdel): Remove; unused.
1525 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1526
1527 2012-09-06 Eli Zaretskii <eliz@gnu.org>
1528
1529 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1530 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1531
1532 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1533
1534 Explicitly mark buffer_defaults and buffer_local_symbols.
1535 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1536 mark_local_symbols here.
1537 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1538 since special buffers aren't marked here any more.
1539 (allocate_buffer): Chain new buffer with all_buffers here...
1540 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1541 not here.
1542 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1543 (syms_of_buffer): Remove staticpro of the above.
1544 (init_buffer_once): Set names for buffer_defaults and
1545 buffer_local_symbols.
1546
1547 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1548
1549 Use bool for booleans in font-related modules.
1550 * font.c (font_intern_prop, font_style_to_value)
1551 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1552 (generate_otf_features, font_check_otf_features, font_check_otf)
1553 (font_match_p, font_list_entities, font_at):
1554 * fontset.c (fontset_id_valid_p, reorder_font_vector
1555 (fontset_find_font, Fset_fontset_font)
1556 (face_suitable_for_char_p) [0]:
1557 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1558 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1559 (m17n_flt_initialized, ftfont_shape_by_flt):
1560 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1561 * nsfont.m (nsfont_draw):
1562 * w32font.c (w32font_draw):
1563 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1564 Use bool for booleans.
1565 * font.h: Adjust to above API changes.
1566 (struct font, struct font_driver, struct font_driver_list):
1567 Use bool for booleans.
1568 (struct font): Remove useless member encoding_type.
1569 All users removed.
1570 * fontset.c, xftfont.c: Omit unnecessary static decls.
1571
1572 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1573
1574 * alloc.c (mark_object): Revert window marking code
1575 since it's unsafe for the Fset_window_configuration.
1576
1577 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1578
1579 Fix race conditions with signal handlers and errno (Bug#12327).
1580 Be more systematic about preserving errno whenever a signal
1581 handler returns, even if it's not in the main thread. Do this by
1582 renaming signal handlers to distinguish between signal delivery
1583 and signal handling. All uses changed.
1584 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1585 * data.c (deliver_arith_signal): Rename from arith_error.
1586 * dispnew.c (deliver_window_change_signal): Rename from
1587 window_change_signal.
1588 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1589 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1590 * keyboard.c (deliver_input_available_signal): Rename from
1591 input_available_signal.
1592 (deliver_user_signal): Rename from handle_user_signal.
1593 (deliver_interrupt_signal): Rename from interrupt_signal.
1594 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1595 (deliver_child_signal): Rename from sigchld_handler.
1596 * atimer.c (handle_alarm_signal):
1597 * data.c (handle_arith_signal):
1598 * dispnew.c (handle_window_change_signal):
1599 * emacs.c (handle_fatal_signal, handle_danger_signal):
1600 * keyboard.c (handle_input_available_signal):
1601 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1602 * process.c (handle_pipe_signal, handle_child_signal):
1603 New functions, with the actual signal-handling code taken from the
1604 original respective signal handlers, sans the sporadic attempts to
1605 preserve errno, since that's now done by handle_on_main_thread.
1606 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1607 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1608 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1609 Move to sysdep.c.
1610 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1611 Move initialization of main_thread to sysdep.c's init_signals.
1612 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1613 our usage, and simplifies the mainline code.
1614 (record_child_status_change): New static function, as a helper
1615 for handle_child_signal, and with most of the old child handler's
1616 contents.
1617 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1618 (handle_child_signal): Use the above.
1619 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1620 Moved here from emacs.c.
1621 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1622 code moved here from emacs.c's main function.
1623 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1624 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1625 This lets callers save and restore errno properly.
1626
1627 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1628
1629 Remove redundant or unused things here and there.
1630 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1631 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1632 * editfns.c (Fcompare_buffer_substrings): Likewise.
1633 * frame.h (struct terminal, struct font_driver_list):
1634 Remove redundant declarations.
1635 * window.h (Qleft, Qright): Likewise.
1636
1637 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1638
1639 Do not mark objects from deleted buffers, windows and frames.
1640 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1641 (mark_object): Likewise for windows and frames.
1642
1643 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1644
1645 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1646 buffer_defaults and buffer_local_symbols as valid objects.
1647 Return special value to denote them.
1648
1649 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1650
1651 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1652 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1653 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1654 (file_name_absolute_p, Fsubstitute_in_file_name):
1655 (check_executable, check_writable, Ffile_accessible_directory_p)
1656 (Fset_file_selinux_context, Fdefault_file_modes)
1657 (Finsert_file_contents, choose_write_coding_system)
1658 (Fwrite_region, build_annotations, a_write, e_write)
1659 (Fdo_auto_save):
1660 * filelock.c (boot_time_initialized, get_boot_time)
1661 (get_boot_time_1, lock_file_1, within_one_second):
1662 * floatfns.c (in_float):
1663 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1664 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1665 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1666 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1667 * window.c (compare_window_configurations):
1668 Use bool for booleans.
1669 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1670 (Fdefault_file_modes): Now mode_t, not int, for modes.
1671 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1672 (internal_delete_file): Now returns void, not a (boolean) int,
1673 since nobody was looking at the return value.
1674 * lisp.h, window.h: Adjust to above API changes.
1675
1676 * xdisp.c (set_message): Simplify and reindent last change.
1677
1678 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
1679
1680 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1681
1682 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1683
1684 * eval.c (call_debugger): Make the function non-static so that we
1685 can call it from set_message.
1686
1687 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1688 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1689
1690 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1691
1692 Give more-useful info on a fatal error (Bug#12328).
1693 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1694 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1695 of doing the work ourselves.
1696 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1697 do most of the work.
1698 (fatal_error_backtrace): New function, taken from the guts
1699 of the old fatal_error_signal, but with a new option to output
1700 a backtrace.
1701 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1702 info about the signal than just its number.
1703 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1704 * sysdep.c: Include <execinfo.h>
1705 (emacs_backtrace): New function, taken partly from the previous
1706 code of the 'die' function.
1707 (emacs_abort): Call fatal_error_backtrace rather than abort.
1708
1709 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1710
1711 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1712 eager (load-time) macro-expansion.
1713 * lisp.mk (lisp): Add macroexp.
1714
1715 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1716
1717 Simplify redefinition of 'abort' (Bug#12316).
1718 Do not try to redefine the 'abort' function. Instead, redo
1719 the code so that it calls 'emacs_abort' rather than 'abort'.
1720 This removes the need for the NO_ABORT configure-time macro
1721 and makes it easier to change the abort code to do a backtrace.
1722 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1723 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1724 Remove; sysdep.c's emacs_abort now takes its place.
1725 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1726 'abort' changed to use 'emacs_abort'.
1727 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1728 (abort) [!defined abort]: Rename to ...
1729 (emacs_abort): ... new name.
1730 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1731 the place of the old 'abort' in emacs.c.
1732 * w32.c, w32fns.c (abort): Do not #undef.
1733 * w32.c (emacs_abort): Rename from w32_abort.
1734
1735 2012-09-04 Eli Zaretskii <eliz@gnu.org>
1736
1737 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1738 offsets[j].dv, since the y axis of the screen coordinates points
1739 down, while the y axis of the font definition coordinates points
1740 up. This fixes display of Arabic diacritics such as KASRA and
1741 KASRATAN. (Bug#11860)
1742
1743 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1744
1745 Be more systematic about _setjmp vs setjmp.
1746 * alloc.c (test_setjmp, mark_stack):
1747 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1748 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1749 (png_load, my_error_exit, jpeg_load):
1750 * process.c (send_process_trap, send_process):
1751 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1752 The underscored versions are up to 30x faster on some hosts.
1753 Formerly, the code used setjmp+longjmp sometimes and
1754 _setjmp+_longjmp at other times, with no particular reason to
1755 prefer setjmp+longjmp.
1756
1757 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1758
1759 Fix minor problem found by static checking.
1760 * buffer.c (Fdelete_all_overlays): Return nil.
1761
1762 2012-09-03 Martin Rudalics <rudalics@gmx.at>
1763
1764 * buffer.c (Fdelete_all_overlays): New function.
1765
1766 2012-09-03 Chong Yidong <cyd@gnu.org>
1767
1768 * gtkutil.c: Add extern decl for Qxft.
1769
1770 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1771
1772 * emacs.c, eval.c: Use bool for boolean.
1773 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1774 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1775 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1776 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1777 (main, decode_env_path, Fdaemon_initialized):
1778 * eval.c (call_debugger, Finteractive_p, interactive_p):
1779 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1780 (maybe_call_debugger, Fbacktrace):
1781 * process.c (read_process_output, exec_sentinel):
1782 Use bool for booleans.
1783 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1784 All callers changed.
1785 * eval.c (interactive_p): Omit always-true boolean argument
1786 EXCLUDE_SUBRS_P. All callers changed.
1787 * dispextern.h, lisp.h: Reflect above API changes.
1788 * firstfile.c (dummy): Use the address of 'main', whose signature
1789 won't change, instead of the address of 'initialize', whose
1790 signature just changed from int to bool.
1791 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1792 * msdos.c (fatal_error_in_progress): ... from here.
1793 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1794 of incrementing it.
1795 (redisplay_internal, unwind_redisplay): Simply clear
1796 REDISPLAYING_P when unwinding, instead of saving its previous,
1797 always-false value and then restoring it.
1798
1799 Clean up some extern decls.
1800 Mostly, this hoists extern decls out of .c files and into .h files.
1801 That way, we're more likely to catch errors if the interfaces change.
1802 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1803 declare xg_mark_data.
1804 * dispextern.h (x_frame_parm_handlers):
1805 * font.h (Qxft):
1806 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1807 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1808 (Qultra_bold, Qoblique, Qitalic):
1809 Move extern decl here from .c file.
1810 * alloc.c (xg_mark_data) [USE_GTK]:
1811 * doc.c (Qclosure):
1812 * eval.c (Qlexical_binding):
1813 * fns.c (time) [!HAVE_UNISTD_H]:
1814 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1815 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1816 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1817 * lread.c (Qinternal_interpreter_environment):
1818 * minibuf.c (Qbuffer):
1819 * process.c (QCfamily, QCfilter):
1820 * widget.c (free_frame_faces):
1821 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1822 * xfont.c (x_clear_errors):
1823 * xterm.c (x_frame_parm_handlers):
1824 Remove now-redundant extern decls.
1825 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1826 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1827 Now static.
1828 * xfaces.c: Remove unnecessary static decls.
1829 * xterm.c (updating_frame): Remove decl of nonexistent object.
1830
1831 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1832 when building globals.h, as the objects that are not built on
1833 this host are not needed to compile C files on this host.
1834
1835 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1836
1837 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1838
1839 * frame.h: Add missing prototype for x_wm_set_size_hint.
1840
1841 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1842
1843 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1844 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1845 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1846 (Fsubstitute_command_keys):
1847 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1848 (save_excursion_save, save_excursion_restore)
1849 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1850 (format_time_string, general_insert_function)
1851 (make_buffer_string, make_buffer_string_both)
1852 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1853 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1854 (copy_text, insert_1, insert_1_both, insert_from_string)
1855 (insert_from_string_before_markers, insert_from_string_1)
1856 (insert_from_buffer, insert_from_buffer_1, replace_range)
1857 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1858 (del_range_2, modify_region):
1859 * intervals.c (intervals_equal, balance_possible_root_interval)
1860 (adjust_intervals_for_insertion, merge_properties_sticky)
1861 (graft_intervals_into_buffer, lookup_char_property)
1862 (adjust_for_invis_intang, set_point_both)
1863 (get_property_and_range, compare_string_intervals)
1864 (set_intervals_multibyte_1, set_intervals_multibyte):
1865 * keyboard.c (decode_timer):
1866 Use bool for boolean.
1867 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1868 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1869
1870 2012-09-02 Chong Yidong <cyd@gnu.org>
1871
1872 * keymap.c (push_key_description): Print M-TAB as C-M-i
1873 (Bug#11758).
1874
1875 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1876
1877 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1878 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1879 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1880 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1881 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1882 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1883 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1884
1885 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1886
1887 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1888 more than one grapheme cluster passed to the shaper: compute the
1889 offset adjustment values separately for each cluster. (Bug#11860)
1890
1891 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1892 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1893 about implicit conversions from integer to pointer.
1894
1895 2012-09-01 Daniel Colascione <dancol@dancol.org>
1896
1897 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1898 system used too early.
1899
1900 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1901
1902 Better seed support for (random).
1903 * emacs.c (main): Call init_random.
1904 * fns.c (Frandom): Set the seed from a string argument, if given.
1905 Remove long-obsolete Gentzel cruft.
1906 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1907 (init_random): New function.
1908
1909 2012-09-01 Daniel Colascione <dancol@dancol.org>
1910
1911 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1912 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1913 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1914 x_wm_set_size_hint, x_query_colors, x_real_positions,
1915 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1916 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1917 all of which have been moved to common code.
1918
1919 * xfaces.c: Include TERM_HEADER instead of listing all possible
1920 window-system headers.
1921
1922 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1923 to match header.
1924
1925 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1926 directly accessing frame internals.
1927
1928 * w32font.h: Include font.h. Define syms_of_w32font and
1929 globals_of_w32font.
1930
1931 * process.c: Include TERM_HEADER instead of listing all possible
1932 window-system headers.
1933
1934 * nsterm.h: Remove declarations now in frame.h.
1935 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
1936
1937 * menu.c: Include TERM_HEADER instead of listing all possible
1938 window-system headers.
1939
1940 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1941 window system.
1942
1943 * keyboard.c: Include TERM_HEADER instead of listing all possible
1944 window-system headers.
1945
1946 * image.c: Include TERM_HEADER instead of listing all possible
1947 window-system headers. Declare Vlibrary_cache when compiling for
1948 Windows.
1949
1950 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1951 window system declarations.
1952
1953 * frame.h: Move common functions here: set_frame_menubar,
1954 x_set_window_size, x_sync, x_get_focus_frame,
1955 x_set_mouse_position, x_set_mouse_pixel_position,
1956 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1957 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1958 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1959 x_activate_menubar, x_real_positions, x_bitmap_icon,
1960 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1961 and x_query_colors.
1962
1963 * frame.c: Include TERM_HEADER instead of listing all possible
1964 window-system headers.
1965
1966 * font.c: Include TERM_HEADER instead of listing all possible
1967 window-system headers.
1968
1969 * emacs.c: Include TERM_HEADER.
1970
1971 * dispnew.c: Include TERM_HEADER instead of listing all possible
1972 window-system headers.
1973
1974 * ccl.h: Include character.h.
1975
1976 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1977 the current window system; include in list of objects to link into
1978 Emacs.
1979
1980 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1981
1982 Remove mark_ttys function and fix tty_display_info initialization.
1983 * lisp.h (mark_ttys): Remove prototype.
1984 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1985 to mark_ttys because all possible values of 'top_frame' slot are
1986 the frames which are reachable from Vframe_list.
1987 * term.c (mark_ttys): Remove.
1988 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1989
1990 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1991
1992 Change struct frame bitfields from unsigned char to unsigned.
1993 * frame.h (struct frame): Change type of 'display_preempted',
1994 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1995 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1996 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1997 bitfields from unsigned char to unsigned.
1998
1999 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2000
2001 Remove unused member of struct x_output and struct w32_output.
2002 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2003 * w32term.h (struct w32_output): Likewise.
2004
2005 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2006
2007 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2008 does not become zero (Bug#12234).
2009
2010 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2011
2012 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2013 for GCC 4.7.1 x86-64.
2014
2015 2012-08-30 Glenn Morris <rgm@gnu.org>
2016
2017 * lread.c (init_lread): For out-of-tree builds, only add the
2018 source directory's site-lisp dir to the load-path if it exists,
2019 consistent with in-tree builds. (Bug#12302)
2020
2021 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2022
2023 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2024 button_values to NULL. Call setStykeMask so dialogs get a close button.
2025 (windowShouldClose:): Set window_closed.
2026 (dealloc): New member, free button_values.
2027 (process_dialog:): Make member function. Remove window argument,
2028 replace window with self. Count buttons and allocate and store values
2029 in button_values.
2030 (addButton:value:row:): value is int with the name tag. Call setTag
2031 with tag. Remove return self, declare return value as void.
2032 (addString:row:): Remove return self, declare return value as void.
2033 (addSplit): Remove return self, declare return value as void.
2034 (clicked:): Remove return self, declare return value as void.
2035 Set dialog_return to button_values[seltag]. Code formatting change.
2036 (initFromContents:isQuestion:): Adjust call to process_dialog.
2037 Code formatting change.
2038 (timeout_handler:): Set timer_fired to YES.
2039 (runDialogAt:): Set timer_fired to NO.
2040 Handle click on close button as quit.
2041
2042 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2043 Add window_closed and button_values. Add void as return value for
2044 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2045 Add process_dialog as new member.
2046
2047 2012-08-28 Eli Zaretskii <eliz@gnu.org>
2048
2049 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2050 is not one of the heaps we manage. (Bug#12242)
2051
2052 2012-08-28 Glenn Morris <rgm@gnu.org>
2053
2054 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2055
2056 2012-08-28 Martin Rudalics <rudalics@gmx.at>
2057
2058 * window.c (Fset_window_configuration): Remove handling of
2059 auto-buffer-name window parameter. Install revision of reverted
2060 fix.
2061
2062 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2063
2064 Do not allow to set major mode for a dead buffer.
2065 * buffer.c (Fset_buffer_major_mode): Signal an error
2066 if the buffer is dead.
2067 (Fother_buffer, other_buffer_safely): Remove redundant
2068 nested declaration.
2069
2070 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2071
2072 Always use set_buffer_if_live to restore original buffer at unwind.
2073 * buffer.h (record_unwind_current_buffer): New function.
2074 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2075 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2076 * undo.c, window.c: Adjust users.
2077 * buffer.c (set_buffer_if_live): Fix comment.
2078
2079 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2080
2081 Fix usage of set_buffer_internal.
2082 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2083 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2084 * coding.c (decode_coding): Omit redundant test.
2085 * fileio.c (decide_coding_unwind): Likewise.
2086 * fns.c (secure_hash): Likewise.
2087 * insdel.c (modify_region): Likewise.
2088 * keyboard.c (command_loop_1): Likewise.
2089 * print.c (PRINTFINISH): Likewise.
2090 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2091
2092 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2093
2094 * dispnew.c: Use bool for boolean.
2095 (frame_garbaged, display_completed, delayed_size_change)
2096 (fonts_changed_p, add_window_display_history)
2097 (add_frame_display_history, verify_row_hash)
2098 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2099 (row_equal_p, realloc_glyph_pool)
2100 (allocate_matrices_for_frame_redisplay)
2101 (showing_window_margins_p)
2102 (adjust_frame_glyphs_for_frame_redisplay)
2103 (build_frame_matrix_from_leaf_window, make_current)
2104 (mirrored_line_dance, mirror_line_dance, update_frame)
2105 (update_window_tree, update_single_window)
2106 (check_current_matrix_flags, update_window, update_text_area)
2107 (update_window_line, set_window_update_flags, scrolling_window)
2108 (update_frame_1, scrolling, buffer_posn_from_coords)
2109 (do_pending_window_change, change_frame_size)
2110 (change_frame_size_1, sit_for):
2111 Use bool for boolean.
2112 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2113 and remove last int (actually boolean) argument, which was always 0.
2114 All callers changed.
2115 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2116 * dispextern.h (struct composition_it): Use bool for boolean.
2117 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2118 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2119 * dired.c (file_name_completion):
2120 Use bool for boolean. (This was missed in an earlier change.)
2121
2122 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2123
2124 * window.c (Fset_window_configuration): Revert first part of
2125 last change.
2126
2127 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2128
2129 * nsterm.h (NSPanel): New class variable dialog_return.
2130
2131 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2132 Initialize dialog_return.
2133 (windowShouldClose:): Use stop instead of stopModalWithCode.
2134 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2135 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2136 event.
2137 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2138 modal loop returns.
2139
2140 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2141
2142 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2143 * composite.c (find_composition, composition_gstring_p)
2144 (composition_reseat_it, find_automatic_composition):
2145 * data.c (let_shadows_buffer_binding_p)
2146 (let_shadows_global_binding_p, set_internal, make_blv)
2147 (Fmake_variable_buffer_local, Fmake_local_variable)
2148 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2149 (cons_to_signed, arith_driver):
2150 * dbusbind.c (xd_in_read_queued_messages):
2151 * dired.c (directory_files_internal, file_name_completion):
2152 Use bool for booleans.
2153 * dired.c (file_name_completion):
2154 * process.h (fd_callback):
2155 Omit int (actually boolean) argument. It wasn't being used.
2156 All uses changed.
2157 * composite.h, lisp.h: Reflect above API changes.
2158
2159 * cmds.c, coding.c: Use bool for booleans.
2160 * cmds.c (move_point, Fself_insert_command):
2161 * coding.h (struct composition status, struct coding_system):
2162 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2163 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2164 (emacs_mule_char, decode_coding_emacs_mule)
2165 (encode_coding_emacs_mule, detect_coding_iso_2022)
2166 (decode_coding_iso_2022, encode_invocation_designation)
2167 (encode_designation_at_bol, encode_coding_iso_2022)
2168 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2169 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2170 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2171 (encode_coding_raw_text, detect_coding_charset)
2172 (decode_coding_charset, encode_coding_charset, detect_eol)
2173 (detect_coding, get_translation_table, produce_chars)
2174 (consume_chars, reused_workbuf_in_use)
2175 (make_conversion_work_buffer, code_conversion_save)
2176 (decode_coding_object, encode_coding_object)
2177 (detect_coding_system, char_encodable_p)
2178 (Funencodable_char_position, code_convert_region)
2179 (code_convert_string, code_convert_string_norecord)
2180 (Fset_coding_system_priority):
2181 * fileio.c (Finsert_file_contents):
2182 Use bool for booleans.
2183 * coding.h, lisp.h: Reflect above API changes.
2184 * coding.c: Remove unnecessary static function decls.
2185 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2186 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2187 not a boolean 'int', since callers never look at the return value.
2188 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2189 * coding.h (decoding_buffer_size, encoding_buffer_size)
2190 (emacs_mule_string_char): Remove unused extern decls.
2191 (struct iso_2022_spec, struct coding_system):
2192 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2193 (struct emacs_mule_spec): Remove unused field 'full_support'.
2194 All initializations removed.
2195 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2196
2197 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2198
2199 Fix spare memory change (Bug#12286).
2200 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2201 (valid_lisp_object_p): Likewise.
2202
2203 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2204
2205 * window.c (Fset_window_configuration): Record any window's old
2206 buffer if it's replaced (see Bug#8789). If the new current
2207 buffer doesn't appear in the selected window, go to its old
2208 point (Bug#12208).
2209
2210 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2211
2212 Special MEM_TYPE_SPARE to denote reserved memory.
2213 * alloc.c (enum mem_type): New memory type.
2214 (refill_memory_reserve): Use new type for spare memory.
2215 This prevents live_cons_p and live_string_p from incorrect
2216 detection of uninitialized objects from spare memory as live.
2217
2218 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2219
2220 Spelling fixes.
2221 * Makefile.in (.PHONY): versioclean -> versionclean.
2222
2223 Remove unused external symbols.
2224 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2225 * window.c (Qwindow_valid_p, decode_valid_window):
2226 Now static, not extern.
2227 * data.c (Qinterval): Remove; unused.
2228 (syms_of_data): Do not define 'interval'.
2229 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2230 * window.h (decode_valid_window):
2231 Remove decls.
2232
2233 * character.c, charset.c, chartab.c: Use bool for booleans.
2234 * character.c (lisp_string_width, string_count_byte8)
2235 (string_escape_byte8):
2236 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2237 (load_charset_map_from_file, map_charset_chars)
2238 (Fdefine_charset_internal, define_charset_internal)
2239 (Fdeclare_equiv_charset, find_charsets_in_text)
2240 (Ffind_charset_region, char_charset, Fiso_charset):
2241 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2242 (sub_char_table_set, sub_char_table_set_range)
2243 (char_table_set_range, optimize_sub_char_table)
2244 (map_sub_char_table):
2245 Use bool for boolean.
2246 * character.c (str_to_unibyte): Omit last boolean argument; it was
2247 always 0. All callers changed.
2248 * character.h, charset.h: Adjust to match previous changes.
2249 * character.h (char_printable_p): Remove decl of nonexistent function.
2250 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2251 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2252 are all boolean, so make them single-bit bitfields.
2253
2254 * lisp.h (ASET): Remove attempt to detect side effects.
2255 It was meant to be temporary and it often doesn't work,
2256 because when IDX has side effects the behavior of IDX==IDX
2257 is undefined. See Stefan Monnier in
2258 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2259
2260 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2261
2262 * lisp.h (functionp): New function (extracted from Ffunctionp).
2263 (FUNCTIONP): Use it.
2264 * eval.c (Ffunctionp): Use it.
2265
2266 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2267
2268 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2269 as that's faster and simpler than static storage. Don't bother
2270 with the g_main_context_query overhead if g_main_context_pending
2271 says no events are pending.
2272 (gfds, gfds_size): Remove these static vars.
2273 (xgselect_initialize): Remove; no longer needed.
2274 All uses and decls removed.
2275
2276 * emacs.c (fatal_error_signal_hook): Remove.
2277 All uses removed. This leftover from old code was always 0.
2278
2279 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2280 * casefiddle.c (casify_object, casify_region):
2281 * casetab.c (set_case_table):
2282 * category.c, category.h (word_boundary_p):
2283 * category.h (CHAR_HAS_CATEGORY):
2284 Use bool for booleans, instead of int.
2285
2286 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2287
2288 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2289
2290 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2291
2292 On assertion failure, print backtrace if available.
2293 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2294 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2295 * Makefile.in (LIB_EXECINFO): New macro.
2296 (LIBES): Use it.
2297
2298 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2299 * bytecode.c (exec_byte_code):
2300 * callint.c (check_mark, Fcall_interactively):
2301 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2302 (getenv_internal, sync_process_alive, call_process_exited):
2303 * lisp.h (USE_SAFE_ALLOCA):
2304 Use bool for booleans, instead of int.
2305 * lisp.h, process.h: Adjust prototypes to match above changes.
2306 * callint.c (Fcall_interactively): Don't assume the mark's
2307 offset fits in 'int'.
2308
2309 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2310
2311 * buffer.c, buffer.h: Use bool for boolean.
2312 * buffer.c (reset_buffer_local_variables)
2313 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2314 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2315 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2316 (overlay_touches_p, overlay_strings, Foverlay_put)
2317 (report_overlay_modification, call_overlay_mod_hooks):
2318 (mmap_enlarge, mmap_set_vars):
2319 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2320 Use bool for booleans, instead of int.
2321 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2322 since the 1-or-0 return value is always ignored anyway.
2323 (mmap_initialized_p):
2324 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2325 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2326
2327 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2328
2329 * bidi.c: Use bool for boolean.
2330 This is a bit more readable, and makes the text segment of bidi.o
2331 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2332 Presumably it's faster too.
2333 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2334 Now bool.
2335 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2336 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2337 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2338 (bidi_explicit_dir_char, bidi_level_of_next_char)
2339 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2340 Use bool for booleans, instead of int.
2341 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2342 (bidi_unshelve_cache): Adjust decls to match code.
2343
2344 2012-08-23 Martin Rudalics <rudalics@gmx.at>
2345
2346 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2347 argument.
2348
2349 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2350
2351 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2352 * atimer.h: Include <stdbool.h>.
2353
2354 2012-08-22 Dan Nicolaescu <dann@gnu.org>
2355
2356 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2357 compile time tests instead of run time tests on systems that do
2358 not use them.
2359 (FRAME_MAC_P): Remove leftover from deleted code.
2360 * frame.c (syms_of_frame): Remove leftover from deleted code.
2361
2362 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2363
2364 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2365
2366 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2367
2368 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2369 Otherwise, the compiler complains about (A?B:C) where B is void
2370 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2371 (fontset_add): Return void, for FONTSET_ADD.
2372
2373 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2374
2375 * alloc.c: Use bool for booleans.
2376 (gc_in_progress, abort_on_gc)
2377 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2378 (dont_register_blocks) [GC_MALLOC_CHECK]:
2379 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2380 (check_string_bytes, make_specified_string, memory_full)
2381 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2382 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2383 (mark_stack, valid_pointer_p, make_pure_string)
2384 (Fgarbage_collect, survives_gc_p, gc_sweep):
2385 Use bool for booleans, instead of int.
2386 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2387 Remove unused local.
2388 * alloc.c (PURE_POINTER_P):
2389 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2390 * editfns.c (Fformat):
2391 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2392 (Fdo_auto_save):
2393 * fns.c (sweep_weak_table):
2394 * lisp.h (suppress_checking, push_message, survives_gc_p)
2395 (make_pure_string, gc_in_progress, abort_on_gc):
2396 * lread.c (readchar, read1):
2397 * print.c (Fprin1_to_string):
2398 * xdisp.c (push_message):
2399 Use bool for booleans affected directly or indirectly by
2400 alloc.c's changes.
2401
2402 Make recently-introduced setters macros.
2403 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2404 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2405 (set_fontset_default, set_fontset_fallback): Rename from their
2406 upper-case counterparts, and make them functions rather than macros.
2407 This is more consistent with the other recently-introduced setters.
2408 These don't need to be inline, since they're local.
2409
2410 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2411
2412 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2413 the loop (Bug#12247).
2414
2415 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2416
2417 * lisp.h (vcopy): Use memcpy rather than our own loop.
2418 This fixes a performance regression introduced by the recent
2419 addition of vcopy. This means 'vcopy' will need to be modified
2420 for a copying collector, but that's OK. Also, tighten the
2421 checking in the assertion.
2422
2423 2012-08-21 Eli Zaretskii <eliz@gnu.org>
2424
2425 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2426 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2427 non-base glyph for the width of the base character, according to
2428 what x_draw_composite_glyph_string_foreground expects.
2429 Generate WADJUST value according to composition_gstring_width's
2430 expectations, to produce correct width of the composed character.
2431 Reverse the sign of the DU offset produced by ScriptPlace.
2432
2433 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2434
2435 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2436
2437 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2438
2439 Avoid direct writes to contents member of struct Lisp_Vector.
2440 * lisp.h (vcopy): New function to copy data into vector.
2441 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2442 * fns.c (Ffillarray): Use ASET.
2443 * keyboard.c (timer_check_2): Use AREF and ASET.
2444 (append_tool_bar_item, Frecent_keys): Use vcopy.
2445 * lread.c (read_vector): Use ASET.
2446 * msdos.c (Frecent_doskeys): Use vcopy.
2447 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2448 (Finternal_merge_in_global_face): Use ASET and vcopy.
2449 * xfont.c (xfont_list_pattern): Likewise.
2450
2451 2012-08-21 Martin Rudalics <rudalics@gmx.at>
2452
2453 * window.c (Fwindow_point): For the selected window always return
2454 the position of its buffer's point.
2455 (Fset_window_point): For the selected window always go in its
2456 buffer to the specified position.
2457
2458 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2459
2460 Setter macros for fontsets.
2461 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2462 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2463 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2464 Adjust users.
2465
2466 2012-08-20 Glenn Morris <rgm@gnu.org>
2467
2468 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2469 Don't assume that `ln -f' works.
2470
2471 2012-08-20 Eli Zaretskii <eliz@gnu.org>
2472
2473 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2474 and later about non-assignments with no effect. See discussion at
2475 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2476 details.
2477
2478 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2479
2480 Inline setter functions for Lisp_Objects slots of struct specbinding.
2481 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2482 Adjust users.
2483
2484 2012-08-20 Martin Rudalics <rudalics@gmx.at>
2485
2486 * window.c (select_window): Always make selected window's buffer
2487 current.
2488
2489 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2490
2491 Use AREF and ASET for docstrings of category tables.
2492 * category.h (CATEGORY_DOCSTRING): Use AREF.
2493 (SET_CATEGORY_DOCSTRING): Use ASET.
2494 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2495
2496 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2497
2498 Inline setter functions for hash table members.
2499 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2500 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2501 (set_hash_key_and_value, set_hash_index, set_hash_next)
2502 (set_hash_hash): New functions.
2503 * charset.c, fns.c: Adjust users.
2504
2505 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2506
2507 Inline getter and setter functions for per-buffer values.
2508 * buffer.h (per_buffer_default, set_per_buffer_default)
2509 (per_buffer_value, set_per_buffer_value): New functions.
2510 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2511 * buffer.c, data.c: Adjust users.
2512
2513 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
2514
2515 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2516
2517 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2518
2519 Rely on <config.h> + <unistd.h> to declare 'environ',
2520 as gnulib does this if the system doesn't.
2521 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2522 Remove declaration. MS-Windows declares it on stdlib.h which is
2523 included by conf_post.h.
2524 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2525 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2526 * vm-limit.c: Include <unistd.h>, for 'environ'.
2527
2528 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2529 (start_of_data): Remove decl; mem-limits.h provides it.
2530
2531 * xdisp.c (handle_invisible_prop): Make it a bit faster
2532 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2533
2534 2012-08-19 Chong Yidong <cyd@gnu.org>
2535
2536 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2537 ends (Bug#3874).
2538
2539 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2540
2541 * .gdbinit: Use call instead of set when calling a function in the
2542 inferior.
2543
2544 * data.c (set_internal): Don't use set_blv_found.
2545 (Fkill_local_variable): Likewise.
2546
2547 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2548
2549 * nsfont.m (ns_ascii_average_width): Ensure the string
2550 ascii_printable is initialized with a null-terminated character
2551 array. Otherwise, it can contain undesired extra characters.
2552
2553 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2554
2555 port new setting code to Sun C 5.8 2005/10/13
2556 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2557 Return void, not Lisp_Object. Otherwise, the compiler
2558 complains about (A?B:C) where B is void and C is Lisp_Object
2559 when compiling CHAR_TABLE_SET, due to the recent change to
2560 the API of sub_char_table_set_contents.
2561
2562 2012-08-18 Chong Yidong <cyd@gnu.org>
2563
2564 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2565 for the string case (Bug#3874).
2566
2567 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2568
2569 * buffer.h (BSET): Remove (Bug#12215).
2570 Replace all uses with calls to new setter functions.
2571 (bset_bidi_paragraph_direction, bset_case_canon_table)
2572 (bset_case_eqv_table, bset_directory, bset_display_count)
2573 (bset_display_time, bset_downcase_table)
2574 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2575 (bset_last_selected_window, bset_local_var_alist)
2576 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2577 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2578 (bset_width_table):
2579 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2580 (bset_auto_fill_function, bset_auto_save_file_format)
2581 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2582 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2583 (bset_cache_long_line_scans, bset_case_fold_search)
2584 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2585 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2586 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2587 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2588 (bset_header_line_format, bset_indicate_buffer_boundaries)
2589 (bset_indicate_empty_lines, bset_invisibility_spec)
2590 (bset_left_fringe_width, bset_major_mode, bset_mark)
2591 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2592 (bset_name, bset_overwrite_mode, bset_pt_marker)
2593 (bset_right_fringe_width, bset_save_length)
2594 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2595 (bset_scroll_up_aggressively, bset_selective_display)
2596 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2597 (bset_word_wrap, bset_zv_marker):
2598 * category.c (bset_category_table):
2599 * syntax.c (bset_syntax_table):
2600 New setter functions.
2601
2602 * process.h (PSET): Remove (Bug#12215).
2603 Replace all uses with calls to new setter functions.
2604 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2605 (PROCESS_INLINE): New macro.
2606 (pset_childp): New setter function.
2607 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2608 * process.c (PROCESS_INLINE):
2609 Define to EXTERN_INLINE, so that the corresponding functions
2610 are compiled into code.
2611 (pset_buffer, pset_command, pset_decode_coding_system)
2612 (pset_decoding_buf, pset_encode_coding_system)
2613 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2614 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2615 (pset_type, pset_write_queue): New setter functions.
2616
2617 * window.h (WSET): Remove (Bug#12215).
2618 Replace all uses with calls to new setter functions.
2619 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2620 (WINDOW_INLINE): New macro.
2621 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2622 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2623 (wset_total_lines, wset_vertical_scroll_bar)
2624 (wset_window_end_pos, wset_window_end_valid)
2625 (wset_window_end_vpos): New setter functions.
2626 * window.c (WINDOW_INLINE):
2627 Define to EXTERN_INLINE, so that the corresponding functions
2628 are compiled into code.
2629 (wset_combination_limit, wset_dedicated, wset_display_table)
2630 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2631 (wset_new_normal, wset_new_total, wset_next_buffers)
2632 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2633 (wset_prev_buffers, wset_right_fringe_width)
2634 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2635 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2636 (wset_window_parameters):
2637 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2638 (wset_column_number_displayed, wset_region_showing):
2639 New setter functions.
2640
2641 * termhooks.h (TSET): Remove (Bug#12215).
2642 Replace all uses with calls to new setter functions.
2643 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2644 (TERMHOOKS_INLINE): New macro.
2645 (tset_charset_list, tset_selection_alist): New setter functions.
2646 * terminal.c (TERMHOOKS_INLINE):
2647 Define to EXTERN_INLINE, so that the corresponding functions
2648 are compiled into code.
2649 (tset_param_alist): New setter function.
2650
2651 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2652
2653 * keyboard.h (KSET): Remove (Bug#12215).
2654 Replace all uses with calls to new setter functions.
2655 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2656 (KEYBOARD_INLINE): New macro.
2657 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2658 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2659 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2660 New setter functions.
2661 * keyboard.c (KEYBOARD_INLINE):
2662 Define to EXTERN_INLINE, so that the corresponding functions
2663 are compiled into code.
2664 (kset_echo_string, kset_kbd_queue)
2665 (kset_keyboard_translate_table, kset_last_prefix_arg)
2666 (kset_last_repeatable_command, kset_local_function_key_map)
2667 (kset_overriding_terminal_local_map, kset_real_last_command)
2668 (kset_system_key_syms): New setter functions.
2669
2670 * frame.h (FSET): Remove (Bug#12215).
2671 Replace all uses with calls to new setter functions.
2672 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2673 (FRAME_INLINE): New macro.
2674 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2675 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2676 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2677 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2678 (fset_param_alist, fset_root_window, fset_scroll_bars)
2679 (fset_selected_window, fset_title, fset_tool_bar_items)
2680 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2681 * frame.c (FRAME_INLINE):
2682 Define to EXTERN_INLINE, so that the corresponding functions
2683 are compiled into code.
2684 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2685
2686 A few more naming-convention fixes for getters and setters.
2687 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2688 and rename from buffer_overlays_set_before.
2689 (set_buffer_overlays_after): Move here from buffer.h, and rename
2690 from buffer_overlays_set_after.
2691 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2692 All uses changed.
2693 (set_buffer_intervals): Rename from buffer_set_intervals.
2694 * intervals.c (set_interval_object): Move here from intervals.h,
2695 and rename from interval_set_object.
2696 (set_interval_left): Move here from intervals.h, and rename from
2697 interval_set_left.
2698 (set_interval_right): Move here from intervals.h, and rename from
2699 interval_set_right.
2700 (copy_interval_parent): Move here from intervals.h, and rename from
2701 interval_copy_parent.
2702 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2703 (set_interval_plist): Rename from interval_set_plist.
2704 Return void, not Lisp_Object, since no caller uses the result.
2705 * lisp.h (string_intervals): Rename from string_get_intervals.
2706 (set_string_intervals): Rename from string_set_intervals.
2707
2708 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2709 (set_char_table_contents): Rename from char_table_set_contents.
2710 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2711 All uses changed. See the end of
2712 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2713
2714 * lisp.h (CSET): Remove (Bug#12215).
2715 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2716 (set_char_table_purpose): New functions,
2717 replacing CSET. All uses changed. For example, replace
2718 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2719 "set_char_table_parent (char_table, parent);".
2720 The old version was confusing because it used the same name
2721 'parent' for two different things.
2722
2723 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2724
2725 Functions to get and set Lisp_Object fields of buffer-local variables.
2726 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2727 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2728 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2729 * data.c, eval.c, frame.c: Adjust users.
2730
2731 2012-08-17 Chong Yidong <cyd@gnu.org>
2732
2733 * xfaces.c (merge_face_vectors): If the target font specfies a
2734 font spec, make the font's attributes take precedence over
2735 directly-specified attributes.
2736 (merge_face_ref): Recognize :font.
2737
2738 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2739
2740 Do not use memcpy for copying intervals.
2741 * intervals.c (reproduce_interval): New function.
2742 (reproduce_tree, reproduce_tree_obj): Use it.
2743 (reproduce_tree_obj): Remove prototype.
2744
2745 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2746
2747 * lisp.h (duration_to_sec_usec): Remove unused decl.
2748
2749 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2750
2751 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2752 to an allocated instance of NSString, not to the class itself.
2753
2754 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
2755
2756 * makefile.w32-in (C_CTYPE_H): New macro.
2757 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2758 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2759 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2760
2761 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2762
2763 Use ASCII tests for character types.
2764 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2765 * xfns.c, xterm.c:
2766 Don't include <ctype.h>; was not needed.
2767 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2768 * sysdep.c, xfaces.c:
2769 Include <c-ctype.h> instead of <ctype.h>.
2770 * nsterm.m: Include <c-ctype.h>.
2771 * charset.c (read_hex):
2772 * doc.c (Fsnarf_documentation):
2773 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2774 (DRIVE_LETTER) [DOS_NT]:
2775 (Ffile_name_directory, Fexpand_file_name)
2776 (Fsubstitute_in_file_name):
2777 * font.c (font_parse_xlfd, font_parse_fcname):
2778 * frame.c (x_set_font_backend):
2779 * gtkutil.c (xg_get_font):
2780 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2781 * nsimage.m (hexchar):
2782 * nsterm.m (ns_xlfd_to_fontname):
2783 * sysdep.c (system_process_attributes):
2784 * xfaces.c (hash_string_case_insensitive):
2785 Use C-locale tests instead of locale-specific tests for character
2786 types, since we want the ASCII interpretation here, not the
2787 interpretation suitable for whatever happens to be the current locale.
2788
2789 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2790
2791 Consistently check windows for validity/liveness
2792 (Bug#11984, Bug#12025, Bug#12026).
2793 * lisp.h (CHECK_VALID_WINDOW): New macro.
2794 * window.c (decode_window): Rename to decode_live_window.
2795 (decode_valid_window, Fwindow_valid_p): New functions.
2796 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2797 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2798 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2799 (Fwindow_prev_sibling, Fwindow_combination_limit)
2800 (Fset_window_combination_limit, Fwindow_use_time)
2801 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2802 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2803 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2804 (Fwindow_hscroll, Fset_window_hscroll)
2805 (Fwindow_redisplay_end_trigger)
2806 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2807 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2808 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2809 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2810 (Fwindow_end, Fset_window_point, Fset_window_start)
2811 (Fpos_visible_in_window_p, Fwindow_line_height)
2812 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2813 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2814 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2815 (Fset_window_parameter, Fwindow_display_table)
2816 (Fset_window_display_table, Fdelete_other_windows_internal)
2817 (Fset_window_buffer, Fset_window_new_total)
2818 (Fset_window_new_normal, Fdelete_window_internal)
2819 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2820 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2821 (Fwindow_scroll_bars): Check whether argument window is a valid or
2822 live window. Update doc-strings.
2823 (syms_of_window): New symbol Qwindow_valid_p.
2824 * keyboard.c (Fposn_at_x_y): Check whether argument
2825 frame_or_window denotes a valid window.
2826
2827 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2828
2829 Fix previous char table change.
2830 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2831 * chartab.c (optimize_sub_char_table): Likewise.
2832
2833 2012-08-16 Chong Yidong <cyd@gnu.org>
2834
2835 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2836
2837 * xfont.c (xfont_open):
2838 * xftfont.c (xftfont_open): Set the font's max_width field.
2839
2840 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2841 min_width to space_width and average_width to the average over
2842 printable ASCII characters.
2843 (ns_char_width): Code cleanup.
2844 (ns_ascii_average_width): New utility function.
2845
2846 * font.h (struct font): Update comments.
2847
2848 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2849
2850 Simple interface to set Lisp_Object fields of character tables.
2851 * lisp.h (CSET): New macro.
2852 (char_table_set_extras, char_table_set_contents)
2853 (sub_char_table_set_contents): New function.
2854 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2855 * syntax.c: Adjust users.
2856
2857 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2858
2859 * eval.c (eval_sub): Bind lexical-binding.
2860 * lread.c (Qlexical_binding): Make non-static.
2861
2862 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2863
2864 * nsmenu.m (popupSession): Remove.
2865 (pop_down_menu): Remove endModalSession.
2866 (timeout_handler:): New method.
2867 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2868 Call runModalForWindow. Check timer_fired when it returns.
2869 If not set, cancel timer and break out of loop.
2870 Otherwise loop again, with a new timeout.
2871
2872 * nsterm.m: Include fcntl.h if present.
2873 (fd_entry, t_readfds, inNsSelect): Remove.
2874 (select_writefds, select_valid, select_timeout, selfds)
2875 (select_mutex, apploopnr): Add.
2876 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2877 Otherwise call kbd_buffer_store_event.
2878 (ns_send_appdefined): Remove release of fd_entry.
2879 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2880 Increment and decrement apploopnr.
2881 (ns_select): If no file descriptors, just do a NSTimer.
2882 Otherwise copy read/write masks and start select thread (fd_handler).
2883 Start main loop and wait for application defined event.
2884 Inform select thread to stop selecting after main loop is exited.
2885 (ns_term_init): Create selfds pipe and set non-blocking.
2886 Initialize select_mutex. Start the select thread (fd_handler).
2887 (fd_handler:): Loop forever, wait for info from the main thread
2888 to either start or stop selecting. When select returns, send
2889 and appdefined event.
2890 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2891 If not call kbd_buffer_store_event.
2892
2893 * nsterm.h (EmacsApp): fd_handler takes id argument.
2894 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2895
2896 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2897
2898 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2899
2900 * region-cache.c (move_cache_gap): Update gap_len using the actual
2901 growth of the boundaries array. Do not change cache_len.
2902 (Bug#12196)
2903
2904 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2905
2906 Generalize and cleanup font subsystem checks.
2907 * font.h (FONT_DEBUG, font_assert): Remove.
2908 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2909 Change font_assert to eassert. Use eassert where appropriate.
2910
2911 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2912
2913 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2914
2915 2012-08-15 Chong Yidong <cyd@gnu.org>
2916
2917 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2918 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2919 extract the font descriptor instead of just the font name.
2920 In that case, return a font spec instead of a string.
2921 (x_last_font_name): Move to this file from xfns.c.
2922
2923 * xfns.c (Fx_select_font): The return value can also be a font
2924 spec. Move x_last_font_name management to gtkutil.c.
2925
2926 * xfaces.c: Make font weight and style symbols non-static.
2927
2928 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2929
2930 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2931 (bug#12117).
2932
2933 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2934
2935 * alloc.c (Fgarbage_collect): Use plural form consistently.
2936
2937 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2938
2939 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2940 iteration through the command loop. Fixes a problem whereby mouse
2941 movements are ignored until the first mouse click.
2942
2943 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2944
2945 Use bool, not int, for Lisp booleans.
2946 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2947 makes Emacs a bit smaller and presumably a bit faster.
2948 * lisp.h: Include <stdbool.h>.
2949 (struct Lisp_Boolfwd, defvar_bool):
2950 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2951 * regex.c [!emacs]: Include <stdbool.h>.
2952 (false, true): Remove; <stdbool.h> does this for us now.
2953
2954 2012-08-14 Chong Yidong <cyd@gnu.org>
2955
2956 * character.c (Fcharacterp): Doc fix (Bug#12076).
2957
2958 * data.c (Findirect_variable): Doc fix (Bug#11040).
2959
2960 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2961
2962 * editfns.c (Fformat): Doc fix (Bug#12059).
2963 (Fsave_current_buffer): Doc fix (Bug#11542).
2964
2965 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2966
2967 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2968 (bug#12022).
2969
2970 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2971
2972 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2973 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2974 * minibuf.c (choose_minibuf_frame, read_minibuf):
2975 * w32fns.c (x_create_tip_frame):
2976 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2977 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2978
2979 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2980
2981 * intervals.c (offset_intervals): Remove obsolete comment.
2982
2983 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2984
2985 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2986
2987 2012-08-14 Gergely Risko <gergely@risko.hu>
2988
2989 * coding.c (decode_coding): Record buffer modification before
2990 disabling undo_list (Bug#11773).
2991
2992 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2993
2994 Revert and cleanup some recent overlay changes.
2995 * buffer.h (enum overlay_type): Remove.
2996 (buffer_get_overlays, buffer_set_overlays): Likewise.
2997 (buffer_set_overlays_before, buffer_set_overlays_after):
2998 New function. Adjust users.
2999 (unchain_both): Add eassert.
3000
3001 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3002
3003 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3004
3005 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3006
3007 * gtkutil.c (xg_mark_data): Don't assume C99.
3008
3009 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3010
3011 * gtkutil.c (xg_frame_tb_info): New struct.
3012 (TB_INFO_KEY): New define.
3013 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3014 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3015 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3016 if not present.
3017 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3018 is up to date. Otherwise store new data.
3019 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3020
3021 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3022
3023 Use KSET for write access to Lisp_Object members of struct kboard.
3024 * keyboard.h (KSET): New macro.
3025 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3026 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3027 * xterm.c: Adjust users.
3028
3029 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3030
3031 Use BSET for write access to Lisp_Object members of struct buffer.
3032 * buffer.h (BSET): New macro.
3033 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3034 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3035 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3036 * window.c, xdisp.c, xfns.c: Adjust users.
3037
3038 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3039
3040 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3041
3042 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3043
3044 * nsterm.m (not_in_argv): New function.
3045 (application:openFile, application:openTempFile:):
3046 (application:openFileWithoutUI:, application:openFiles:): Open file
3047 if not_in_argv returns non-zero (bug#12171).
3048
3049 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3050 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3051 Define for Gtk+ versions less than 3.2.
3052 (xg_get_font_name): Use those functions/macros here.
3053 Reported by Frans Oilinki <moilinki@gmail.com>.
3054
3055 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3056
3057 * unexmacosx.c (copy_data_segment): Copy initialized data in
3058 statically linked libraries from input file rather than memory.
3059
3060 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3061 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3062 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3063
3064 2012-08-10 Glenn Morris <rgm@gnu.org>
3065
3066 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3067 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3068
3069 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3070
3071 Fix last change to allow compilation with low optimization levels.
3072 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3073 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3074
3075 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3076
3077 Use common inline syntax in intervals.h.
3078 * intervals.h (INTERVALS_INLINE): New macro.
3079 Change all users from LISP_INLINE.
3080
3081 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3082
3083 Define Qnone once for all platforms.
3084 * frame.c (Qnone): Define here.
3085 (syms_of_frame): DEFSYM it.
3086 * lisp.h (Qnone): New declaration.
3087 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3088 * xfns.c: Remove duplication. Adjust users.
3089
3090 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3091
3092 Remove unused macros from intervals.h.
3093 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3094 * intervals.c: Adjust comment.
3095
3096 2012-08-10 Eli Zaretskii <eliz@gnu.org>
3097
3098 * w32fns.c <w32_unicode_gui>: New static variable.
3099 (globals_of_w32fns): Initialize it according to os_subtype.
3100 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3101 testing os_subtype.
3102
3103 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
3104 Eli Zaretskii <eliz@gnu.org>
3105
3106 Fix bug #10299 with Unicode characters sent by customized
3107 keyboards created by MSKLC.
3108 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3109 (w32_init_class): Use it to initialize the Emacs class with either
3110 ANSI or Unicode API calls.
3111 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3112 later.
3113 (w32_wnd_proc): If the character code sent by WM_CHAR or
3114 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3115 original message. Call DefWindowProcW on NT and later.
3116
3117 2012-08-10 Glenn Morris <rgm@gnu.org>
3118
3119 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3120
3121 * lisp.h (DIRECTORY_SEP): Let configure set it.
3122
3123 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3124
3125 Use TSET for write access to Lisp_Object slots of struct terminal.
3126 * termhooks.h (TSET): New macro.
3127 * coding.c, terminal.c, xselect.c: Adjust users.
3128
3129 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3130
3131 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3132 the failing expression, include them in the error message.
3133 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3134 * lisp.h (internal_condition_case_n): Update declaration.
3135
3136 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3137
3138 Inline functions to examine and change buffer overlays.
3139 * buffer.c (unchain_both): New function.
3140 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3141 (buffer_has_overlays): New function.
3142 (enum overlay_type): New enum.
3143 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3144 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3145
3146 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3147
3148 Inline functions to examine and change buffer intervals.
3149 * alloc.c (mark_interval_tree): Remove.
3150 (MARK_INTERVAL_TREE): Simplify.
3151 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3152 * intervals.c (buffer_balance_intervals): New function.
3153 (graft_intervals_into_buffer): Adjust indentation.
3154 (set_intervals_multibyte): Simplify.
3155 * buffer.h (BUF_INTERVALS): Remove.
3156 (buffer_get_intervals, buffer_set_intervals): New function.
3157 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3158 * intervals.c, textprop.c: Adjust users.
3159
3160 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3161
3162 Inline functions to examine and change string intervals.
3163 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3164 (string_get_intervals, string_set_intervals): New function.
3165 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3166 * lread.c, print.c, textprop.c: Adjust users.
3167
3168 2012-08-08 Glenn Morris <rgm@gnu.org>
3169
3170 * lisp.mk (lisp): Remove language/persian.elc.
3171
3172 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3173
3174 Cleanup intervals.
3175 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3176 (NULL_INTERVAL_P): Likewise. Adjust users.
3177 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3178 Adjust comment. Move under #if 0.
3179 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3180 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3181
3182 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3183
3184 Check total length of intervals with eassert.
3185 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3186 * intervals.c: Change all users to eassert.
3187
3188 2012-08-07 Eli Zaretskii <eliz@gnu.org>
3189
3190 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3191 Rename fields to match removal of FGET and WGET and disuse of
3192 INTERNAL_FIELD in Lisp_Cons.
3193
3194 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3195
3196 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3197 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3198 name since all xname users are fixed long time ago. Do not
3199 use INTERNAL_FIELD.
3200 (set_symbol_name, set_symbol_function, set_symbol_plist):
3201 (set_symbol_next, set_overlay_plist): New function.
3202 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3203 (struct Lisp_Overlay): Likewise.
3204 (CVAR, MVAR, SVAR): Remove.
3205 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3206 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3207 * xterm.c: Adjust users.
3208 * .gdbinit: Change to use name field of struct Lisp_Symbol
3209 where appropriate.
3210
3211 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3212
3213 Basic functions to set Lisp_Object and pointer slots of intervals.
3214 * intervals.h (interval_set_parent, interval_set_object):
3215 (interval_set_left, interval_set_right, interval_set_plist):
3216 (interval_copy_parent): New function.
3217 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
3218 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3219 Adjust indentation.
3220 (INTERVAL_SIZE): Remove. Adjust users.
3221 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3222
3223 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3224
3225 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3226 * process.h (PGET): Remove.
3227 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3228 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3229
3230 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3231
3232 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3233 * window.h (WGET): Remove.
3234 (struct window): Do not use INTERNAL_FIELD.
3235 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3236 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3237 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3238 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3239 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3240 Adjust users.
3241
3242 2012-08-07 Chong Yidong <cyd@gnu.org>
3243
3244 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3245 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3246 (Fdelete_window_internal): Signal an error if the window is not on
3247 a live frame (Bug#12025).
3248
3249 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3250
3251 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3252 * frame.h (FGET): Remove.
3253 (struct frame): Do not use INTERNAL_FIELD.
3254 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3255 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3256 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3257 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3258
3259 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
3260
3261 * w32.c: Silence compiler warnings.
3262 (map_w32_filename): Remove unused variable `is_fat'.
3263 (chase_symlinks): Add parentheses around expression.
3264
3265 2012-08-06 Glenn Morris <rgm@gnu.org>
3266
3267 * sysdep.c: Respect BROKEN_GETWD.
3268
3269 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3270 Let configure handle it.
3271 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3272
3273 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3274
3275 Use GCALIGNMENT where appropriate.
3276 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3277 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3278 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3279
3280 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3281
3282 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3283 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3284
3285 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3286
3287 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3288 that should be sufficient for everyone.
3289
3290 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3291
3292 * keyboard.c (timer_check_2): Add break so timer_check returns next
3293 timeout.
3294
3295 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3296
3297 Fix Windows build errors introduced after converting to WGET and WSET.
3298 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3299 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3300
3301 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3302
3303 * nsterm.m (ns_frame_rehighlight): Use FSET.
3304
3305 * nsmenu.m (ns_update_menubar): Use FSET.
3306
3307 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3308
3309 Separate read and write access to Lisp_Object slots of Lisp_Process.
3310 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3311 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3312
3313 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3314
3315 Separate read and write access to Lisp_Object slots of struct window.
3316 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3317 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3318 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3319 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3320 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3321 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3322 Adjust users.
3323
3324 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3325
3326 Fix Windows build errors introduced after converting to FGET and FSET.
3327 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3328 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3329 (w32_judge_scroll_bars): Change to use FSET.
3330 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3331
3332 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3333
3334 Fix replacement typo.
3335 * window.c (replace_window): Set root_window instead of
3336 selected_window. This fixes a total window subsystem
3337 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3338
3339 2012-08-06 Glenn Morris <rgm@gnu.org>
3340
3341 * lisp.mk (lisp): Add language/persian.elc.
3342
3343 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3344
3345 Separate read and write access to Lisp_Object slots of struct frame.
3346 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3347 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3348 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3349 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3350 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3351
3352 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3353
3354 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3355
3356 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3357
3358 Generalize common compile-time constants.
3359 * lisp.h (header_size, bool_header_size, word_size): Now here.
3360 (struct Lisp_Vector): Add comment.
3361 (struct Lisp_Bool_Vector): Move up to define handy constants.
3362 (VECSIZE, PSEUDOVECSIZE): Simplify.
3363 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3364 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3365 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3366 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3367 * xfont.c, xmenu.c: Use word_size where appropriate.
3368
3369 2012-08-05 Lawrence Mitchell <wence@gmx.li>
3370
3371 * search.c (Freplace_match): Treat \? in the replacement text
3372 literally (Bug#8161).
3373
3374 2012-08-05 Chong Yidong <cyd@gnu.org>
3375
3376 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3377 * frame.c (Vdelete_frame_functions):
3378 * emacs.c (Vkill_emacs_hook): Doc fix.
3379
3380 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3381
3382 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3383 --with-x-toolkit=no builds.
3384 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3385
3386 2012-08-04 Chong Yidong <cyd@gnu.org>
3387
3388 * syntax.c (Fmodify_syntax_entry): Doc fix.
3389
3390 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3391
3392 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3393 * w32.c (init_environment): Change the default values of many
3394 environment variables in dflt_envvars[] to NULL, to avoid pushing
3395 them into environment when they were not already defined.
3396 Remove the code that deletes site-lisp subdirectories from the default
3397 value of EMACSLOADPATH, as it is no longer needed.
3398 (check_windows_init_file): Now external, not static.
3399 Use Vload_path as is, without adding anything, as this function is now
3400 called when Vload_path is already set up.
3401
3402 * w32.h (check_windows_init_file): Add prototype.
3403
3404 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3405 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3406 compatibility with Posix platforms.
3407 (main): Move the call to check_windows_init_file to here from
3408 w32.c.
3409 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3410 any, in the DEFALT argument into the root of the Emacs build or
3411 installation tree, as appropriate.
3412
3413 * callproc.c (init_callproc_1): Call decode_env_path instead of
3414 doing its equivalent by hand.
3415 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3416 the code that sets Vexec_path run on MS-Windows.
3417
3418 * lread.c (init_lread): Add comments to #ifdef's.
3419
3420 * msdos.c (dos_set_window_size, IT_update_begin)
3421 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3422 instead of direct references.
3423
3424 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3425
3426 Export DEFAULT_REHASH_* to GDB.
3427 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3428 Now constants, not macros.
3429
3430 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3431
3432 Remove unnecessary casts involving pointers.
3433 These casts are no longer needed now that we assume C89 or later,
3434 since they involve casting to or from void *.
3435 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3436 (make_pure_float, make_pure_vector):
3437 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3438 * macros.c (Fstart_kbd_macro):
3439 * menu.c (find_and_return_menu_selection):
3440 * minibuf.c (read_minibuf_noninteractive):
3441 * sysdep.c (closedir):
3442 * xdisp.c (x_produce_glyphs):
3443 * xfaces.c (compare_fonts_by_sort_order):
3444 * xfns.c (x_real_positions, select_visual):
3445 * xselect.c (x_stop_queuing_selection_requests)
3446 (x_get_window_property, x_get_window_property_as_lisp_data):
3447 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3448 Remove unnecessary pointer casts.
3449 * alloc.c (record_xmalloc): New function.
3450 * lisp.h (record_xmalloc): New decl.
3451 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3452 more like a function. This is because the pointer cast is not
3453 needed. All uses changed.
3454 * print.c (print_string, print_error_message): Avoid length recalc.
3455
3456 Improve fix for macroexp crash with debugging (Bug#12118).
3457 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3458 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3459 not supposed to be invoked from the garbage collector.
3460 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3461 (gc_aset): New function, which is like ASET but can be
3462 used in the garbage collector.
3463 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3464 (set_hash_index): Use it instead of ASET.
3465
3466 2012-08-03 Eli Zaretskii <eliz@gnu.org>
3467
3468 Support symlinks on latest versions of MS-Windows.
3469 * w32.c: Include winioctl.h and aclapi.h.
3470 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3471 (revert_to_self): Forward declarations of static functions.
3472 <static BOOL g_b_init_get_security_info>:
3473 <g_b_init_create_symbolic_link>: New static flags.
3474 (globals_of_w32): Initialize them to zero.
3475 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3476 (map_w32_filename): Improve commentary. Simplify switch.
3477 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3478 headers (most versions of MinGW w32api don't).
3479 (get_security_info, create_symbolic_link)
3480 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3481 New functions.
3482 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3483 in the argument file name.
3484 (sys_access): Call unc_volume_file_attributes only if
3485 GetFileAttributes fails with network-related error codes.
3486 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3487 have the required privileges.
3488 (get_file_security_desc_by_name): Rename from
3489 get_file_security_desc.
3490 (stat_worker): New function, with most of the guts of 'stat', and
3491 with addition of handling of symlinks and support for 'lstat'.
3492 If possible, get file's attributes and security information by
3493 handle, not by name. Produce S_IFLNK bit for symlinks, when
3494 called from 'lstat'.
3495 (stat, lstat): New functions, call 'stat_worker'.
3496 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3497 symlinks when the underlying filesystem supports them.
3498
3499 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3500
3501 Fix macroexp crash on Windows with debugging (Bug#12118).
3502 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3503 checking subscripts; problem introduced with the recent
3504 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3505 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3506 since it's used in non-static inline functions now.
3507
3508 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3509 Don't assume buffer size fits in 'int'. Remove unused local.
3510
3511 Use C99-style 'extern inline' if available.
3512 * buffer.h (BUFFER_INLINE):
3513 * category.h (CATEGORY_INLINE):
3514 * character.h (CHARACTER_INLINE):
3515 * charset.h (CHARSET_INLINE):
3516 * composite.h (COMPOSITE_INLINE):
3517 * dispextern.h (DISPEXTERN_INLINE):
3518 * lisp.h (LISP_INLINE):
3519 * systime.h (SYSTIME_INLINE):
3520 New macro, replacing 'static inline' in this header.
3521 * buffer.h, category.h, character.h, charset.h, composite.h:
3522 * dispextern.h, lisp.h, systime.h:
3523 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3524 * alloc.c (LISP_INLINE):
3525 * buffer.c (BUFFER_INLINE):
3526 * category.c (CATEGORY_INLINE):
3527 * character.c (CHARACTER_INLINE):
3528 * charset.c (CHARSET_INLINE):
3529 * composite.c (COMPOSITE_INLINE):
3530 * dispnew.c (DISPEXTERN_INLINE):
3531 * sysdep.c (SYSTIME_INLINE):
3532 Define to EXTERN_INLINE, so that the corresponding functions
3533 are compiled into code.
3534 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3535 (INLINE_HEADER_END): New macros.
3536 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3537 since it's used in non-static inline functions now.
3538 (VALMASK) [!USE_LSB_TAG]: Likewise.
3539
3540 2012-08-02 Glenn Morris <rgm@gnu.org>
3541
3542 * s/: Remove empty directory.
3543
3544 * s/ms-w32.h: Move to ../nt/inc.
3545 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3546 Update for new ms-w32.h location.
3547
3548 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3549
3550 Port to Solaris 8.
3551 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3552
3553 2012-08-02 Glenn Morris <rgm@gnu.org>
3554
3555 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3556 hard-coding the path separator.
3557
3558 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3559
3560 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3561 This how ASET and AREF are supposed to work, and makes
3562 it easier to think about future improvements. See
3563 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3564 * charset.h (set_charset_attr): New function.
3565 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3566 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3567 (aref_addr): New function. All uses of &AREF(...) changed.
3568 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3569 (set_hash_index): New functions. All lvalue-style uses of
3570 HASH_KEY etc. changed.
3571 * keyboard.c (set_prop): New function. All lvalue-style uses
3572 of PROP changed.
3573
3574 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3575
3576 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3577 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3578 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3579 * nsfns.m (ns_set_name_as_filename): Likewise.
3580 * nsmenu.m (ns_update_menubar): Likewise.
3581 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3582
3583 2012-08-01 Eli Zaretskii <eliz@gnu.org>
3584
3585 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3586 Adapt to latest changes in field names of the corresponding Lisp
3587 objects.
3588
3589 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3590
3591 2012-08-01 Glenn Morris <rgm@gnu.org>
3592
3593 * s/msdos.h: Remove file.
3594 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3595 * Makefile.in (S_FILE): Remove.
3596 (config_h): Remove S_FILE.
3597
3598 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3599
3600 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3601 Remove; moved to nt/config.nt.
3602
3603 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3604
3605 Use INTERNAL_FIELD for conses and overlays.
3606 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3607 Remove obsolete comment.
3608 (MVAR): New macro.
3609 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3610 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3611
3612 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3613
3614 Use INTERNAL_FIELD for symbols.
3615 * lisp.h (SVAR): New macro. Adjust users.
3616 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3617 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3618
3619 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3620
3621 Use INTERNAL_FIELD for processes.
3622 * process.h (PVAR): New macro. Adjust style.
3623 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3624 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3625
3626 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3627
3628 Use INTERNAL_FIELD for windows.
3629 * window.h (WVAR): New macro.
3630 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3631 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3632 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3633 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3634 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3635 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3636
3637 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3638
3639 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3640
3641 2012-08-01 Glenn Morris <rgm@gnu.org>
3642
3643 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3644 Move to configure.ac.
3645
3646 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3647
3648 * makefile.w32-in (CONFIG_H): Update dependencies.
3649 (CONF_POST_H): New macro.
3650
3651 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3652
3653 2012-07-31 Glenn Morris <rgm@gnu.org>
3654
3655 * Makefile.in (S_FILE): No longer set by configure.
3656
3657 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3658 is available.
3659 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3660
3661 * process.h (NULL_DEVICE):
3662 * emacs.c (SEPCHAR):
3663 * editfns.c (USER_FULL_NAME): Let configure set them.
3664
3665 * s/README, s/template.h: Remove files.
3666
3667 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3668
3669 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3670 Move to configure.ac.
3671
3672 2012-07-31 Eli Zaretskii <eliz@gnu.org>
3673
3674 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3675 resulting renaming of 'struct frame' members.
3676
3677 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3678
3679 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3680 after introduction of FVAR.
3681
3682 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3683
3684 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3685
3686 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3687 instead of compositeToPoint.
3688 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3689
3690 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3691
3692 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3693
3694 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3695 * lisp.h (INTERNAL_FIELD): New macro.
3696 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3697 (BVAR): Change to use INTERNAL_FIELD.
3698 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3699 (KVAR): Change to use INTERNAL_FIELD.
3700 * frame.h (FVAR): New macro.
3701 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3702 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3703 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3704 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3705 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3706
3707 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3708
3709 Miscellaneous fixes for non-default X toolkits.
3710 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3711 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3712 Move under #ifdef USE_LUCID.
3713 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3714 definition and usage to avoid warnings.
3715
3716 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3717
3718 * nsterm.m (openFiles): Fix previous checkin.
3719
3720 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3721
3722 * indent.c (compute_motion): Remove unused local.
3723
3724 2012-07-31 Glenn Morris <rgm@gnu.org>
3725
3726 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3727
3728 * conf_post.h [USG5_4]:
3729 Move remaining contents of s/usg5-4-common.h here.
3730 * s/usg5-4-common.h: Remove file.
3731
3732 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3733 * s/irix6-5.h: Remove file.
3734
3735 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3736 * s/darwin.h: Remove file.
3737
3738 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3739 * s/hpux10-20.h: Remove file, which is now empty.
3740
3741 2012-07-30 Glenn Morris <rgm@gnu.org>
3742
3743 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3744 * Makefile.in (config_h): Add conf_post.h.
3745 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3746
3747 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3748
3749 * nsterm.m (ns_do_open_file): New variable.
3750 (ns_term_init): Set ns_do_open_file to YES after run returns.
3751 (openFile, openTempFile, openFileWithoutUI, openFiles):
3752 Open files only if ns_do_open_file.
3753
3754 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3755
3756 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3757 This no-op macro hasn't been needed for many years.
3758 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3759
3760 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3761 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3762 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3763 gdb_make_enums_visible.
3764 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3765 (DIRECTORY_SEP): Now a constant, not a macro.
3766
3767 2012-07-30 Eli Zaretskii <eliz@gnu.org>
3768
3769 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3770 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3771
3772 * w32term.c <w32_keyboard_codepage>: Renamed from
3773 keyboard_codepage and now external. All users changed.
3774
3775 * w32term.h: Add declaration of w32_keyboard_codepage.
3776
3777 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3778 the codepage to translate keys to Unicode. If this argument is
3779 -1, use the value returned by GetConsoleCP. All callers changed.
3780
3781 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3782
3783 Update .PHONY listings in makefiles.
3784 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3785 bootstrap-clean, distclean, maintainer-clean, versioclean,
3786 extraclean, frc.
3787
3788 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3789 This is a bit clearer. Fix some commentary typos.
3790
3791 2012-07-30 Glenn Morris <rgm@gnu.org>
3792
3793 * s/netbsd.h: Let configure include signal.h if needed.
3794 Remove file, which is now empty.
3795
3796 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3797 Let configure set them.
3798 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3799 No more need to undefine.
3800
3801 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3802
3803 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3804 non-single-byte char when adding meta modifier. (Bug#12090)
3805
3806 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3807
3808 Convert safe_call to use variable number of arguments.
3809 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3810 (safe_call2): Fix comment.
3811 * lisp.h (safe_call): Adjust prototype.
3812 * coding.c (encode_coding_object): Change to use safe_call2.
3813 * xfaces.c (merge_face_heights): Change to use safe_call1.
3814
3815 2012-07-30 Glenn Morris <rgm@gnu.org>
3816
3817 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3818 does that unconditionally. Remove file, which is now empty.
3819
3820 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3821 Remove empty files.
3822
3823 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3824
3825 Export to GDB most of lisp.h's remaining object-like macros.
3826 * lisp.h (min, max): Move earlier, because they're used earlier now.
3827 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3828 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3829 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3830 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3831 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3832 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3833 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3834 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3835 Now constants, for GDB. They need not be macros.
3836 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3837 Now constants, for GDB, as well as macros, for static initializers.
3838 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3839 Move to after the definition of struct Lisp_Char_Table,
3840 since the former now needs that type defined.
3841 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3842 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3843 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3844 New enums, for gdb_make_enums_visible.
3845 (GLYPH_MODE_LINE_FACE): Remove; unused.
3846 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3847 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3848 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3849 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3850 enum maxargs, enum MAX_ALLOCA.
3851 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3852 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3853 no longer needed, now that they are done in lisp.h.
3854
3855 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3856
3857 Cleanup string bytes checking.
3858 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3859 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3860 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3861 (check_sblock, compact_small_strings): Simplify.
3862
3863 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3864
3865 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3866 These macros are confusing and no longer need to be defined, as
3867 the enum values now suffice. All uses replaced with definiens.
3868 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3869
3870 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3871
3872 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3873 ($(BLD)/w32console.$(O)): Update dependencies.
3874
3875 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3876
3877 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3878 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3879 time. Adjust users.
3880 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3881
3882 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3883
3884 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3885 setting sitelisp (Bug#12010).
3886
3887 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3888
3889 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3890
3891 * w32heap.c (cache_system_info):
3892 * w32.c (sys_rename):
3893 * w32proc.c (find_child_console, sys_kill): All users changed.
3894
3895 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3896
3897 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3898
3899 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3900
3901 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3902
3903 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3904
3905 Cleanup statistics calculation in Fgarbage_collect.
3906 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3907 Fix zombies percentage calculation. Simplify elapsed time calculation.
3908
3909 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3910
3911 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3912 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3913 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3914 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3915 (replace_range, replace_range_2, del_range_2): Change to eassert.
3916 * marker.c (byte_char_debug_check): Adjust style.
3917
3918 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3919
3920 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3921 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3922 long-ago-commented-out code that talks about "WIN32".
3923 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3924 All uses changed.
3925
3926 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3927
3928 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3929 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3930 Simplify by using alignof.
3931 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3932 * lisp.h: Include <stdalign.h>.
3933 (GCALIGNMENT): New macro and constant.
3934 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3935 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3936 (stdalign): New macro, if not already defined.
3937
3938 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3939
3940 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3941 * w32inevt.c: Include w32inevt.h.
3942 (w32_read_console_input): New inline function, calls either
3943 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3944 w32_console_unicode_input.
3945 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3946 (w32_kbd_patch_key, key_event): Use the codepage returned by
3947 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3948 (key_event): use uChar.UnicodeChar only if
3949 w32_console_unicode_input is non-zero.
3950
3951 * w32console.c: Include w32heap.h.
3952 <w32_console_unicode_input>: New global variable.
3953 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3954 family of Windows, zero otherwise.
3955
3956 * w32inevt.h: Declare w32_console_unicode_input.
3957
3958 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3959 --without-x. (Bug#11742)
3960
3961 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3962
3963 Adjust GDB to reflect pvec_type changes (Bug#12036).
3964 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3965 2012-07-04 changes to pseudovector representation.
3966 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3967
3968 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3969
3970 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3971 bus address.
3972 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3973
3974 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3975
3976 * alloc.c (listn): Fix the order the arguments are consed onto the
3977 list.
3978
3979 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3980 enumeration constants, as PURE and HEAP are too general, and clash
3981 with other headers and sources, such as gmalloc.c and the
3982 MS-Windows system headers. All users changed.
3983
3984 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3985
3986 Revert last save_excursion_save and save_excursion_restore changes.
3987 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3988 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3989
3990 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3991
3992 Fix recently-introduced typos in Windows port.
3993 Reported by Martin Rudalics <rudalics@gmx.at>.
3994 * w32.c (init_environment): Replace comma with semicolon.
3995 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3996
3997 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3998
3999 Improve GDB symbol export (Bug#12036).
4000 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4001 arms of an 'if', not using conditional expressions; otherwise GDB
4002 complains about the types in the unevaluated arm when the argument
4003 is an integer literal.
4004 (xgetint): Simplify expression.
4005 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4006 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4007 Zaretskii in <http://bugs.gnu.org/12036#13>.
4008 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4009 needed now that we have gdb_make_enums_visible.
4010 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4011 (enum enum_USE_LSB_TAG):
4012 New enum types, packaging up enums that need to be exported to GDB.
4013
4014 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4015
4016 Utility function to make a list from specified amount of objects.
4017 * lisp.h (enum constype): New datatype.
4018 (listn): New prototype.
4019 * alloc.c (listn): New function.
4020 (Fmemory_use_count, syms_of_alloc): Use it.
4021 * buffer.c (syms_of_buffer): Likewise.
4022 * callint.c (syms_of_callint): Likewise.
4023 * charset.c (define_charset_internal): Likewise.
4024 * coding.c (syms_of_coding): Likewise.
4025 * keymap.c (syms_of_keymap): Likewise.
4026 * search.c (syms_of_search): Likewise.
4027 * syntax.c (syms_of_syntax): Likewise.
4028 * w32.c (init_environment): Likewise.
4029 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4030 * xdisp.c (syms_of_xdisp): Likewise.
4031 * xfns.c (syms_of_xfns): Likewise.
4032
4033 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4034
4035 Fast save_excursion_save and save_excursion_restore.
4036 * lisp.h (struct Lisp_Excursion): New data type.
4037 (PVEC_EXCURSION): New pseudovector type.
4038 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4039 to deal with it. Adjust comments.
4040 (init_marker, attach_marker): New prototype.
4041 (unchain_marker): Adjust prototype.
4042 * marker.c (attach_marker): Change to global.
4043 (init_marker): New function.
4044 * alloc.c (Fmake_marker, build_marker): Use it.
4045 (build_marker): More easserts.
4046 (mark_object): Handle struct Lisp_Excursion.
4047 * editfns.c (save_excursion_save, save_excursion_restore):
4048 Reimplement to use struct Lisp_Excursion. Add comments.
4049
4050 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4051
4052 Fix export of symbols to GDB (Bug#12036).
4053 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4054 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4055 emacs.c, as this is a more-suitable home. Had this been done earlier
4056 the fix for 12036 would have avoided some of the problems noted in
4057 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4058 would have been more obvious.
4059 * emacs.c: Do not include <verify.h>; no longer needed.
4060 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4061 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4062 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4063 Remove; now done in lisp.h.
4064 * lisp.h (PUBLISH_TO_GDB): New macro.
4065 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4066 (DATA_SEG_BITS): Use it.
4067 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4068 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4069 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4070 not be usable in #if. This simplifies things.
4071
4072 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
4073
4074 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4075
4076 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4077
4078 Simplify export of symbols to GDB (Bug#12036).
4079 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4080 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4081 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4082 Adjust to changes in lisp.h and emacs.c, by using
4083 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4084 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4085 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4086 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4087 instead of gdb_valbits.
4088 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4089 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4090 instead of gdb_array_mark_flag.
4091 (xboolvector): Get size from $->size, not $->header.size.
4092 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4093 (xreload, hook-run, hookpost-run): Remove.
4094 * emacs.c: Include <verify.h>.
4095 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4096 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4097 Remove.
4098 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4099 (gdb_USE_LSB_TAG): New enum constants.
4100 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4101 Also define these as enum constants, so they're visible to GDB.
4102 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4103 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4104 as constants, so they're visible to GDB.
4105 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4106 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4107 Now enum constants, not macros, so they're visible to GDB.
4108 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4109 more convenient now. All uses changed.
4110 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4111 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4112
4113 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4114
4115 Explicitly free restriction data that are not needed anymore.
4116 * editfns.c (save_restriction_restore): Free restriction data.
4117
4118 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4119
4120 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4121 add argument, tune behavior, and adjust all callers.
4122
4123 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4124
4125 Use typedef for EMACS_INT, EMACS_UINT.
4126 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4127 than macros. This simplifies debugging in the usual case, since
4128 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4129 and it allows expressions involving EMACS_INT casts.
4130 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4131
4132 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4133
4134 * nsterm.m (ns_read_socket): Return early if there is a modal
4135 window (Bug#12043).
4136
4137 2012-07-25 Martin Rudalics <rudalics@gmx.at>
4138
4139 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4140 that FOCUS-FRAME can be omitted.
4141
4142 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4143
4144 Adjust buffer text indirection counters at the end of Fkill_buffer.
4145 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4146 buffer is definitely dead. This should really fix an issue reported
4147 by Christoph Scholtes again. (Bug#12007).
4148 (init_buffer_once): Initialize indirection counters of
4149 buffer_defaults and buffer_local_symbols (for sanity and safety).
4150
4151 2012-07-24 Eli Zaretskii <eliz@gnu.org>
4152
4153 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4154 and continuation glyphs on tooltip frames, leave them at zero.
4155 Avoids continued lines in tooltips. (Bug#11832)
4156
4157 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4158
4159 Simplify copy_overlay.
4160 * buffer.c (copy_overlay): Simplify. Use build_marker.
4161 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4162
4163 2012-07-23 Eli Zaretskii <eliz@gnu.org>
4164
4165 * print.c (print_object): Don't crash when a frame's name is nil
4166 or invalid. (Bug#12025)
4167
4168 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4169 it signals an error when a tooltip frame is being created.
4170
4171 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4172
4173 Cleanup miscellaneous objects allocation and initialization.
4174 * alloc.c (allocate_misc): Change to static. Add argument to
4175 specify the subtype. Adjust comment and users.
4176 (build_overlay): New function.
4177 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4178 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4179 (allocate_misc): Remove prototype.
4180 (build_overlay): Add prototype.
4181
4182 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4183
4184 Swap buffer text indirection counters in Fbuffer_swap_text.
4185 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4186 This avoids crash reported by Christoph Scholtes at
4187 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4188
4189 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4190
4191 * nsmenu.m (Popdown_data): New struct.
4192 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4193 free Popdown_data.
4194 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4195 (initWithContentRect): Make imgView and contentView non-static
4196 and autorelease them. Also autorelease img and matrix (Bug#12005).
4197 (dealloc): Remove (Bug#12005).
4198
4199 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4200
4201 Adjust consing_since_gc when objects are explicitly freed.
4202 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4203 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4204 (free_cons, free_misc): Subtract object size from consing_since_gc.
4205
4206 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4207
4208 Simplify and cleanup markers positioning code.
4209 * marker.c (attach_marker): More useful eassert.
4210 (live_buffer, set_marker_internal): New function.
4211 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4212 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4213
4214 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4215
4216 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4217 as it's limited by the amount of memory, not by INT_MAX.
4218
4219 2012-07-21 Eli Zaretskii <eliz@gnu.org>
4220
4221 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4222 in special-event-map. See the discussion at
4223 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4224 for the reasons.
4225
4226 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4227 info.dwItemData. Fixes crashes on 64-bit Windows.
4228 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4229
4230 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4231
4232 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4233 (conversationIdentifier): Return value is NSInteger.
4234 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4235
4236 2012-07-21 Chong Yidong <cyd@gnu.org>
4237
4238 * window.c (decode_any_window): Signal an error if the window is
4239 on a dead frame (Bug#11984).
4240
4241 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4242
4243 Add indirection counting to speed up Fkill_buffer.
4244 * buffer.h (struct buffer): New member.
4245 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4246 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4247 base buffer indirection counter.
4248 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4249 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4250 through buffer list if indirection counter is 0.
4251
4252 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4253
4254 Extend the value returned by Fgarbage_collect with heap statistics.
4255 * alloc.c (Qheap): New symbol.
4256 (syms_of_alloc): DEFSYM it.
4257 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4258 (Fmemory_free): Remove.
4259 (syms_of_alloc): Don't defsubr it.
4260 * buffer.c (Fcompact_buffer): Remove.
4261 (syms_of_buffer): Don't defsubr it.
4262
4263 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4264
4265 Make maybe_gc inline.
4266 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4267 * lisp.h (consing_since_gc, gc_relative_threshold)
4268 (memory_full_cons_threshold): Revert declaration.
4269 (maybe_gc): Remove prototype, define as inline.
4270 * alloc.c: Remove old commented-out code.
4271 (consing_since_gc, gc_relative_threshold)
4272 (memory_full_cons_threshold): Revert to global.
4273 (maybe_gc): Remove.
4274
4275 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4276
4277 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4278 * lisp.h (build_unibyte_string): New function.
4279 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4280 * sysdep.c, w32fns.c, xfns.c: Use it.
4281 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4282 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4283 Adjust users accordingly.
4284 * font.h (font_open_by_name): Adjust prototype.
4285
4286 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4287
4288 Cleanup calls to Fgarbage_collect.
4289 * lisp.h (maybe_gc): New prototype.
4290 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4291 Remove declarations.
4292 * alloc.c (maybe_gc): New function.
4293 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4294 Make them static.
4295 * bytecode.c (MAYBE_GC): Use maybe_gc.
4296 * eval.c (eval_sub, Ffuncall): Likewise.
4297 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4298 to avoid dependency from auto-save feature.
4299
4300 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4301
4302 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4303 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4304 'for_each_per_buffer_object_at'.
4305 All uses changed. It's better to use upper-case for macros that
4306 cannot be implemented as functions, to give the reader a clue
4307 that they're special.
4308
4309 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4310
4311 * alloc.c (Fgarbage_collect): Tweak docstring.
4312
4313 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4314
4315 Tweak the value returned from Fgarbage_collect again.
4316 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4317 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4318 Adjust documentation.
4319 (total_vector_bytes): Rename to total_vector_slots, adjust
4320 accounting.
4321 (total_free_vector_bytes): Rename to total_free_vector_slots,
4322 adjust accounting.
4323 (Qstring_bytes, Qvector_slots): New symbols.
4324 (syms_of_alloc): DEFSYM them.
4325
4326 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4327
4328 Buffer compaction primitive which may be used from Lisp.
4329 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4330 (syms_of_buffer): Register Fcompact_buffer.
4331 * alloc.c (Fgarbage_collect): Use compact_buffer.
4332 * buffer.h (compact_buffer): New prototype.
4333 (struct buffer_text): New member.
4334
4335 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4336
4337 New macro to iterate over all buffers, miscellaneous cleanups.
4338 * lisp.h (all_buffers): Remove declaration.
4339 * buffer.h (all_buffers): Add declaration, with comment.
4340 (for_each_buffer): New macro.
4341 * alloc.c (Fgarbage_collect, mark_object): Use it.
4342 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4343 (init_buffer): Likewise.
4344 * data.c (Fset_default): Likewise.
4345 * coding.c (code_conversion_restore): Remove redundant check
4346 for dead buffer.
4347 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4348
4349 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4350
4351 Fix bug that created negative-length intervals.
4352 * intervals.c (merge_interval_right, merge_interval_left):
4353 Do not zero out this interval if it is absorbed by its children,
4354 as this interval's total length doesn't change in that case. See
4355 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4356
4357 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4358
4359 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4360 when invoking (make-bool-vector N t) and N is a positive
4361 multiple of 8 -- the last 8 bits were mistakenly cleared.
4362
4363 Remove some struct layout assumptions in bool vectors.
4364 * alloc.c (bool_header_size): New constant.
4365 (header_size, word_size): Move earlier, as they're now used earlier.
4366 Use 'word_size' in a few more places, where it's appropriate.
4367 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4368 padding before the data member of a bool vector.
4369 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4370 than doing the check by hand with an abort ().
4371
4372 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4373
4374 * eval.c (Fdefvar): Don't check constants since we only set the var if
4375 it's not yet defined anyway (bug#11904).
4376
4377 * lisp.h (last_undo_boundary): Declare new var.
4378 * keyboard.c (command_loop_1): Set it.
4379 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4380 were auto-added by the command loop (bug#11774).
4381
4382 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4383
4384 * w32font.c (Qsymbol): Remove local definition.
4385 (syms_of_w32font): Don't DEFSYM it.
4386
4387 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4388
4389 Fix sweep_vectors to handle large bool vectors correctly.
4390 * alloc.c (sweep_vectors): Account total_vector_bytes for
4391 bool vectors larger than VBLOCK_BYTES_MAX.
4392
4393 2012-07-18 Chong Yidong <cyd@gnu.org>
4394
4395 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4396 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4397
4398 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4399
4400 Return more descriptive data from Fgarbage_collect.
4401 Suggested by Stefan Monnier in
4402 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4403 * alloc.c (bounded_number): New function.
4404 (total_buffers, total_vectors): New variable.
4405 (total_string_size): Rename to total_string_bytes, adjust users.
4406 (total_vector_size): Rename to total_vector_bytes, adjust users.
4407 (sweep_vectors): Account total_vectors and total_vector_bytes.
4408 (Fgarbage_collect): New return value. Adjust documentation.
4409 (gc_sweep): Account total_buffers.
4410 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4411 (VECTOR_SIZE): Remove.
4412 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4413 (Qinterval, Qmisc): New symbols.
4414 (syms_of_data): Initialize them.
4415 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4416 (Qcons, Qbuffer): New declarations.
4417
4418 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4419
4420 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4421 Round up, not down. Improve doc.
4422
4423 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4424
4425 Restore old code in allocate_string_data to avoid Faset breakage.
4426 Reported by Julien Danjou <julien@danjou.info> in
4427 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4428 * alloc.c (allocate_string_data): Restore old code with minor
4429 adjustments, fix comment to explain this subtle issue.
4430
4431 2012-07-17 Eli Zaretskii <eliz@gnu.org>
4432
4433 Remove FILE_SYSTEM_CASE.
4434 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4435
4436 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4437 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4438 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4439 call-process-region passes it through expand-file-name.
4440
4441 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4442
4443 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4444
4445 Fix crash when creating indirect buffer (Bug#11917)
4446 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4447 Don't handle unbound variables specially if non-zero.
4448 (Fbuffer_local_variables): Pass zero.
4449 (clone_per_buffer_values): Pass non-zero.
4450
4451 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4452
4453 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4454 to make the loop interruptible.
4455
4456 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4457
4458 * gnutls.c (emacs_gnutls_handshake): Only retry if
4459 GNUTLS_E_INTERRUPTED.
4460
4461 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4462
4463 Cleanup and convert miscellaneous checks to eassert.
4464 * alloc.c (mark_interval): Fix comment, partially rephrase
4465 old comment from intervals.h (see below).
4466 * intervals.c (find_interval, adjust_intervals_for_insertion)
4467 (delete_interval, adjust_intervals_for_deletion)
4468 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4469 Convert to eassert.
4470 (adjust_intervals_for_insertion, make_new_interval):
4471 Remove obsolete and unused code.
4472 * intervals.h (struct interval): Remove obsolete comment.
4473 * textprotp.c (erase_properties): Remove unused code.
4474 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4475 (Fremove_list_of_text_properties): Convert to eassert.
4476
4477 2012-07-17 Chong Yidong <cyd@gnu.org>
4478
4479 * editfns.c (Finsert_char): Doc fix.
4480
4481 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4482
4483 Fix previous change to make Fmemory_free always accurate.
4484 * alloc.c (make_interval): Update total_free_intervals.
4485 (make_float): Likewise for total_free_floats.
4486 (free_cons, Fcons): Likewise for total_free_conses.
4487 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4488 Likewise for total_free_vector_bytes.
4489 (Fmake_symbol): Likewise for total_free_symbols.
4490 (bytes_free): Remove.
4491
4492 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4493
4494 Simple free memory accounting feature.
4495 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4496 (sweep_vectors): Accumulate size of free vectors.
4497 (Fgarbage_collect): Setup bytes_free.
4498 (Fmemory_free): New function.
4499 (syms_of_alloc): Register it.
4500
4501 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4502
4503 Cleanup overlays checking.
4504 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4505 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4506 eassert and OVERLAYP.
4507 (sort_overlays): Change to use OVERLAYP.
4508
4509 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4510
4511 * editfns.c (Finsert_char): Make it interactive, and make the
4512 second arg optional. Copy interactive spec and docstring from
4513 ucs-insert.
4514
4515 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4516
4517 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4518 Unlike the other wrapped functions, fabs has an unspecified
4519 effect on errno.
4520
4521 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4522
4523 * nsterm.m (keyDown): Interpret flags without left/right bits
4524 as the left key (Bug#11670).
4525
4526 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4527
4528 Remove empty and useless init functions.
4529 * lisp.h (init_character_once, init_fns, init_image)
4530 (init_filelock, init_sound): Remove prototype.
4531 * character.c (init_character_once): Remove.
4532 * filelock.c (init_filelock): Likewise.
4533 * fns.c (init_fns): Likewise.
4534 * image.c (init_image): Likewise.
4535 * sound.c (init_sound): Likewise.
4536 * emacs.c (main): Adjust accordingly.
4537
4538 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4539
4540 * gtkutil.h: Tiny cleanups.
4541 (use_old_gtk_file_dialog): Remove useless declaration.
4542 (xg_uses_old_file_dialog): Add suggested const attribute.
4543
4544 2012-07-15 Eli Zaretskii <eliz@gnu.org>
4545
4546 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4547 (bidi_paragraph_init): Use it to limit search forward for a strong
4548 directional character in abnormally large paragraphs full of
4549 neutral or weak characters. (Bug#11943)
4550
4551 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4552
4553 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4554 the toolbar (Bug#9451).
4555 (xg_make_tool_item): Give the widget event box a transparent
4556 background.
4557
4558 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4559
4560 Cleanup basic allocation variables and functions.
4561 * alloc.c (ignore_warnings, init_intervals, init_float)
4562 (init_cons, init_symbol, init_marker): Remove.
4563 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4564 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4565 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4566 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4567 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4568 (staticidx, init_alloc_once, init_strings, free_ablock):
4569 Remove redundant initialization.
4570 * fns.c (init_weak_hash_tables): Remove.
4571 * lisp.h (init_weak_hash_tables): Remove prototype.
4572
4573 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4574
4575 Use zero_vector where appropriate.
4576 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4577 accordingly.
4578 * lisp.h (zero_vector): New declaration.
4579 * font.c (null_vector): Remove.
4580 (syms_of_font): Remove initialization and staticpro.
4581 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4582 * keymap.c (Faccessible_keymaps): Likewise.
4583
4584 2012-07-15 Leo Liu <sdl.web@gmail.com>
4585
4586 * fringe.c: Fix typo in comments.
4587
4588 2012-07-14 Leo Liu <sdl.web@gmail.com>
4589
4590 * fringe.c: Add a new bitmap exclamation-mark.
4591
4592 2012-07-14 Eli Zaretskii <eliz@gnu.org>
4593
4594 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4595
4596 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4597 (HAVE_MENUS): Don't define, defined by editing config.in with
4598 msdos/sed2v2.inp.
4599 (GMALLOC_INHIBIT_VALLOC): Don't define.
4600 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4601
4602 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
4603
4604 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4605
4606 2012-07-14 Glenn Morris <rgm@gnu.org>
4607
4608 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4609 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4610 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4611
4612 2012-07-13 Glenn Morris <rgm@gnu.org>
4613
4614 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4615
4616 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4617 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4618
4619 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4620
4621 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4622 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4623 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4624 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4625 where appropriate.
4626 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4627 as boolean expression.
4628 (x_set_window_size): Remove unused variable toolbar.
4629 (ns_get_color_default, ns_mod_to_lisp): Remove.
4630 (ns_mouse_position): Remove unused variables xchar and ychar.
4631 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4632 (ns_set_vertical_scroll_bar): Remove unused variable count.
4633 (ns_delete_terminal): Remove unused variable i.
4634 (ns_term_init): Remove unused variables r, g and b.
4635 (mouseDown): Remove unused variable window.
4636 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4637 (initFrameFromEmacs): Remove unused variable vbextra.
4638 (mouseEntered): Remove unused variables p and dpyinfo.
4639 (mouseExited): Remove unused variables p and r.
4640 (ns_define_frame_cursor, ns_clear_frame_area)
4641 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4642 (menuDown): Assign [sender tag] to variable and cast the variable.
4643
4644 * nsterm.h (menuDown): Add id as type to argument sender.
4645 (ns_display_info_for_name): Add Lisp_Object argument.
4646 (ns_term_init): Add Lisp_Object argument.
4647 (ns_map_event_to_object): Add void argument.
4648 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4649 prototype with arguments and only declare if __OBJC__.
4650 (nxatoms_of_nsselect): Add void argument.
4651 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4652 (ns_alloc_autorelease_pool): Add void argument.
4653 (ns_release_autorelease_pool): Add void* argument.
4654 (ns_get_defaults_value): Add const char* argument.
4655
4656 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4657 (initFromContents): Use SSDATA where appropriate.
4658 (ns_update_menubar): Add braces to ambigous if-else.
4659 (initWithTitle): Put () around assignment in if statement.
4660 (ns_menu_show): Remove unused variables window and keymap.
4661 (update_frame_tool_bar): Remove unused variable selected_p.
4662 (initWithContentRect): Remove unused variable this_cmd_name.
4663
4664 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4665 appropriate.
4666 (setXBMColor): Remove unused variable len.
4667 (setPixmapData): Put () around assignment in loop statement.
4668
4669 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4670 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4671 where appropriate.
4672 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4673 around assignment in loop statement.
4674 (nsfont_open): Remove unused variable i.
4675 (nsfont_open): Remove unused variable len.
4676 (nsfont_draw): Remove unused variable cs.
4677
4678 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4679 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4680 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4681 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4682 (Fns_font_name, Fns_perform_service)
4683 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4684 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4685 (ns_set_name): Remove unused variable view.
4686 (x_set_menu_bar_lines): Remove unused variable olines.
4687 (x_set_tool_bar_lines): Remove unused variable root_window.
4688 (Fns_list_colors): Put () around assignment in while statement.
4689 (Fns_perform_service): Remove unused variable len.
4690 (Fns_display_usable_bounds): Remove unused variable top.
4691 (syms_of_nsfns): Remove unused variable i.
4692
4693 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4694 memcpy (Bug#11907).
4695
4696 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4697
4698 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4699 and free it with DestroyExceptionInfo (Bug#11558).
4700
4701 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
4702
4703 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4704 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4705 Set here, not in nt/config.nt.
4706
4707 2012-07-13 Eli Zaretskii <eliz@gnu.org>
4708
4709 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4710 cursor overflow into the last glyph on display line when the right
4711 fringe is off. (Bug#11832)
4712
4713 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4714
4715 * xdisp.c (produce_special_glyphs): Now static.
4716 * dispextern.h (produce_special_glyphs): Remove decl.
4717
4718 2012-07-13 Glenn Morris <rgm@gnu.org>
4719
4720 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4721 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4722
4723 * s/usg5-4-common.h (USG, USG5):
4724 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4725 * s/sol2-6.h (SOLARIS2):
4726 * s/irix6-5.h (IRIX6_5):
4727 * s/hpux10-20.h (USG, USG5, HPUX):
4728 * s/gnu-linux.h (USG, GNU_LINUX):
4729 * s/freebsd.h (BSD_SYSTEM):
4730 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4731 * s/cygwin.h (CYGWIN):
4732 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4733 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4734
4735 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4736
4737 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4738
4739 2012-07-13 Glenn Morris <rgm@gnu.org>
4740
4741 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4742
4743 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4744
4745 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4746 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4747
4748 2012-07-12 Glenn Morris <rgm@gnu.org>
4749
4750 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4751
4752 * process.c (init_process_emacs): Rename from init_process.
4753 The old name is also the name of a Mach system call.
4754 * lisp.h, emacs.c: Update for this name change.
4755 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4756 longer needed.
4757
4758 2012-07-12 Eli Zaretskii <eliz@gnu.org>
4759
4760 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4761 memmove call that removes glyphs covered by the left truncation
4762 glyph. Improve commentary.
4763 (display_line): Fix display of continuation glyphs on GUI frames
4764 when the right fringe is turned off and variable-size fonts are
4765 used in the window. Move the code that appends a stretch glyph to
4766 produce_special_glyphs, so that it could be used for truncation
4767 and continuation glyphs alike.
4768 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4769 glyph of a suitably computed width, to align the special glyphs at
4770 the window margin. Code moved from display_line. (Bug#11832)
4771
4772 2012-07-12 Glenn Morris <rgm@gnu.org>
4773
4774 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4775
4776 * s/gnu-linux.h, s/hpux10-20.h:
4777 Do not unconditionally define HAVE_XRMSETDATABASE.
4778
4779 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4780
4781 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4782
4783 Fix typos that broke OS X build.
4784 Reported by Randal L. Schwartz in
4785 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4786 * nsterm.m (ns_timeout): Add missing local decl.
4787 (ns_get_color): snprintf -> sprintf, to fix typo.
4788
4789 2012-07-12 Glenn Morris <rgm@gnu.org>
4790
4791 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4792 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4793 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4794 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4795
4796 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4797 Move PTY_OPEN to configure.
4798
4799 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4800 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4801 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4802
4803 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4804
4805 Use empty_unibyte_string where applicable.
4806 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4807 * lread.c (read1): Likewise.
4808 * xsettings.c (syms_of_xsettings): Likewise.
4809
4810 2012-07-12 Glenn Morris <rgm@gnu.org>
4811
4812 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4813 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4814 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4815 * s/hpux10-20.h (RUN_TIME_REMAP):
4816 * s/bsd-common.h (TABDLY): Move to configure.
4817
4818 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4819
4820 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4821
4822 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4823 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4824
4825 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4826
4827 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4828 * s/template.h: Move NARROWPROTO to configure.
4829
4830 2012-07-11 Glenn Morris <rgm@gnu.org>
4831
4832 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4833 unused since 2011-01-17 change to systty.h.
4834
4835 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4836 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4837 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4838
4839 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4840
4841 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4842
4843 2012-07-11 Glenn Morris <rgm@gnu.org>
4844
4845 * s/darwin.h, s/gnu-linux.h, s/template.h:
4846 Move INTERRUPT_INPUT to configure.
4847
4848 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4849
4850 Minor adjustments to interning code.
4851 * lisp.h (intern, intern_c_string): Redefine as static inline
4852 wrappers for intern_1 and intern_c_string_1, respectively.
4853 (intern_1, intern_c_string_1): Rename prototypes.
4854 * lread.c (intern_1, intern_c_string_1, oblookup):
4855 Simplify Vobarray checking.
4856 * font.c (font_intern_prop): Likewise. Adjust comment.
4857 * w32font.c (intern_font_name): Likewise.
4858
4859 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4860
4861 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4862
4863 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4864 of Fcar/Fcdr if possible.
4865 * font.c (check_otf_features): Likewise.
4866 * fontset.c (Fnew_fontset): Likewise.
4867 * gnutls.c (Fgnutls_boot): Likewise.
4868 * minibuf.c (read_minibuf): Likewise.
4869 * msdos.c (IT_set_frame_parameters): Likewise.
4870 * xmenu.c (Fx_popup_dialog): Likewise.
4871 * w32menu.c (Fx_popup_dialog): Likewise.
4872
4873 2012-07-11 Glenn Morris <rgm@gnu.org>
4874
4875 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4876 since nothing has defined it on these platforms.
4877
4878 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4879 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4880
4881 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4882 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4883 Move CLASH_DETECTION to configure.
4884
4885 * s/gnu.h: Remove file, which is now empty.
4886
4887 * s/gnu.h, s/gnu-linux.h:
4888 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4889
4890 2012-07-11 John Wiegley <johnw@newartisans.com>
4891
4892 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4893 function attribute, so we only use it if it exists in the
4894 compiler.
4895
4896 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4897
4898 Avoid call to strlen in fast_c_string_match_ignore_case.
4899 * search.c (fast_c_string_match_ignore_case): Change to use
4900 length argument. Adjust users accordingly.
4901 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4902
4903 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4904
4905 Assume mkdir, rmdir.
4906 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4907 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4908
4909 Assume rename.
4910 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4911
4912 Assume perror.
4913 * s/hpux10-20.h (HAVE_PERROR): Remove.
4914 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4915 Remove dummy definition, as this problem was obsolete long ago.
4916
4917 Assume strerror.
4918 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4919
4920 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4921
4922 Avoid calls to strlen in font processing functions.
4923 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4924 (font_open_by_name): Change to use length argument.
4925 Adjust users accordingly.
4926 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4927 Adjust prototypes.
4928 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4929 Change to return ptrdiff_t.
4930 (xfont_list_pattern, xfont_match): Use length returned by
4931 xfont_decode_coding_xlfd.
4932 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4933
4934 2012-07-11 Glenn Morris <rgm@gnu.org>
4935
4936 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4937 Move DONT_REOPEN_PTY to configure.
4938
4939 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4940 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4941
4942 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4943
4944 Remove "#define unix" that is no longer needed (Bug#11905).
4945 * s/aix4-2.h (unix): Remove; no longer needed.
4946
4947 EMACS_TIME simplification (Bug#11875).
4948 This replaces macros (which typically do not work in GDB)
4949 with functions, typedefs and enums, making the code easier to debug.
4950 The functional style also makes code easier to read and maintain.
4951 * systime.h: Include <sys/time.h> on all hosts, not just if
4952 WINDOWSNT, since 'struct timeval' is needed in general.
4953 (EMACS_TIME): Now a typedef, not a macro.
4954 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4955 not macros.
4956 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4957 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4958 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4959 (EMACS_TIME_LE): Now functions, not macros.
4960 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4961 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4962 which are not functions. All uses rewritten to use:
4963 (make_emacs_time): New function.
4964 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4965 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4966 not functions. All uses rewritten to use the following, respectively:
4967 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4968 (add_emacs_time, sub_emacs_time): New functions.
4969 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4970 * fileio.c (Fcopy_file):
4971 * xterm.c (XTflash): Get the current time closer to when it's used.
4972 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4973
4974 * bytecode.c (targets): Suppress -Woverride-init warnings.
4975
4976 Simplify by avoiding confusing use of strncpy etc.
4977 * doc.c (Fsnarf_documentation):
4978 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4979 * frame.c (Fmake_terminal_frame):
4980 * gtkutil.c (get_utf8_string):
4981 * lread.c (openp):
4982 * nsmenu.m (ns_update_menubar):
4983 * regex.c (regerror):
4984 Prefer memcpy to strncpy and strncat when either will do.
4985 * fileio.c (Fsubstitute_in_file_name):
4986 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4987 (menu_separator_name_p):
4988 * nsmenu.m (ns_update_menubar):
4989 Prefer memcmp to strncmp when either will do.
4990 * nsterm.m: Include <ftoastr.h>.
4991 (ns_get_color):
4992 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4993 Prefer snprintf to strncpy.
4994 * nsterm.m (ns_term_init):
4995 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4996 * nsterm.m (ns_term_init):
4997 Avoid the need for strncpy, by using build_string or
4998 make_unibyte_string directly. Use dtoastr, not snprintf.
4999 * process.c (Fmake_network_process): Diagnose service names that
5000 are too long, rather than silently truncating them or creating
5001 non-null-terminated names.
5002 (Fnetwork_interface_info): Likewise, for interface names.
5003 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5004 Prefer sprintf to strncat.
5005 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5006 Prefer vsnprintf to vsprintf + strncpy.
5007
5008 2012-07-10 Glenn Morris <rgm@gnu.org>
5009
5010 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5011 Clarify fallback case.
5012
5013 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5014
5015 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5016 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5017 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5018 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5019 where argument type is known to be a Lisp_Cons.
5020
5021 2012-07-10 Tom Tromey <tromey@redhat.com>
5022
5023 * bytecode.c (BYTE_CODE_THREADED): New macro.
5024 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5025 (enum byte_code_op): New type.
5026 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5027 (exec_byte_code): Use them. Use token threading when applicable.
5028
5029 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5030
5031 Optimize pure C strings initialization.
5032 * lisp.h (make_pure_string): Fix prototype.
5033 (build_pure_c_string): New function, defined as static inline. This
5034 provides a better opportunity to optimize away calls to strlen when
5035 the function is called with compile-time constant argument.
5036 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5037 argument, adjust users accordingly. Use build_pure_c_string where
5038 appropriate.
5039 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5040 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5041 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5042
5043 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5044
5045 Avoid calls to strlen in miscellaneous functions.
5046 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5047 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5048 * lread.c (openp): Likewise.
5049
5050 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5051
5052 Avoid calls to strlen in path processing functions.
5053 * fileio.c (file_name_as_directory): Add comment. Change to add
5054 srclen argument and return the length of result. Adjust users
5055 accordingly.
5056 (directory_file_name): Fix comment. Change to add srclen argument,
5057 swap 1st and 2nd arguments to obey the common convention.
5058 Adjust users accordingly.
5059 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5060
5061 2012-07-10 Glenn Morris <rgm@gnu.org>
5062
5063 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5064 Move PENDING_OUTPUT_COUNT definition to configure.
5065
5066 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5067 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5068 * s/gnu.h (DATA_START): Move definitions to configure.
5069
5070 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5071 We include usg5-4-common.h, which defines them both.
5072
5073 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5074 O_RDONLY already includes it).
5075
5076 Stop ns builds setting the EMACSLOADPATH environment variable.
5077 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5078 Now it does not set EMACSLOADPATH, just returns the load-path string.
5079 * nsterm.h: Update accordingly.
5080 * lread.c [HAVE_NS]: Include nsterm.h.
5081 (init_lread) [HAVE_NS]: Use ns_load_path.
5082 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5083
5084 2012-07-09 Glenn Morris <rgm@gnu.org>
5085
5086 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5087 since the included bsd-common.h does so.
5088
5089 Stop ns builds setting the EMACSPATH environment variable.
5090 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5091 (ns_init_paths): Do not set EMACSPATH.
5092 * nsterm.h (ns_exec_path): Add it.
5093 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5094 Use ns_exec_path.
5095
5096 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5097
5098 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5099
5100 * process.c (wait_reading_process_output): 'waitchannels' was unset
5101 when read_kbd || !NILP (wait_for_cell); fix this.
5102
5103 Add GCC-style 'const' attribute to functions that can use it.
5104 * character.h (char_resolve_modifier_mask):
5105 * keyboard.h (make_ctrl_char):
5106 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5107 (init_character_once, next_almost_prime, init_fns, init_image)
5108 (flush_pending_output, init_sound):
5109 * mem-limits.h (start_of_data):
5110 * menu.h (finish_menu_items):
5111 Add ATTRIBUTE_CONST.
5112 * emacs.c (DEFINE_DUMMY_FUNCTION):
5113 Declare the dummy function with ATTRIBUTE_CONST.
5114 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5115 Add decls with ATTRIBUTE_CONST.
5116
5117 Minor improvements to make_formatted_string.
5118 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5119 where int is good enough, as vsprintf returns an int.
5120 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5121
5122 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5123
5124 Use make_formatted_string to avoid double length calculation.
5125 * lisp.h (make_formatted_string): New prototype.
5126 * alloc.c (make_formatted_string): New function.
5127 * buffer.c (Fgenerate_new_buffer_name): Use it.
5128 * dbus.c (syms_of_dbusbind): Likewise.
5129 * editfns.c (Fcurrent_time_zone): Likewise.
5130 * filelock.c (get_boot_time): Likewise.
5131 * frame.c (make_terminal_frame, set_term_frame_name)
5132 (x_report_frame_params): Likewise.
5133 * image.c (gs_load): Likewise.
5134 * minibuf.c (get_minibuffer): Likewise.
5135 * msdos.c (dos_set_window_size): Likewise.
5136 * process.c (make_process): Likewise.
5137 * xdisp.c (ensure_echo_area_buffers): Likewise.
5138 * xsettings.c (apply_xft_settings): Likewise.
5139
5140 2012-07-09 Glenn Morris <rgm@gnu.org>
5141
5142 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5143 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5144 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5145 * nsterm.h (ns_etc_directory): Add it.
5146 * callproc.c [HAVE_NS]: Include nsterm.h.
5147 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5148
5149 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5150
5151 Move marker debugging code under MARKER_DEBUG.
5152 * marker.c (MARKER_DEBUG): Move marker debugging code under
5153 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5154 for bootstrap with --enable-checking (~3x slowdown reported
5155 by Juanma Barranquero <lekktu@gmail.com>).
5156 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5157
5158 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5159
5160 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5161 See <http://bugs.gnu.org/11825#29>.
5162
5163 2012-07-08 Eli Zaretskii <eliz@gnu.org>
5164
5165 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5166 has no font, use the frame's font. (Bug#11813)
5167 (display_line): Add commentary about displaying truncation glyphs
5168 on GUI frames.
5169 (produce_special_glyphs): Move here from term.c.
5170
5171 * term.c (produce_special_glyphs): Move to xdisp.c.
5172
5173 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5174 section.
5175
5176 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5177
5178 * xdisp.c (display_line): Avoid warning about implicit declaration
5179 of FRAME_FONT.
5180
5181 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5182
5183 * lisp.h: Remove empty conditional.
5184
5185 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5186
5187 * lread.c (load_path_check): Now static.
5188
5189 Fix some minor --with-ns problems found by static checking.
5190 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5191 (x_set_font) [!HAVE_X_WINDOWS]:
5192 * image.c (xpm_load_image) [HAVE_NS]:
5193 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5194 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5195 Remove unused local.
5196 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5197 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5198 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5199 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5200 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5201 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5202 Fix pointer signedness problem.
5203 * xfaces.c (FRAME_X_FONT_TABLE):
5204 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5205
5206 2012-07-07 Glenn Morris <rgm@gnu.org>
5207
5208 * lread.c (load_path_check): New function, split from init_lread.
5209 (init_lread): Reorganize. Motivation:
5210 If EMACSLOADPATH is set, check/warn about that rather than the
5211 defaults, which we are not going to use. Hence we can remove
5212 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5213 Don't warn if site-lisp directories are missing.
5214 If not installed, start from a blank load-path, since
5215 PATH_LOADSEARCH refers to the eventual installation directories.
5216
5217 2012-07-07 Eli Zaretskii <eliz@gnu.org>
5218
5219 Support truncation and continuation glyphs on GUI frames, when
5220 fringes are disabled. (Bug#11832)
5221 * xdisp.c (init_iterator): Get dimensions of truncation and
5222 continuation glyphs even if on GUI frames.
5223 Adjust it->last_visible_x on GUI frames when the left or right fringes,
5224 or both, are absent.
5225 (start_display, move_it_in_display_line_to): Handle the case of a
5226 GUI frame without a fringe to display continuation or truncation
5227 glyphs.
5228 (insert_left_trunc_glyphs): Support GUI frames: make sure
5229 truncation glyphs overwrite enough glyphs from the current line to
5230 have sufficient space in pixels.
5231 (display_line): Support truncation and continuation glyphs on GUI
5232 frames. If some spare pixels are left on the line after inserting
5233 the truncation glyphs, fill that space with a stretch glyph of a
5234 suitably computed width.
5235
5236 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5237 produce_glyphs, to support GUI sessions.
5238
5239 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5240
5241 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5242
5243 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5244
5245 Do not require float-time's arg to fit in time_t (Bug#11825).
5246 This works better on hosts where time_t is unsigned, and where
5247 float-time is applied to the (negative) difference between two times.
5248 * editfns.c (decode_time_components): Last arg is now double *,
5249 not int *, and means to store all the result as a double, without
5250 worrying about whether the seconds part fits in time_t.
5251 All callers changed.
5252 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5253 All callers changed.
5254 (Ffloat_time): Do not fail merely because the specified time falls
5255 outside of time_t range.
5256
5257 2012-07-07 Glenn Morris <rgm@gnu.org>
5258
5259 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5260 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5261 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5262
5263 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
5264
5265 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5266 Update dependencies.
5267
5268 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5269
5270 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5271
5272 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5273 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5274 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5275 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5276 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5277 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5278
5279 * xfont.c (compare_font_names): Redo to omit the need for casts.
5280
5281 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5282
5283 * xfns.c (Fx_change_window_property): Doc fix.
5284 * w32fns.c (Fx_change_window_property): Doc fix.
5285
5286 * w32fns.c (Fx_window_property): Accept the same arguments as the
5287 X Windows version. Doc fix.
5288 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5289
5290 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5291 Eli Zaretskii <eliz@gnu.org>
5292
5293 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5294 Windows-specific code from nt/config.nt moved here.
5295 Obsolete settings removed.
5296
5297 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5298
5299 * process.c: Avoid unnecessary calls to gettime.
5300 (wait_reading_process_output): Don't get the time of day
5301 when gobbling data immediately and not waiting, as there's no need
5302 for it in that case. This removes a FIXME.
5303
5304 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5305
5306 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5307 is defined (Bug#11768).
5308
5309 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5310
5311 Fix marker debugging code.
5312 * marker.c (byte_char_debug_check): Do not perform the check
5313 if buffer is not multibyte.
5314 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5315 Call byte_char_debug_check with correct arguments.
5316
5317 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5318
5319 Compile marker debugging code only if ENABLE_CHECKING is defined.
5320 * marker.c (byte_char_debug_check, count_markers):
5321 Use only if ENABLE_CHECKING is defined.
5322 (byte_debug_flag): Remove.
5323 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5324 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5325
5326 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5327
5328 Avoid code repetition in marker-related functions.
5329 * marker.c (attach_marker): New function.
5330 (Fset_marker, set_marker_restricted, set_marker_both)
5331 (set_marker_restricted_both): Use it.
5332 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5333 Consistently rename charno to charpos.
5334 (marker_position): Add eassert.
5335 (marker_byte_position): Convert to eassert.
5336
5337 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5338
5339 Simplify list operations in unchain_overlay and unchain_marker.
5340 * buffer.c (unchain_overlay): Simplify. Add comment.
5341 * marker.c (unchain_marker): Simplify. Fix comments.
5342
5343 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5344
5345 Introduce fast path for the widely used marker operation.
5346 * alloc.c (build_marker): New function.
5347 * lisp.h (build_marker): New prototype.
5348 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5349 * composite.c (autocmp_chars): Likewise.
5350 * editfns.c (buildmark): Remove.
5351 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5352 (save_restriction_save): Use build_marker.
5353 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5354 * window.c (save_window_save): Likewise.
5355
5356 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5357
5358 Do not use Fdelete_overlay in delete_all_overlays
5359 to avoid redundant calls to unchain_overlay.
5360 * buffer.c (drop_overlay): New function.
5361 (delete_all_overlays, Fdelete_overlay): Use it.
5362 * minibuf.c (get_minibuffer): Fix comment.
5363
5364 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5365
5366 Port to OpenBSD 5.1 amd64.
5367 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5368 This is needed for OpenBSD, and should be harmless on all BSD systems.
5369 Also, include <sys/sysctl.h>, as it should be available on all
5370 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5371 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5372 use p_pid member, not kp_proc.pid.
5373
5374 2012-07-06 Glenn Morris <rgm@gnu.org>
5375
5376 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5377
5378 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5379
5380 More xmalloc and related cleanup.
5381 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5382 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5383 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5384 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5385 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5386 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5387 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5388 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5389 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5390 * xterm.c:
5391 Omit needless casts involving void * pointers and allocation.
5392 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5393 as the former is more robust if P's type is changed.
5394 Prefer xzalloc to xmalloc + memset 0.
5395 Simplify malloc-or-realloc to realloc.
5396 Don't worry about xmalloc returning a null pointer.
5397 Prefer xstrdup to xmalloc + strcpy.
5398 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5399 growing it.
5400 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5401 alloca of a constant.
5402
5403 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5404
5405 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5406 hscroll is larger than the line width. Fixes long and futile
5407 looping inside extend_face_to_end_of_line (on a TTY) producing
5408 glyphs that are not needed and thrown away.
5409
5410 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5411
5412 * marker.c (set_marker_restricted_both): Simplify by using
5413 clip_to_bounds.
5414
5415 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5416
5417 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5418
5419 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5420
5421 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5422 not defined (Bug#11768).
5423 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5424 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5425 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5426 followed by gtk_box_set_homogeneous (Bug#11768).
5427 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5428 (update_theme_scrollbar_width, xg_create_scroll_bar):
5429 Use gtk_scrollbar_new (Bug#11768).
5430 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5431 (is_box_type): New function (Bug#11768).
5432 (xg_tool_item_stale_p): Call is_box_type.
5433 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5434 with default display (Bug#11768).
5435
5436 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5437
5438 * xdisp.c (window_hscroll_limited): New function.
5439 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5440 coordinates when window's hscroll is set to insanely large
5441 values. (Bug#11857)
5442
5443 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
5444
5445 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5446 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5447
5448 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5449
5450 Cleanup xmalloc.
5451 * lisp.h (xzalloc): New prototype. Omit needless casts.
5452 * alloc.c (xzalloc): New function. Omit needless casts.
5453 * charset.c: Omit needless casts. Convert all calls to
5454 xmalloc with following memset to xzalloc.
5455 * dispnew.c: Likewise.
5456 * fringe.c: Likewise.
5457 * image.c: Likewise.
5458 * sound.c: Likewise.
5459 * term.c: Likewise.
5460 * w32fns.c: Likewise.
5461 * w32font.c: Likewise.
5462 * w32term.c: Likewise.
5463 * xfaces.c: Likewise.
5464 * xfns.c: Likewise.
5465 * xterm.c: Likewise.
5466 * atimer.c: Omit needless casts.
5467 * buffer.c: Likewise.
5468 * callproc.c: Likewise.
5469 * ccl.c: Likewise.
5470 * coding.c: Likewise.
5471 * composite.c: Likewise.
5472 * doc.c: Likewise.
5473 * doprnt.c: Likewise.
5474 * editfns.c: Likewise.
5475 * emacs.c: Likewise.
5476 * eval.c: Likewise.
5477 * filelock.c: Likewise.
5478 * fns.c: Likewise.
5479 * gtkutil.c: Likewise.
5480 * keyboard.c: Likewise.
5481 * lisp.h: Likewise.
5482 * lread.c: Likewise.
5483 * minibuf.c: Likewise.
5484 * msdos.c: Likewise.
5485 * print.c: Likewise.
5486 * process.c: Likewise.
5487 * region-cache.c: Likewise.
5488 * search.c: Likewise.
5489 * sysdep.c: Likewise.
5490 * termcap.c: Likewise.
5491 * terminal.c: Likewise.
5492 * tparam.c: Likewise.
5493 * w16select.c: Likewise.
5494 * w32.c: Likewise.
5495 * w32reg.c: Likewise.
5496 * w32select.c: Likewise.
5497 * w32uniscribe.c: Likewise.
5498 * widget.c: Likewise.
5499 * xdisp.c: Likewise.
5500 * xmenu.c: Likewise.
5501 * xrdb.c: Likewise.
5502 * xselect.c: Likewise.
5503
5504 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5505
5506 * fileio.c (time_error_value): Check the right error number.
5507 Problem reported by Troels Nielsen in
5508 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5509
5510 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5511
5512 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5513 This should be fixed in a better way; see Eli Zaretskii in
5514 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5515 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5516
5517 * fileio.c (time_error_value): Rename from special_mtime.
5518 The old name's problems were noted by Eli Zaretskii in
5519 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5520
5521 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5522 This variable's comment says Emacs needs at least one GDB-visible
5523 symbol of type enum pvec_type, to work around GDB problems.
5524 The symbol's value doesn't matter.
5525
5526 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5527 that causes compilation to fail on pre-C99 compilers.
5528
5529 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
5530
5531 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5532 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5533
5534 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5535
5536 * buffer.c (init_buffer_once): Fix initialization of
5537 headers for buffer_defaults and buffer_local_symbols.
5538 Reported by Juanma Barranquero <lekktu@gmail.com>.
5539
5540 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5541
5542 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5543 * lisp.h (enum pvec_type): Use fewer bits.
5544 (PSEUDOVECTOR_SIZE_BITS): New constant.
5545 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5546 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5547 change in pvec_type.
5548 (PSEUDOVECTOR_TYPEP): New macro.
5549 (TYPED_PSEUDOVECTORP): Use it.
5550 * fns.c (internal_equal): Adapt code to extract pvectype.
5551 * emacs.c (gdb_pvec_type): Update type.
5552 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5553 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5554 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5555 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5556 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5557 abusing vector->header.next.nbytes.
5558 (live_vector_p): Use PVEC_TYPE.
5559 (mark_object): Adapt code to extract pvectype. Use switch.
5560
5561 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5562
5563 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5564 Tighten new eassert a bit.
5565
5566 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5567
5568 Fix compilation with --enable-gcc-warnings and -O1
5569 optimization level.
5570 * doprnt.c (doprnt): Change type of tem to int, initialize
5571 to avoid compiler warning. Add eassert.
5572 * search.c (simple_search): Initialize match_byte to avoid
5573 compiler warning. Add eassert.
5574
5575 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5576
5577 Avoid weird behavior with large horizontal scrolls.
5578 Without this change, for example, large hscroll values would
5579 mess up Emacs's display on Fedora 15 x86, presumably due to
5580 overflows in int calculations in the display code.
5581 Also, if buffers had long lines, Emacs would freeze.
5582 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5583 (set_window_hscroll): New function, containing the old guts of
5584 Fset_window_hscroll. Return the clipped value.
5585 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5586 This avoids the need to check against PTRDIFF_MAX.
5587
5588 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5589
5590 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5591
5592 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5593
5594 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5595
5596 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5597 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5598 since GCC 4.4.6 issues a bogus warning for them.
5599
5600 Fix bugs in file timestamp newness comparisons.
5601 * fileio.c (Ffile_newer_than_file_p):
5602 * lread.c (Fload): Use full timestamp resolution of files,
5603 not just the 1-second resolution, so that files that are only
5604 slightly newer still count as newer.
5605 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5606 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5607
5608 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5609
5610 * fileio.c: Improve handling of file time marker. (Bug#11852)
5611 (special_mtime): New function.
5612 (Finsert_file_contents, Fverify_visited_file_modtime):
5613 Use it to set special mtime values consistently.
5614
5615 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5616
5617 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5618 marker for non-existing file. (Bug#11852)
5619
5620 2012-07-03 Glenn Morris <rgm@gnu.org>
5621
5622 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5623 and did not make it into globals.h).
5624
5625 2012-07-03 Tom Tromey <tromey@redhat.com>
5626
5627 * window.c (Fset_window_margins, Fset_window_fringes)
5628 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5629 * textprop.c (Fprevious_property_change): No longer static.
5630 * syntax.c (Fsyntax_table_p): No longer static.
5631 * process.c (Fget_process, Fprocess_datagram_address): No longer
5632 static.
5633 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5634 * keyboard.c (Fcommand_execute): No longer static.
5635 Remove EXFUN.
5636 * insdel.c (Fcombine_after_change_execute): No longer static.
5637 * image.c (Finit_image_library): No longer static.
5638 * fileio.c (Fmake_symbolic_link): No longer static.
5639 * eval.c (Ffetch_bytecode): No longer static.
5640 * editfns.c (Fuser_full_name): No longer static.
5641 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5642 No longer static.
5643 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5644 static.
5645 * dired.c (Ffile_attributes): No longer static.
5646 * composite.c (Fcomposition_get_gstring): No longer static.
5647 * callproc.c (Fgetenv_internal): No longer static.
5648
5649 * ccl.h: Remove EXFUNs.
5650 * buffer.h: Remove EXFUNs.
5651 * dispextern.h: Remove EXFUNs.
5652 * intervals.h: Remove EXFUNs.
5653 * fontset.h: Remove EXFUN.
5654 * font.h: Remove EXFUNs.
5655 * dosfns.c (system_process_attributes): Remove EXFUN.
5656 * keymap.h: Remove EXFUNs.
5657 * lisp.h: Remove EXFUNs.
5658 * w32term.h: Remove EXFUNs.
5659 * window.h: Remove EXFUNs.
5660 * xsettings.h: Remove EXFUN.
5661 * xterm.h: Remove EXFUN.
5662
5663 2012-07-03 Glenn Morris <rgm@gnu.org>
5664
5665 * lisp.h (Frandom): Make it visible to C.
5666 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5667 buffer for invisible buffers. (Bug#1229)
5668
5669 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5670
5671 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5672 values which aren't power of 2.
5673 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5674 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5675 accordingly.
5676
5677 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5678
5679 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5680
5681 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5682
5683 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5684
5685 * alloc.c (allocate_vector_block): Remove redundant
5686 calls to mallopt if DOUG_LEA_MALLOC is defined.
5687 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5688 avoid calls to mallopt if zero_vector is returned.
5689
5690 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5691
5692 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5693 is enabled, avoid dereferencing NULL current_sblock if
5694 running undumped.
5695
5696 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5697
5698 Cleanup basic buffer management.
5699 * buffer.h (struct buffer): Change layout to use generic vector
5700 marking code. Fix some comments. Change type of 'clip_changed'
5701 to bitfield. Remove unused #ifndef old.
5702 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5703 (GET_OVERLAYS_AT): Fix indentation.
5704 (for_each_per_buffer_object_at): New macro.
5705 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5706 (Fbuffer_local_variables): Use it.
5707 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5708 * alloc.c (allocate_buffer): Adjust to match new layout of
5709 struct buffer. Fix comment.
5710 (mark_overlay): New function.
5711 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5712 Lisp area of struct buffer.
5713 (mark_object): Use it. Adjust marking of misc objects
5714 and related comments.
5715
5716 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5717
5718 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5719 wrapper that is not needed because the wrapped code is a no-op (zero
5720 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5721 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5722
5723 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5724
5725 * alloc.c (mark_buffer): Simplify. Remove prototype.
5726 (mark_object): Add comment. Reorganize marking of vector-like
5727 objects. Use CHECK_LIVE for all vector-like objects except buffers
5728 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5729 Avoid redundant calls to mark_vectorlike for bool vectors.
5730
5731 2012-06-30 Glenn Morris <rgm@gnu.org>
5732
5733 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5734
5735 * epaths.in (PATH_SITELOADSEARCH): New.
5736 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5737 This is rather than relying on --enable-locallisppath elements
5738 having "site-lisp" in their names. (Bug#10208#25, 11658)
5739
5740 2012-06-30 Eli Zaretskii <eliz@gnu.org>
5741
5742 * w32proc.c (sys_select): Accept and ignore one more argument.
5743
5744 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5745
5746 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5747 (pselect) [!MS_DOS]: Redirect to sys_select.
5748
5749 * sysdep.c: Don't include dos.h and dosfns.h.
5750
5751 * process.c (sys_select):
5752 * msdos.c (sys_select): Accept one more argument and ignore it.
5753
5754 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5755 adapt data types and code to that.
5756
5757 * dosfns.c:
5758 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5759 which clashes with the gnulib function of the same name.
5760
5761 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5762
5763 * font.c (font_style_to_value, font_style_symbolic)
5764 (font_prop_validate_style): Add type checks for values in
5765 font_style_table.
5766
5767 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5768 argument.
5769 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5770 uses.
5771
5772 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5773
5774 * xdisp.c (try_window_id): Undo last change.
5775
5776 * w32.c (getwd): Adjust commentary about startup_dir.
5777 (init_environment): Always call sys_access, even in non-MSVC
5778 builds. Don't chdir to the directory of the Emacs executable.
5779 This undoes code from 1997 which was justified by the need to
5780 "avoid conflicts when removing and renaming directories". But its
5781 downside was that every relative file name was being interpreted
5782 relative to the directory of the Emacs executable, which can never
5783 be TRT. In particular, it broke sys_access when called with
5784 relative file names.
5785 (sys_access): Map GetLastError to errno.
5786
5787 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5788
5789 * window.h (struct window): Change type of 'fringes_outside_margins'
5790 to bitfield. Fix comment. Adjust users accordingly.
5791 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5792 Adjust comment.
5793 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5794 to ptrdiff_t.
5795
5796 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5797
5798 * gnutls.c (emacs_gnutls_handshake):
5799 Add QUIT to make the loop interruptible.
5800
5801 2012-06-29 Glenn Morris <rgm@gnu.org>
5802
5803 * charset.c (init_charset): Make lack of etc/charsets fatal.
5804
5805 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5806
5807 * editfns.c (region_limit): Fix type mismatch.
5808
5809 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5810
5811 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5812 undefined. Convert from xassert to eassert.
5813 * nsmenu.m: Convert from xassert to eassert.
5814 * nsterm.m: Likewise.
5815
5816 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5817
5818 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5819
5820 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5821
5822 Avoid integer overflow on scroll-left and scroll-right.
5823 * window.c (HSCROLL_MAX): New macro.
5824 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5825 overflow when requested scroll falls outside ptrdiff_t range.
5826
5827 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5828
5829 * window.h (struct window): Change type of 'hscroll',
5830 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5831 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5832 Adjust users accordingly.
5833 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5834 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5835 from EMACS_INT to ptrdiff_t.
5836 (make_window): Omit redundant initialization.
5837
5838 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5839
5840 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5841
5842 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5843
5844 * window.h (struct window): Change type of 'use_time' and
5845 'sequence_number' from Lisp_Object to int.
5846 * frame.c (make_frame): Adjust users accordingly.
5847 * print.c (print_object): Likewise.
5848 * window.c (select_window, Fwindow_use_time, make_parent_window)
5849 (make_window): Likewise.
5850
5851 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5852
5853 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5854 enabled with --enable-checking=[all,glyphs] configure option.
5855 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5856 adjust comments accordingly.
5857 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5858 undefined, adjust comments accordingly.
5859 * image.c: Likewise.
5860 * scroll.c: Likewise.
5861 * w32fns.c: Likewise.
5862 * w32term.c: Likewise.
5863 * xdisp.c: Likewise.
5864 * xfaces.c: Likewise.
5865 * xfns.c: Likewise.
5866 * xterm.c: Likewise.
5867
5868 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5869
5870 Generalize run-time debugging checks.
5871 * dispextern.h (XASSERTS): Remove.
5872 * fontset.c (xassert): Remove.
5873 Convert from xassert to eassert.
5874 * alloc.c: Convert from xassert to eassert.
5875 * bidi.c: Likewise.
5876 * dispnew.c: Likewise.
5877 * fns.c: Likewise.
5878 * fringe.c: Likewise.
5879 * ftfont.c: Likewise.
5880 * gtkutil.c: Likewise.
5881 * image.c: Likewise.
5882 * keyboard.c: Likewise.
5883 * menu.c: Likewise.
5884 * process.c: Likewise.
5885 * scroll.c: Likewise.
5886 * sound.c: Likewise.
5887 * term.c: Likewise.
5888 * w32console.c: Likewise.
5889 * w32fns.c: Likewise.
5890 * w32term.c: Likewise.
5891 * window.c: Likewise.
5892 * xdisp.c: Likewise.
5893 * xfaces.c: Likewise.
5894 * xfns.c: Likewise.
5895 * xselect.c: Likewise.
5896 * xterm.c: Likewise.
5897
5898 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5899
5900 * fns.c (maybe_resize_hash_table): Output message when growing the
5901 purify-hashtable.
5902
5903 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5904
5905 * alloc.c (allocate_string_data): Remove dead code.
5906 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5907 avoid GCC warning about unused macro.
5908
5909 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5910
5911 * alloc.c (allocate_string): Omit intervals initialization.
5912 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5913 as in make_pure_string and make_pure_c_string.
5914
5915 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5916
5917 * alloc.c (allocate_string): Fix last change.
5918
5919 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5920
5921 * alloc.c (allocate_string): Remove two redundant calls
5922 to memset, add explicit initialization where appropriate.
5923
5924 2012-06-27 Glenn Morris <rgm@gnu.org>
5925
5926 * lisp.mk (lisp): Remove paths.elc.
5927
5928 2012-06-27 Chong Yidong <cyd@gnu.org>
5929
5930 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5931
5932 2012-06-26 John Wiegley <johnw@newartisans.com>
5933
5934 * unexmacosx.c (copy_data_segment): Add two section names used
5935 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5936
5937 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5938 when building with Clang.
5939
5940 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5941
5942 * eval.c (Fapply): Allow calling it with a single argument.
5943
5944 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5945
5946 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5947 _stricmp and _strnicmp.
5948 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5949
5950 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5951
5952 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5953 allocated window.
5954 (allocate_process): Likewise for new process.
5955 (allocate_terminal): Change to use offsetof.
5956 (allocate_frame): Likewise.
5957 * frame.c (make_frame): Omit redundant initialization.
5958 * window.c (make_parent_window): Use memset.
5959 (make_window): Omit redundant initialization.
5960 * process.c (make_process): Omit redundant initialization.
5961 * terminal.c (create_terminal): Likewise.
5962
5963 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5964
5965 * term.c (delete_tty): Remove redundant call to memset.
5966
5967 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5968
5969 * alloc.c: Remove build_string.
5970 * lisp.h: Define build_string as static inline. This provides
5971 a better opportunity to optimize away calls to strlen when the
5972 function is called with compile-time constant argument.
5973 * image.c (imagemagick_error): Convert to build_string.
5974 * w32proc.c (sys_spawnve): Likewise.
5975 * xterm.c (x_term_init): Likewise.
5976
5977 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5978
5979 Use sprintf return value instead of invoking strlen on result.
5980 In the old days this wasn't portable, since some sprintf
5981 implementations returned char *. But they died out years ago and
5982 Emacs already assumes sprintf returns int.
5983 Similarly for float_to_string.
5984 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5985 * ccl.c (ccl_driver):
5986 * character.c (string_escape_byte8):
5987 * data.c (Fnumber_to_string):
5988 * doprnt.c (doprnt):
5989 * print.c (print_object):
5990 * xdisp.c (message_dolog):
5991 * xfns.c (syms_of_xfns):
5992 Use sprintf or float_to_string result to avoid need to call strlen.
5993 * data.c (Fnumber_to_string):
5994 Use make_unibyte_string, since the string must be ASCII.
5995 * lisp.h, print.c (float_to_string): Now returns int length.
5996 * term.c (produce_glyphless_glyph):
5997 Use sprintf result rather than recomputing it.
5998
5999 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6000 * Makefile.in (ALL_CFLAGS):
6001 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6002 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6003
6004 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6005
6006 * dispextern.h (xstrcasecmp): Define to library function
6007 strcasecmp if available.
6008 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6009
6010 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6011
6012 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6013 Avoid comma operator.
6014 * menu.c (push_submenu_start, push_submenu_end)
6015 (push_left_right_boundary, push_menu_pane): Likewise.
6016 * msdos.c (dos_rawgetc): Likewise.
6017
6018 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6019
6020 * xfns.c (xic_create_fontsetname): Remove redundant calls
6021 to memset.
6022
6023 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6024
6025 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6026 sprintf already null-terminates its output.
6027
6028 * xfns.c (x_window): Remove redundant cast.
6029
6030 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6031
6032 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6033 `const char *' to `char *' to avoid compiler warning.
6034
6035 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6036
6037 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6038 instead of truncating it to 63 (admittedly a generous limit).
6039
6040 * process.c: Fix spelling and caps in comments.
6041
6042 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6043
6044 * emacs.c (setpgrp): Remove definition, unused.
6045 * sysdep.c (setpgrp): Remove definition, not used in this file.
6046
6047 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
6048
6049 * makefile.w32-in: Update dependencies.
6050
6051 2012-06-24 Eli Zaretskii <eliz@gnu.org>
6052
6053 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6054 (SYSTIME_H): Add nt/inc/sys/time.h.
6055
6056 * systime.h [WINDOWSNT]: Include sys/time.h.
6057
6058 * s/ms-w32.h (struct timespec): Definition moved from
6059 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6060
6061 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6062
6063 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6064 * buffer.h (buffer_slot_type_mismatch):
6065 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6066 * eval.c (unwind_to_catch):
6067 * image.c (my_png_error, my_error_exit):
6068 * keyboard.c (quit_throw_to_read_char, user_error)
6069 (Fexit_recursive_edit, Fabort_recursive_edit):
6070 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6071 (wrong_type_argument, buffer_overflow, __executable_start)
6072 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6073 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6074 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6075 (fatal):
6076 (child_setup) [!DOS_NT]:
6077 * lread.c (end_of_file_error, invalid_syntax):
6078 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6079 * puresize.h (pure_write_error):
6080 * search.c (matcher_overflow):
6081 * sound.c (sound_perror, alsa_sound_perror):
6082 * sysdep.c, syssignal.h (croak):
6083 * term.c (maybe_fatal, vfatal):
6084 * textprop.c (text_read_only):
6085 * undo.c (user_error):
6086 * unexmacosx.c (unexec_error):
6087 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6088 Use _Noreturn rather than NO_RETURN.
6089 No need for separate decl merely because of _Noreturn.
6090 * sound.c (sound_warning, parse_sound):
6091 Remove unnecessary forward decls.
6092
6093 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6094
6095 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6096 * lisp.h (WAIT_READING_MAX): New macro.
6097 * dispnew.c (Fsleep_for, sit_for):
6098 * keyboard.c (kbd_buffer_get_event):
6099 * process.c (Faccept_process_output):
6100 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6101 This improves on the previous patch, which introduced a bug
6102 when time_t is unsigned and as wide as intmax_t.
6103 See <http://bugs.gnu.org/9000#51>.
6104
6105 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6106
6107 * dispnew.c (sit_for, Fsleep_for):
6108 * keyboard.c (kbd_buffer_get_event):
6109 * process.c (Faccept_process_output): Avoid compiler warnings when
6110 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6111
6112 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
6113
6114 * makefile.w32-in: Update dependencies.
6115
6116 * w32.c (ltime): Add return type and declare static.
6117 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6118
6119 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6120
6121 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6122 Privately reported by Herbert J. Skuhra.
6123 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6124 All uses changed.
6125 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6126 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6127
6128 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6129
6130 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6131 last argument of make_unibyte_string.
6132
6133 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6134 language ID in the event parameters.
6135
6136 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6137 event.code, not the obscure "character set ID".
6138
6139 2012-06-23 Chong Yidong <cyd@gnu.org>
6140
6141 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6142
6143 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6144
6145 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6146 * w32.c (fdutimens): New function.
6147
6148 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6149
6150 * s/ms-w32.h (pselect): Redirect to sys_select.
6151
6152 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6153
6154 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6155 in the logic of incrementing and decrementing the value of
6156 use_relocatable_buffers.
6157
6158 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6159
6160 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6161 Privately reported by Herbert J. Skuhra.
6162 [__FreeBSD__]: Remove "*/" typo after "#include".
6163 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6164 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6165 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6166 Don't assume EMACS_TIME and struct timeval are the same type.
6167
6168 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6169
6170 Support higher-resolution time stamps (Bug#9000).
6171 The time stamps are only nanosecond-resolution at the C level,
6172 since that's the best that any real-world system supports now.
6173 But they are picosecond-resolution at the Lisp level, as that's
6174 easy, and leaves room for future OS improvements.
6175
6176 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6177 (LIBES): Use it.
6178
6179 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6180 Don't get current time unless it's needed.
6181
6182 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6183 now provides it if it's absent.
6184 (start_atimer): Port to higher-res time stamps.
6185 Check for time stamp overflow. Don't get current time more
6186 often than is needed.
6187
6188 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6189 Include systime.h, not time.h.
6190 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6191
6192 * dired.c: Include stat-time.h.
6193 (Ffile-attributes): File times now have higher resolution.
6194
6195 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6196 (struct image): Timestamp now has higher resolution.
6197
6198 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6199 has at least microseconds now. All uses removed.
6200 (update_frame, update_single_window, update_window, update_frame_1)
6201 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
6202 (duration_to_sec_usec): Remove; no longer needed.
6203
6204 * editfns.c (time_overflow): Now extern.
6205 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6206 (float-time, Fformat_time_string, Fcurrent_time_string)
6207 (Fcurrent_time_zone): Accept and generate higher-resolution
6208 time stamps.
6209 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6210 (decode_time_components, lisp_seconds_argument): New functions.
6211 (make_time): Now static.
6212 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6213 Report an error if the time is invalid, rather than having the caller
6214 do that.
6215
6216 * fileio.c: Include <stat-time.h>
6217 (Fcopy_file): Copy higher-resolution time stamps.
6218 Prefer to set the time stamp via a file descriptor if that works.
6219 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6220 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6221 (Fvisited_file_modtime, Fset_visited_file_modtime):
6222 Support higher-resolution time stamps.
6223
6224 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6225
6226 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6227
6228 * image.c (prepare_image_for_display, clear_image_cache)
6229 (lookup_image): Port to higer-resolution time stamps.
6230
6231 * keyboard.c (start_polling, bind_polling_period):
6232 Check for time stamp overflow.
6233 (read_char, kbd_buffer_get_event, timer_start_idle)
6234 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6235 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6236 Port to higher-resolution time stamps. Do not assume time_t is signed.
6237 (decode_timer): New function. Timers are now vectors of length 9,
6238 not 8, to accommodate the picosecond component.
6239 (timer_check_2): Use it.
6240
6241 * nsterm.m (select_timeout, timeval_subtract): Remove.
6242 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6243 as they're a bit more accurate and handle overflow better.
6244 (ns_select): Change prototype to be compatible with pselect.
6245 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6246 * nsterm.h (ns_select): Adjust prototype.
6247
6248 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6249 us-resolution time stamps.
6250 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6251
6252 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6253
6254 * lisp.h (time_overflow): New decl.
6255 (wait_reading_process_output): First arg is now intmax_t, not int,
6256 to accommodate larger waits.
6257
6258 * process.h (struct Lisp_Process.read_output_delay):
6259 Now counts nanoseconds, not microseconds.
6260 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6261 EMACS_HAS_USECS.
6262 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6263 (wait_reading_process_output):
6264 Port to ns-resolution time stamps.
6265 (Faccept_process_output, wait_reading_process_output):
6266 Check for time stamp overflow. Do not assume time_t is signed.
6267 (select_wrapper): Remove; we now use pselect.
6268 (Fprocess_attributes): Now generates ns-resolution time stamps.
6269
6270 * sysdep.c: Include utimens.h. Don't include utime.h
6271 or worry about struct utimbuf; gnulib does that for us now.
6272 (gettimeofday): Remove; gnulib provides a substitute.
6273 (make_timeval): New function.
6274 (set_file_times): Now sets ns-resolution time stamps.
6275 New arg FD; all uses changed.
6276 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6277 (system_process_attributes):
6278 Now returns ns-resolution time stamp. All uses changed.
6279 Check for time stamp overflow.
6280
6281 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6282 provides a substitute now.
6283
6284 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6285 since it guarantees struct timespec.
6286 (EMACS_TIME): Now struct timespec, so that we can support
6287 ns-resolution time stamps.
6288 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6289 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6290 (EMACS_USECS): Remove.
6291 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6292 so multiply the arg by 1000 before storing it.
6293 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6294 New macros.
6295 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6296 Port to ns-resolution time stamps.
6297 (EMACS_TIME_NEG_P): Remove; replaced by....
6298 (EMACS_TIME_SIGN): New macro.
6299 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6300 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6301 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6302 (make_timeval, make_lisp_time, decode_time_components): New decls.
6303 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6304 that it mishandled time_t overflow. You can't compare by subtracting!
6305 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6306 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6307
6308 * term.c: Include <sys/time.h>.
6309 (timeval_to_Time): New function, for proper overflow wraparound.
6310 (term_mouse_position, term_mouse_click): Use it.
6311
6312 * undo.c (record_first_change): Support higher-resolution time stamps
6313 in the undo buffer.
6314 (Fprimitive_undo): Use them when restoring time stamps.
6315
6316 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6317 (w32_get_internal_run_time):
6318 Port to higher-resolution Emacs time stamps.
6319 (ltime): Now accepts single 64-bit integer, as that's more convenient
6320 for callers.
6321
6322 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6323
6324 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6325 for compatibility with pselect. Support ns-resolution time stamps.
6326
6327 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6328
6329 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6330 Check for time stamp overflow, and support ns-resolution time stamps.
6331
6332 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6333 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6334 (timeval_subtract): Remove; no longer needed.
6335 (XTflash, XTring_bell, x_wait_for_event):
6336 Port to ns-resolution time stamps. Don't assume time_t is signed.
6337
6338 2012-06-22 Chong Yidong <cyd@gnu.org>
6339
6340 * xdisp.c (x_consider_frame_title): Revert last change.
6341
6342 2012-06-22 Eli Zaretskii <eliz@gnu.org>
6343
6344 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6345 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6346 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6347 staticidx goes up to 1597 out of 1600 = 0x640.)
6348
6349 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6350
6351 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6352 Otherwise, the umask might be mistakenly 0 while handling input signals.
6353
6354 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6355
6356 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6357
6358 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6359
6360 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6361 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6362 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6363 access to `contents' member of Lisp_Vector objects with AREF and ASET
6364 where appropriate.
6365
6366 2012-06-19 Chong Yidong <cyd@gnu.org>
6367
6368 * frame.c (delete_frame): When selecting a frame on a different
6369 text terminal, do not alter the terminal's top-frame.
6370
6371 * xdisp.c (format_mode_line_unwind_data): Record the target
6372 frame's selected window and its terminal's top-frame.
6373 (unwind_format_mode_line): Restore them.
6374 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6375 Callers changed.
6376 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6377 since tty frames can be explicitly named.
6378 (prepare_menu_bars): Likewise.
6379
6380 * term.c (Ftty_top_frame): New function.
6381
6382 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6383
6384 Port byte-code-meter to modern targets.
6385 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6386 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6387 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6388 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6389 (METER_1, METER_2): Simplify.
6390
6391 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6392
6393 * data.c (Fdefalias): Return `symbol' (bug#11686).
6394
6395 2012-06-18 Martin Rudalics <rudalics@gmx.at>
6396
6397 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6398 gets killed during executing of this function (Bug#11665).
6399 Try to always return Qt when the buffer has been actually killed.
6400 (Vkill_buffer_query_functions): In doc-string say that functions
6401 run by this hook should not change the current buffer.
6402
6403 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6404
6405 Fix recently-introduced process.c problems found by static checking.
6406 * process.c (write_queue_push, write_queue_pop, send_process):
6407 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6408 (write_queue_pop): Fix pointer signedness problem.
6409 (send_process): Remove unused local.
6410
6411 2012-06-17 Chong Yidong <cyd@gnu.org>
6412
6413 * xdisp.c (redisplay_internal): No need to redisplay terminal
6414 frames that are not on top.
6415
6416 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
6417
6418 * process.c (make_process): Initialize write_queue.
6419 (write_queue_push, write_queue_pop): New functions.
6420 (send_process): Use them to maintain correct ordering of process
6421 writes (Bug#10815).
6422
6423 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6424
6425 * lisp.h (eassert): Assume C89 or later.
6426 This removes the need for CHECK.
6427 (CHECK): Remove. Its comments about always evaluating its
6428 argument were confusing, as 'eassert' typically does not evaluate
6429 its argument.
6430
6431 * coding.c (produce_chars): Use ptrdiff_t, not int.
6432
6433 * xterm.c (x_draw_underwave): Check for integer overflow.
6434 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6435
6436 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
6437
6438 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6439 referenced (Bug#11583).
6440
6441 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6442
6443 Implement wave-style variant of underlining.
6444 * dispextern.h (face_underline_type): New enum.
6445 (face): Add field for underline type.
6446 * nsterm.m (ns_draw_underwave): New function.
6447 (ns_draw_text_decoration): Use it.
6448 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6449 New functions.
6450 (x_draw_glyph_string): Use them.
6451 * xfaces.c (Qline, Qwave): New Lisp objects.
6452 (check_lface_attrs, merge_face_ref)
6453 (Finternal_set_lisp_face_attribute, realize_x_face):
6454 Handle wave-style underline face attributes.
6455 * xterm.c (x_draw_underwave): New function.
6456 (x_draw_glyph_string): Use it.
6457
6458 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
6459
6460 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6461 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6462 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6463 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6464 ($(BLD)/w32select.$(O)): Update dependencies.
6465
6466 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6467
6468 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6469 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6470 * character.c (_fetch_multibyte_char_p): Remove.
6471 * alloc.c: Include "character.h" before "buffer.h".
6472 * bidi.c: Likewise.
6473 * buffer.c: Likewise.
6474 * bytecode.c: Likewise.
6475 * callint.c: Likewise.
6476 * callproc.c: Likewise.
6477 * casefiddle.c: Likewise.
6478 * casetab.c: Likewise.
6479 * category.c: Likewise.
6480 * cmds.c: Likewise.
6481 * coding.c: Likewise.
6482 * composite.c: Likewise.
6483 * dired.c: Likewise.
6484 * dispnew.c: Likewise.
6485 * doc.c: Likewise.
6486 * dosfns.c: Likewise.
6487 * editfns.c: Likewise.
6488 * emacs.c: Likewise.
6489 * fileio.c: Likewise.
6490 * filelock.c: Likewise.
6491 * font.c: Likewise.
6492 * fontset.c: Likewise.
6493 * fringe.c: Likewise.
6494 * indent.c: Likewise.
6495 * insdel.c: Likewise.
6496 * intervals.c: Likewise.
6497 * keyboard.c: Likewise.
6498 * keymap.c: Likewise.
6499 * lread.c: Likewise.
6500 * macros.c: Likewise.
6501 * marker.c: Likewise.
6502 * minibuf.c: Likewise.
6503 * nsfns.m: Likewise.
6504 * nsmenu.m: Likewise.
6505 * print.c: Likewise.
6506 * process.c: Likewise.
6507 * regex.c: Likewise.
6508 * region-cache.c: Likewise.
6509 * search.c: Likewise.
6510 * syntax.c: Likewise.
6511 * term.c: Likewise.
6512 * textprop.c: Likewise.
6513 * undo.c: Likewise.
6514 * unexsol.c: Likewise.
6515 * w16select.c: Likewise.
6516 * w32fns.c: Likewise.
6517 * w32menu.c: Likewise.
6518 * window.c: Likewise.
6519 * xdisp.c: Likewise.
6520 * xfns.c: Likewise.
6521 * xmenu.c: Likewise.
6522 * xml.c: Likewise.
6523 * xselect.c: Likewise.
6524
6525 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6526
6527 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6528 If all the glyphs of the glyph row came from strings, and we have no
6529 cursor positioning clues, put the cursor on the first glyph of the
6530 row.
6531 (handle_face_prop): Use chunk-relative overlay string index when
6532 indexing into it->string_overlays array. (Bug#11653)
6533 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6534 the rightmost. (Bug#11720)
6535
6536 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6537
6538 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6539 (CATEGORY_MEMBER): Enforce 1/0 value.
6540 * category.c (_temp_category_set): Remove.
6541
6542 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6543
6544 * window.c (Fdelete_other_windows_internal)
6545 (Fdelete_window_internal): Don't access frame's mouse highlight
6546 info of the initial frame. (Bug#11677)
6547
6548 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6549
6550 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6551 Assume USE_2_TAGS_FOR_INTS.
6552 (xreload): Adjust $tagmask width to match recent lisp.h change.
6553
6554 Simplify lisp.h in minor ways that should not affect code.
6555 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6556 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6557 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6558 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6559 (INTTYPEBITS): New macro, for clarity.
6560 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6561 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6562 Simplify now that USE_LSB_TAG is always defined.
6563 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6564 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6565
6566 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
6567
6568 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6569
6570 2012-06-13 Glenn Morris <rgm@gnu.org>
6571
6572 * s/bsd-common.h (BSD4_3):
6573 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6574
6575 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6576
6577 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6578 instead of union.
6579 (XLI, XIL): Define.
6580 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6581 Use them.
6582 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6583 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6584 * alloc.c (widen_to_Lisp_Object): Remove.
6585 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6586 * frame.c (delete_frame): Remove outdated comment.
6587 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6588 USE_LISP_UNION_TYPE.
6589 (Fw32_unregister_hot_key): Likewise.
6590 (Fw32_toggle_lock_key): Likewise.
6591 * w32menu.c (add_menu_item): Likewise.
6592 (w32_menu_display_help): Use XIL instead of checking
6593 USE_LISP_UNION_TYPE.
6594 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6595 (init_heap): Likewise.
6596 * w32term.c (w32_read_socket): Update comment.
6597
6598 2012-06-13 Glenn Morris <rgm@gnu.org>
6599
6600 * s/usg5-4-common.h, src/s/unixware.h:
6601 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6602
6603 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6604
6605 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6606
6607 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6608 * alloc.c (make_number) [!defined make_number]:
6609 Remove, as lisp.h always defines this now.
6610 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6611 (roundup_size): Verify that it is a power of 2.
6612 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6613 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6614 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6615 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6616 USE_LSB_TAG now is always defined to be either 0 or 1.
6617 All uses changed.
6618 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6619 code works fine either way, and efficiency is not a concern here,
6620 as the union type is for debugging, not for production.
6621 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6622 Use an inline function on all platforms when using the union type,
6623 since this is simpler and 'static inline' can be used portably
6624 within Emacs now.
6625 (LISP_INITIALLY_ZERO): New macro.
6626 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6627 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6628
6629 2012-06-12 Glenn Morris <rgm@gnu.org>
6630
6631 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6632
6633 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6634
6635 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6636 Move BROKEN_SIGIO to configure.
6637
6638 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6639 Move NO_TERMIO to configure.
6640
6641 2012-06-12 Chong Yidong <cyd@gnu.org>
6642
6643 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6644 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6645 MagickExportImagePixels is undefined.
6646
6647 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6648
6649 * image.c (imagemagick_load_image): Remove unused label.
6650
6651 2012-06-11 Glenn Morris <rgm@gnu.org>
6652
6653 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6654 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6655 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6656 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6657
6658 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6659
6660 * alloc.c (make_byte_code): New function.
6661 (Fmake_byte_code): Use it. Don't purify here.
6662 * lread.c (read1): Use it as well to avoid extra allocation.
6663
6664 2012-06-11 Chong Yidong <cyd@gnu.org>
6665
6666 * image.c (imagemagick_load_image): Implement transparency.
6667
6668 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6669
6670 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6671 account for preceding backslashes. (Bug#11663)
6672
6673 2012-06-09 Chong Yidong <cyd@gnu.org>
6674
6675 * term.c: Support italics in capable terminals (Bug#9652).
6676 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6677 (turn_on_face): Output using TS_enter_italic_mode if available.
6678 Don't handle unused blinking and alt-charset cases.
6679 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6680 and tty_alt_charset_p cases.
6681 (tty_capable_p, init_tty): Support italics.
6682
6683 * termchar.h (struct tty_display_info): Add field for italics.
6684 Remove unused blink field.
6685
6686 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6687 Handle slant.
6688
6689 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6690 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6691 tty_alt_charset_p. Add tty_italic_p.
6692
6693 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
6694
6695 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6696 dbus_type_is_basic if available.
6697 (xd_extract_signed, xd_extract_unsigned): Rename from
6698 extract_signed and extract_unsigned, respectively. Adapt callers.
6699
6700 2012-06-09 Chong Yidong <cyd@gnu.org>
6701
6702 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6703
6704 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6705 case (Bug#9752).
6706
6707 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6708
6709 * xdisp.c (vmessage): Treat frame message as multibyte.
6710 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6711 would generate the diagnostic "Making \302\247 buffer-local while
6712 let-bound!".
6713
6714 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6715
6716 * dispnew.c (showing_window_margins_p): Undo last change, which
6717 was done due to an inadvertent commit.
6718 (adjust_frame_glyphs_for_frame_redisplay): Do call
6719 showing_window_margins_p.
6720
6721 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6722
6723 * eval.c (Fmake_var_non_special): New primitive.
6724 (syms_of_eval): Defsubr it.
6725 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6726
6727 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
6728
6729 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6730 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6731
6732 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6733
6734 * alloc.c (allocate_vectorlike): Fix last change.
6735
6736 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6737
6738 Block-based vector allocation of small vectors.
6739 * lisp.h (struct vectorlike_header): New field `nbytes',
6740 adjust comment accordingly.
6741 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6742 to denote vector blocks. Adjust users (live_vector_p,
6743 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6744 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6745 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6746 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6747 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6748 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6749 (roundup_size): New constant.
6750 (struct vector_block): New data type.
6751 (vector_blocks, vector_free_lists, zero_vector): New variables.
6752 (all_vectors): Rename to `large_vectors'.
6753 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6754 (sweep_vectors): New functions.
6755 (allocate_vectorlike): Return `zero_vector' as the only vector of
6756 0 items. Allocate new vector from block if vector size is less than
6757 or equal to VBLOCK_BYTES_MAX.
6758 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6759 (init_alloc_once): Add call to init_vectors.
6760
6761 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6762
6763 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6764
6765 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6766
6767 * doprnt.c (doprnt): Truncate multibyte char correctly.
6768 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6769 would mishandle a string argument "Xc" if X was a multibyte
6770 character of length 2: it would truncate after X's first byte
6771 rather than including all of X.
6772
6773 2012-06-06 Chong Yidong <cyd@gnu.org>
6774
6775 * buffer.c (word_wrap): Doc fix.
6776
6777 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6778
6779 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6780
6781 2012-06-03 Glenn Morris <rgm@gnu.org>
6782
6783 * xdisp.c (tool-bar-style): Doc fix.
6784
6785 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6786
6787 * Makefile.in (PAXCTL): Define.
6788 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6789 binary via PaX flags if the paxctl utility is available.
6790 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6791 Restore PaX flags to their default. (Bug#11398)
6792
6793 2012-06-03 Chong Yidong <cyd@gnu.org>
6794
6795 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6796 buffer (Bug#11226).
6797
6798 2012-06-03 Chong Yidong <cyd@gnu.org>
6799
6800 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6801 (note_mode_line_or_margin_highlight): If there is no help echo,
6802 use mode-line-default-help-echo. Handle the case where the mouse
6803 position is past the end of the mode line string.
6804
6805 * buffer.c (buffer_local_value_1): New function, split from
6806 Fbuffer_local_value; can return Qunbound.
6807 (Fbuffer_local_value): Use it.
6808 (Vmode_line_format): Docstring tweaks.
6809
6810 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6811
6812 * sysdep.c (system_process_attributes): Improve comment.
6813
6814 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6815
6816 * keyboard.c: Export real-this-command to Elisp.
6817 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6818 and DEFVAR it. Update all users.
6819
6820 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6821
6822 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6823
6824 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6825 Convert pctcpu and pctmem to Lisp float properly.
6826 Let the compiler fold better, as 100.0/0x8000 is exact.
6827
6828 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6829
6830 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6831 cons_block.
6832
6833 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6834
6835 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6836
6837 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6838
6839 For a 'struct window', replace some Lisp_Object fields to
6840 bitfields where appropriate, remove unused fields.
6841 * window.h (struct window): Remove unused 'last_mark_x' and
6842 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6843 change it's type from Lisp_Object to bitfield.
6844 Change type of 'force_start', 'optional_new_start',
6845 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6846 fields from Lisp_Object to bitfield. Adjust users accordingly.
6847
6848 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6849
6850 Pacify gcc -Wdouble-precision when using Xaw.
6851 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6852 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6853 Use 'float' consistently, rather than 'float' in most places
6854 and 'double' in a couple of places.
6855
6856 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6857
6858 * xdisp.c (handle_stop): Detect whether we have overlay strings
6859 loaded by testing it->current.overlay_string_index to be
6860 non-negative, instead of checking whether n_overlay_strings is
6861 positive. (Bug#11587)
6862
6863 2012-05-31 Chong Yidong <cyd@gnu.org>
6864
6865 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6866
6867 * doc.c (Fsubstitute_command_keys): Doc fix.
6868
6869 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6870
6871 * search.c (search_buffer): Remove calls to
6872 r_alloc_inhibit_buffer_relocation, as it is now called by
6873 maybe_unify_char, which was the cause of relocation of buffer text
6874 in bug#11519.
6875
6876 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6877
6878 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6879 for the duration of call to load_charset, to avoid problems with
6880 callers of maybe_unify_char that access buffer text through C
6881 pointers.
6882
6883 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6884 decrement the inhibition flag, instead of just setting or
6885 resetting it.
6886
6887 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6888
6889 Remove obsolete '#define static' cruft.
6890 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6891 This #undef was "temporary" in 2000; it is no longer needed
6892 now that '#define static' has gone away.
6893 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6894 (gray_bitmap_bits): Remove; no longer needed.
6895 All uses replaced with definiens.
6896 * xterm.c: Include "bitmaps/gray.xbm".
6897
6898 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6899
6900 Clean up __executable_start, monstartup when --enable-profiling.
6901 The following changes affect the code only when profiling.
6902 * dispnew.c (__executable_start): Rename from safe_bcopy.
6903 Define only on platforms that need it.
6904 * emacs.c: Include <sys/gmon.h> when profiling.
6905 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6906 (__executable_start): Remove decl, since lisp.h does it now.
6907 (safe_bcopy): Remove decl; no longer has that name.
6908 (main): Coalesce #if into single bit of code, for simplicity.
6909 Cast pointers to uintptr_t, since standard libraries want integers
6910 and not pointers.
6911 * lisp.h (__executable_start): New decl.
6912
6913 2012-05-31 Glenn Morris <rgm@gnu.org>
6914
6915 * image.c (Fimagemagick_types): Doc fix.
6916
6917 2012-05-30 Jim Meyering <meyering@redhat.com>
6918
6919 * callproc.c (Fcall_process_region): Include directory component
6920 in mkstemp error message (Bug#11586).
6921
6922 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6923
6924 * alloc.c, lisp.h (make_pure_vector): Now static.
6925
6926 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6927
6928 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6929 Move to byte-run.el.
6930 (Fautoload): Do the hash-doc more carefully.
6931 * data.c (Fdefalias): Purify definition, except for keymaps.
6932 (Qdefun): Move from eval.c.
6933 * lisp.h (Qdefun): Remove.
6934 * lread.c (read1): Tiny simplification.
6935
6936 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6937
6938 Do not create empty overlays with the evaporate property (Bug#9642).
6939 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6940 Bug#9642, but explicitly check that the buffer the overlay would
6941 be moved to is live and rearrange lines to make sure that errors
6942 will not put the overlay in an inconsistent state.
6943 (Fdelete_overlay): Cosmetics.
6944
6945 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6946
6947 * w32term.c (my_bring_window_to_top): New function.
6948 (x_raise_frame): Use handle returned by DeferWindowPos, which
6949 could be different from the original one.
6950 Call my_bring_window_to_top instead of my_set_foreground_window.
6951 (Bug#11513)
6952
6953 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6954 by calling BringWindowToTop.
6955
6956 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6957 (WM_EMACS_END): Increase by one.
6958
6959 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6960
6961 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6962 This avoids undefined behavior that might cause the eassert
6963 to not catch an out-of-range value.
6964
6965 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6966
6967 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6968 Update dependencies.
6969
6970 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6971
6972 * bidi.c (bidi_mirror_char): Fix last change.
6973
6974 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6975
6976 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6977 when referring to sectname field in printf format.
6978
6979 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6980
6981 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6982 Only r_alloc_inhibit_buffer_relocation needed to be added;
6983 the others were already declared.
6984
6985 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6986 before checking whether it's out of range. Put the check inside
6987 eassert. See
6988 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6989
6990 2012-05-27 Ken Brown <kbrown@cornell.edu>
6991
6992 * callproc.c (Fcall_process): Restore a line that was accidentally
6993 commented out in the 2011-02-13 change (bug#11547).
6994
6995 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6996
6997 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6998 defined on ralloc.c.
6999
7000 * buffer.c [REL_ALLOC]: Remove prototypes of
7001 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7002 they are now on lisp.h.
7003
7004 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7005
7006 * search.c (search_buffer): Use it to inhibit relocation of buffer
7007 text while re_search_2 is doing its job, because re_search_2 is
7008 passed C pointers to buffer text. (Bug#11519)
7009
7010 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7011 Update value to 24.
7012
7013 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7014 state after an additional call to move_it_in_display_line_to, keep
7015 the values of it->max_ascent and it->max_descent found for the
7016 entire line.
7017 (pos_visible_p): Revert the comparison against bottom_y to what it
7018 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7019 (Bug#11464)
7020
7021 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7022
7023 Fix coding-related core dumps with gcc -ftrapv.
7024 The code was computing A - B, where A and B are pointers, and B is
7025 random garbage. This can lead to core dumps on platforms that
7026 have special pointer registers, and it also leads to core dumps on
7027 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7028 A - B only when B is initialized properly.
7029 * coding.c (coding_set_source, coding_set_destination): Return void.
7030 (coding_change_source, coding_change_destinations): New functions,
7031 with the old behaviors of coding_set_source and coding_set_destination.
7032 All callers that need an offset changed to use these new functions.
7033
7034 2012-05-26 Glenn Morris <rgm@gnu.org>
7035
7036 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7037
7038 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7039
7040 Extend mouse support on W32 text-mode console.
7041 * xdisp.c (draw_row_with_mouse_face):
7042 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7043
7044 * w32console.c: Include window.h.
7045 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7046 New functions.
7047 (initialize_w32_display): Initialize mouse-highlight data.
7048
7049 * w32inevt.c: Include termchar.h and window.h.
7050 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7051 moves, call note_mouse_highlight. If help_echo changed, call
7052 gen_help_event to produce help-echo message in the echo area.
7053 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7054 highlight info.
7055
7056 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7057
7058 * lread.c (read1): Simplify slightly to avoid an overflow warning
7059 with GCC 4.7.0 on x86-64.
7060
7061 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7062
7063 * bidi.c (bidi_mirror_char): Revert last change: an int is
7064 definitely wide enough here.
7065
7066 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
7067
7068 Fix integer width and related bugs (Bug#9874).
7069 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7070 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7071 (string_bytes, check_sblock, allocate_string_data):
7072 (compact_small_strings, Fmake_bool_vector, make_string)
7073 (make_unibyte_string, make_multibyte_string)
7074 (make_string_from_bytes, make_specified_string)
7075 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7076 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7077 (mark_vectorlike):
7078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7079 (allocate_pseudovector):
7080 Use int, not EMACS_INT, where int is wide enough.
7081 (inhibit_garbage_collection, Fgarbage_collect):
7082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7083 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7084 int might not be wide enough.
7085 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7086 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7087 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7088 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7089 (bidi_level_of_next_char, bidi_move_to_visually_next):
7090 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7091 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7092 (Fkill_buffer, Fset_buffer_major_mode)
7093 (advance_to_char_boundary, Fbuffer_swap_text)
7094 (Fset_buffer_multibyte, overlays_at, overlays_in)
7095 (overlay_touches_p, struct sortvec, record_overlay_string)
7096 (overlay_strings, recenter_overlay_lists)
7097 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7098 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7099 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7100 (Foverlay_recenter, last_overlay_modification_hooks_used)
7101 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7102 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7103 (validate_region): Omit unnecessary test for b <= e,
7104 since that's guaranteed by the previous test.
7105 (adjust_overlays_for_delete): Avoid pos + length overflow.
7106 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7107 (report_overlay_modification):
7108 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7109 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7110 Omit pointer cast, which isn't needed anyway, and doesn't work
7111 after the EMACS_INT -> ptrdiff_t change.
7112 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7113 * buffer.h: Adjust decls to match defn changes elsewhere.
7114 (struct buffer_text, struct buffer):
7115 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7116 Use EMACS_INT, not int, where int might not be wide enough.
7117 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7118 not int, to avoid needless 32-bit limit on 64-bit hosts.
7119 (exec_byte_code): Use tighter memory-full test, one that checks
7120 for alloca overflow. Don't compute the address of the object just
7121 before an array, as that's not portable. Use EMACS_INT, not
7122 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7123 * callint.c (Fcall_interactively):
7124 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7125 * callproc.c (call_process_kill, Fcall_process):
7126 Don't assume pid_t fits into an Emacs fixnum.
7127 (call_process_cleanup, Fcall_process, child_setup):
7128 Don't assume pid_t fits into int.
7129 (call_process_cleanup, Fcall_process, delete_temp_file)
7130 (Fcall_process_region):
7131 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7132 (Fcall_process): Simplify handling of volatile integers.
7133 Use int, not EMACS_INT, where int will do.
7134 * casefiddle.c (casify_object, casify_region, operate_on_word)
7135 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7136 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7137 (casify_object): Avoid integer overflow when overallocating buffer.
7138 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7139 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
7140 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7141 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7142 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7143 integers are now checked earlier. All uses replaced with XINT.
7144 (ccl_driver):
7145 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7146 For CCL_MapSingle, check that content and value are in int range.
7147 (ccl_driver, Fregister_code_conversion_map):
7148 Check that Vcode_version_map_vector is a vector.
7149 (resolve_symbol_ccl_program): Check that vector header is in range.
7150 Always copy the vector, so that we can check its contents reliably
7151 now rather than having to recheck each instruction as it's being
7152 executed. Check that vector words fit in 'int'.
7153 (ccl_get_compiled_code, Fregister_ccl_program)
7154 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7155 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7156 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7157 contents are in range.
7158 (Fccl_execute_on_string): Check that status is in range.
7159 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7160 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7161 Accept and return EMACS_INT, not int, because callers can pass values
7162 out of 'int' range.
7163 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7164 (multibyte_chars_in_text, parse_str_as_multibyte)
7165 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7166 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7167 (string_escape_byte8, Fget_byte):
7168 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7169 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7170 avoid mishandling large integers.
7171 * character.h: Adjust decls to match defn changes elsewhere.
7172 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7173 (Ffind_charset_region):
7174 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7175 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7176 (load_charset_map_from_vector, Fdefine_charset_internal):
7177 Don't assume fixnum fits in int.
7178 (load_charset_map_from_vector, Fmap_charset_chars):
7179 Remove now-unnecessary CHECK_NATNUMs.
7180 (Fdefine_charset_internal): Check ranges here, more carefully.
7181 Don't rely on undefined behavior with signed left shift overflow.
7182 Don't assume unsigned int fits into fixnum, or that fixnum fits
7183 into unsigned int. Don't require max_code to be a valid fixnum;
7184 that's not true for gb10830 4-byte on a 32-bit host. Allow
7185 invalid_code to be a cons, for the same reason. Require code_offset
7186 to be a character. Avoid int overflow if max_char is close
7187 to INT_MAX.
7188 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7189 this is intended anyway and avoids some undefined behavior.
7190 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7191 INDEX_TO_CODE_POINT, as that's what it expects.
7192 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
7193 * charset.h (DECODE_CHAR): Return int, not unsigned;
7194 this is what was intended anyway, and it avoids undefined behavior.
7195 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7196 integer-overflow issues.
7197 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7198 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7199 where the argument is EMACS_INT, and this behavior is not intended.
7200 * chartab.c (Fmake_char_table, Fset_char_table_range)
7201 (uniprop_get_decoder, uniprop_get_encoder):
7202 Don't assume fixnum fits in int.
7203 * cmds.c (move_point): New function, that does the gist of
7204 Fforward_char and Fbackward_char, but does so while checking
7205 for integer overflow more accurately.
7206 (Fforward_char, Fbackward_char): Use it.
7207 (Fforward_line, Fend_of_line, internal_self_insert)
7208 (internal_self_insert):
7209 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7210 Fix a FIXME, by checking for integer overflow when calculating
7211 target_clm and actual_clm.
7212 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
7213 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
7214 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7215 (coding_alloc_by_making_gap, alloc_destination)
7216 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7217 (encode_coding_utf_16, detect_coding_emacs_mule)
7218 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7219 (detect_coding_iso_2022, decode_coding_iso_2022)
7220 (encode_invocation_designation, encode_designation_at_bol)
7221 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7222 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7223 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7224 (encode_coding_ccl, encode_coding_raw_text)
7225 (detect_coding_charset, decode_coding_charset)
7226 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7227 (produce_composition, produce_charset, produce_annotation)
7228 (decode_coding, handle_composition_annotation)
7229 (handle_charset_annotation, consume_chars, decode_coding_gap)
7230 (decode_coding_object, encode_coding_object, detect_coding_system)
7231 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7232 (code_convert_region, code_convert_string)
7233 (Fdefine_coding_system_internal)
7234 (coding_set_source, coding_set_destination):
7235 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7236 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7237 (Fdefine_coding_system_internal):
7238 Don't assume fixnums fit in int.
7239 (decode_coding_gap, decode_coding_object, encode_coding_object)
7240 (Fread_coding_system, Fdetect_coding_region)
7241 (Funencodable_char_position, Fcheck_coding_systems_region)
7242 (get_translation, handle_composition_annotation, consume_chars):
7243 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7244 (consume_chars): Rewrite to not calculate an address outside buffer.
7245 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7246 Don't access memory outside of the args array.
7247 (Fdefine_coding_system_internal): Check for charset-id overflow.
7248 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7249 result of ENCODE_CHAR.
7250 * coding.h: Adjust decls to match defn changes elsewhere.
7251 (struct coding_system):
7252 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7253 * composite.c (get_composition_id, find_composition)
7254 (run_composition_function, update_compositions)
7255 (compose_text, composition_gstring_put_cache)
7256 (composition_gstring_p, composition_gstring_width)
7257 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7258 (composition_compute_stop_pos, composition_reseat_it)
7259 (composition_update_it, struct position_record)
7260 (find_automatic_composition, composition_adjust_point)
7261 (Fcomposition_get_gstring, Ffind_composition_internal):
7262 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7263 (update_compositions):
7264 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7265 * composite.h: Adjust decls to match defn changes elsewhere.
7266 (struct composition):
7267 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7268 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7269 Do not attempt to compute the address of the object just before a
7270 buffer; this is not portable.
7271 (Faref, Faset):
7272 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7273 (Faset): Use int, not EMACS_INT, where int is wide enough.
7274 (Fstring_to_number): Don't assume fixnums fit in int.
7275 (Frem): Don't assume arg is nonnegative.
7276 * dbusbind.c (xd_append_arg): Check for integers out of range.
7277 (Fdbus_call_method): Don't overflow the timeout int.
7278 (extract_signed, extract_unsigned): New functions.
7279 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7280 (xd_get_connection_references): Return ptrdiff_t, not int.
7281 All uses changed.
7282 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7283 (xd_read_message_1):
7284 Use int, not unsigned, where the dbus API uses int.
7285 (Fdbus_message_internal): Don't overflow mtype.
7286 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7287 * dired.c (directory_files_internal, file_name_completion, scmp)
7288 (file_name_completion_stat):
7289 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7290 (file_name_completion): Don't overflow matchcount.
7291 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7292 * dispextern.h: Adjust decls to match defn changes elsewhere.
7293 (struct text_pos, struct glyph, struct bidi_saved_info)
7294 (struct bidi_string_data, struct bidi_it, struct composition_it)
7295 (struct it):
7296 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7297 (struct display_pos, struct composition_it, struct it):
7298 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7299 * dispnew.c (increment_matrix_positions)
7300 (increment_row_positions, mode_line_string)
7301 (marginal_area_string):
7302 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7303 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7305 (duration_to_sec_usec): New function, to check for overflow better.
7306 (Fsleep_for, sit_for): Use it.
7307 * doc.c (get_doc_string, store_function_docstring):
7308 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7309 (get_doc_string, Fsnarf_documentation):
7310 Use int, not EMACS_INT, where int is wide enough.
7311 (get_doc_string):
7312 Use SAFE_ALLOCA, not alloca.
7313 Check for overflow when converting EMACS_INT to off_t.
7314 * doprnt.c (doprnt):
7315 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7316 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7317 Don't assume uid_t fits into fixnum.
7318 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7319 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7320 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7321 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7322 (general_insert_function)
7323 (Finsert_char, make_buffer_string, make_buffer_string_both)
7324 (update_buffer_properties, Fbuffer_substring)
7325 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7326 (Fsubst_char_in_region, check_translation)
7327 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7328 (transpose_markers, Ftranspose_regions):
7329 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7330 (clip_to_bounds): Move to lisp.h as an inline function).
7331 (Fconstrain_to_field): Don't assume integers are nonnegative.
7332 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7333 (Fsubst_char_in_region, Fsave_restriction):
7334 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7335 (Femacs_pid): Don't assume pid_t fits into fixnum.
7336 (lo_time): Use int, not EMACS_INT, when int suffices.
7337 (lisp_time_argument): Check for usec out of range.
7338 (Fencode_time): Don't assume fixnum fits in int.
7339 (Fuser_login_name, Fuser_full_name): Signal an error
7340 if a uid argument is out of range, rather than relying on
7341 undefined behavior.
7342 (Fformat_time_string): Remove now-unnecessary check.
7343 lisp_time_argument checks for out-of-range usec now.
7344 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7345 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7346 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7347 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7348 (init_cmdargs, Fdump_emacs):
7349 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7350 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7351 the bottom (typically) 32 bits of the fixnum.
7352 * eval.c (specpdl_size, call_debugger):
7353 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7354 (when_entered_debugger, Fbacktrace_debug):
7355 Don't assume fixnum can fit in int.
7356 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7357 the object just before a buffer; this is not portable.
7358 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7359 (grow_specpdl, unbind_to):
7360 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7361 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7362 (grow_specpdl): Simplify allocation by using xpalloc.
7363 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7364 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7365 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7366 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7367 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7368 (a_write, e_write):
7369 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7370 (Fcopy_file, non_regular_nbytes, read_non_regular)
7371 (Finsert_file_contents):
7372 Use int, not EMACS_INT, where int is wide enough.
7373 (READ_BUF_SIZE): Verify that it fits in int.
7374 (Finsert_file_contents): Check that counts are in proper range,
7375 rather than assuming fixnums fit into ptrdiff_t etc.
7376 Don't assume fixnums fit into int.
7377 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7378 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7379 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7380 (string_char_to_byte, string_byte_to_char)
7381 (string_make_multibyte, string_to_multibyte)
7382 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7383 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7384 (substring_both, Fdelete, internal_equal, Ffillarray)
7385 (Fclear_string, mapcar1)
7386 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7387 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7388 (larger_vector, make_hash_table, maybe_resize_hash_table)
7389 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7390 (Fmaphash, secure_hash):
7391 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7392 (concat): Check for string index and length overflow.
7393 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7394 (Frequire):
7395 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7396 (larger_vector): New API (vec, incr_min, size_max) replaces old
7397 one (vec, new_size, init). This catches size overflow.
7398 INIT was removed because it was always Qnil.
7399 All callers changed.
7400 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7401 the upper bound on a hash table index size.
7402 (make_hash_table, maybe_resize_hash_table): Use it.
7403 (secure_hash): Computer start_byte and end_byte only after
7404 they're known to be in ptrdiff_t range.
7405 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7406 (Ffont_get_glyphs, Ffont_at):
7407 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7408 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7409 (Flist_fonts, Fopen_font):
7410 Don't assume fixnum can fit in int.
7411 (check_gstring): Don't assume index can fit in int.
7412 (font_match_p): Check that fixnum is a character, not a nonnegative
7413 fixnum, since the later code needs to stuff it into an int.
7414 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7415 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7416 conversion overflow issues.
7417 (Fopen_font): Check for integer out of range.
7418 (Ffont_get_glyphs): Don't assume index can fit in int.
7419 * font.h: Adjust decls to match defn changes elsewhere.
7420 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7421 integer overflow.
7422 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7423 printmax_t, where ptrdiff_t is wide enough.
7424 (Finternal_char_font):
7425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7426 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7427 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7428 (Fset_frame_position, x_set_frame_parameters)
7429 (x_set_line_spacing, x_set_border_width)
7430 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7431 Check that fixnums are in proper range for system types.
7432 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7433 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7434 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7435 Use SAFE_ALLOCA_LISP, not alloca.
7436 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7437 intptr_t is wide enough.
7438 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7439 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7440 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7441 Check for fixnum out of range.
7442 * ftfont.c (ftfont_list): Don't assume index fits in int.
7443 Check that fixnums are in proper range for system types.
7444 (ftfont_shape_by_flt):
7445 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7446 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7448 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7449 Check that fixnums are in proper range for system types.
7450 * gnutls.h: Adjust decls to match defn changes elsewhere.
7451 * gtkutil.c (xg_dialog_run):
7452 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7453 (update_frame_tool_bar):
7454 Check that fixnums are in proper range for system types.
7455 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7456 (lookup_image): Check that fixnums are in range for system types.
7457 * indent.c (last_known_column, last_known_column_point):
7458 (current_column_bol_cache):
7459 (skip_invisible, current_column, check_display_width):
7460 (check_display_width, scan_for_column, current_column_1)
7461 (Findent_to, Fcurrent_indentation, position_indentation)
7462 (indented_beyond_p, Fmove_to_column, compute_motion):
7463 (Fcompute_motion, Fvertical_motion):
7464 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7465 (last_known_column_modified): Use EMACS_INT, not int.
7466 (check_display_width):
7467 (Fcompute_motion):
7468 Check that fixnums and floats are in proper range for system types.
7469 (compute_motion): Don't assume index or fixnum fits in int.
7470 (compute_motion, Fcompute_motion):
7471 Use int, not EMACS_INT, when it is wide enough.
7472 (vmotion): Omit local var start_hpos that is always 0; that way
7473 we don't need to worry about overflow in expressions involving it.
7474 * indent.h: Adjust decls to match defn changes elsewhere.
7475 (struct position):
7476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7477 Use int, not EMACS_INT, where int is wide enough.
7478 Remove unused members ovstring_chars_done and tab_offset;
7479 all uses removed.
7480 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7481 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7482 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7483 (make_gap, copy_text, insert, insert_and_inherit)
7484 (insert_before_markers, insert_before_markers_and_inherit)
7485 (insert_1, count_combining_before, count_combining_after)
7486 (insert_1_both, insert_from_string)
7487 (insert_from_string_before_markers, insert_from_string_1)
7488 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7489 (adjust_after_replace, adjust_after_insert, replace_range)
7490 (replace_range_2, del_range, del_range_1, del_range_byte)
7491 (del_range_both, del_range_2, modify_region)
7492 (prepare_to_modify_buffer, signal_before_change)
7493 (signal_after_change, Fcombine_after_change_execute):
7494 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7495 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7496 (balance_an_interval, split_interval_right, split_interval_left)
7497 (find_interval, next_interval, update_interval)
7498 (adjust_intervals_for_insertion, delete_node, delete_interval)
7499 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7500 (static_offset_intervals, offset_intervals)
7501 (merge_interval_right, merge_interval_left, make_new_interval)
7502 (graft_intervals_into_buffer, temp_set_point_both)
7503 (temp_set_point, set_point, adjust_for_invis_intang)
7504 (set_point_both, move_if_not_intangible, get_property_and_range)
7505 (get_local_map, copy_intervals, copy_intervals_to_string)
7506 (compare_string_intervals, set_intervals_multibyte_1):
7507 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7508 * intervals.h: Adjust decls to match defn changes elsewhere.
7509 (struct interval):
7510 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7511 * keyboard.c (this_command_key_count, this_single_command_key_start)
7512 (before_command_key_count, before_command_echo_length, echo_now)
7513 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7514 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7515 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7516 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7517 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7518 (last_non_minibuf_size, last_point_position, echo_truncate)
7519 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7520 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7521 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7522 (stuff_buffered_input):
7523 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7524 (last_auto_save, command_loop_1, read_char):
7525 Use EMACS_INT, not int, to avoid integer overflow.
7526 (record_char): Avoid overflow in total_keys computation.
7527 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7528 * keyboard.h: Adjust decls to match defn changes elsewhere.
7529 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7530 (Fkey_description, Fdescribe_vector, Flookup_key):
7531 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7532 (click_position): New function, to check that positions are in range.
7533 (Fcurrent_active_maps):
7534 (describe_command):
7535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7536 (Faccessible_keymaps, Fkey_description):
7537 (preferred_sequence_p):
7538 Don't assume fixnum can fit into int.
7539 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7540 Check for integer overflow in size calculations.
7541 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7542 avoid mishandling large integers.
7543 * lisp.h: Adjust decls to match defn changes elsewhere.
7544 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7545 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7546 (struct Lisp_Marker):
7547 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7548 (clip_to_bounds): Now an inline function, moved here from editfns.c.
7549 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7550 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7551 All callers changed.
7552 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7553 Assume the arg has valid form, since it always does.
7554 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7555 unsigned integer system type.
7556 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7557 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7558 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7559 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7560 (duration_to_sec_usec): New decl.
7561 * lread.c (read_from_string_index, read_from_string_index_byte)
7562 (read_from_string_limit, readchar, unreadchar, openp)
7563 (read_internal_start, read1, oblookup):
7564 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7565 (Fload, readevalloop, Feval_buffer, Feval_region):
7566 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7567 (openp): Check for out-of-range argument to 'access'.
7568 (read1): Use int, not EMACS_INT, where int is wide enough.
7569 Don't assume fixnum fits into int.
7570 Fix off-by-one error that can read outside a buffer.
7571 (read_filtered_event): Use duration_to_sec_usec
7572 to do proper overflow checking on durations.
7573 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7574 in size calculation.
7575 (Fexecute_kbd_macro):
7576 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7577 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7578 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7579 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7580 (set_marker_both, set_marker_restricted_both, marker_position)
7581 (marker_byte_position, Fbuffer_has_markers_at):
7582 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7583 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7584 * menu.c (ensure_menu_items): Rename from grow_menu_items.
7585 It now merely ensures that the menu is large enough, without
7586 necessarily growing it, as this avoids some integer overflow issues.
7587 All callers changed.
7588 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7589 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7590 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7591 Use SAFE_ALLOCA_LISP, not alloca.
7592 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7593 to EMACS_INT. Check that fixnums are in proper range for system types.
7594 * minibuf.c (minibuf_prompt_width, string_to_object)
7595 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7596 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7597 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7598 (get_minibuffer, read_minibuf_unwind):
7599 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7600 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7601 this simplifies overflow checking. All callers changed.
7602 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7603 (Ftest_completion):
7604 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7605 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7606 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7607 Check that fixnums are in proper range for system types.
7608 (Fx_create_frame, Fx_show_tip):
7609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7610 * nsfont.m (ns_findfonts, nsfont_list_family):
7611 Don't assume fixnum fits in long.
7612 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7613 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7614 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7615 wide enough.
7616 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7617 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7618 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7619 (PRINTDECLARE, PRINTPREPARE):
7620 (strout, print_string):
7621 (print, print_preprocess, print_check_string_charset_prop)
7622 (print_object):
7623 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7624 (PRINTDECLARE):
7625 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7626 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7627 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7628 (printchar, strout): Use xpalloc to catch size calculation overflow.
7629 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7630 (print_error_message): Use SAFE_ALLOCA, not alloca.
7631 (print_object): Use int, not EMACS_INT, where int is wide enough.
7632 (print_depth, new_backquote_output, print_number_index):
7633 Use ptrdiff_t, not int, where int might not be wide enough.
7634 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7635 (Fset_process_window_size, Fformat_network_address)
7636 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7637 (sigchld_handler):
7638 Check that fixnums are in proper range for system types.
7639 (Fsignal_process): Simplify by avoiding a goto.
7640 Check for process-ids out of pid_t range rather than relying on
7641 undefined behavior.
7642 (process_tick, update_tick): Use EMACS_INT, not int.
7643 (Fformat_network_address, read_process_output, send_process)
7644 (Fprocess_send_region, status_notify):
7645 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7646 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7647 (wait_reading_process_output, read_process_output, exec_sentinel):
7648 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7649 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7650 (Faccept_process_output): Use duration_to_sec_usec to do proper
7651 overflow checking on durations.
7652 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7653 Don't assume pid_t fits in int.
7654 * process.h (struct Lisp_Process): Members tick and update_tick
7655 are now of type EMACS_INT, not int.
7656 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7657 configured --with-wide-int.
7658 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7659 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7660 * search.c (looking_at_1, string_match_1):
7661 (fast_string_match, fast_c_string_match_ignore_case)
7662 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7663 (scan_newline, find_before_next_newline, search_command)
7664 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7665 (set_search_regs, wordify):
7666 (Freplace_match):
7667 (Fmatch_data):
7668 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7669 (string_match_1, search_buffer, set_search_regs):
7670 (Fmatch_data):
7671 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7672 (wordify): Check for overflow in size calculation.
7673 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7674 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7675 Check that fixnums are in proper range for system types.
7676 * sound.c (struct sound_device)
7677 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7678 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7679 (Fplay_sound_internal):
7680 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7681 * syntax.c (struct lisp_parse_state, find_start_modiff)
7682 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7683 (Fparse_partial_sexp):
7684 Don't assume fixnums can fit in int.
7685 (struct lisp_parse_state, find_start_pos, find_start_value)
7686 (find_start_value_byte, find_start_begv)
7687 (update_syntax_table, char_quoted, dec_bytepos)
7688 (find_defun_start, prev_char_comend_first, back_comment):
7689 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7690 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7691 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7692 (Finternal_describe_syntax_value): Check that match_lisp is a
7693 character, not an integer, since the code stuffs it into int.
7694 (scan_words, scan_sexps_forward):
7695 Check that fixnums are in proper range for system types.
7696 (Fforward_word):
7697 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7698 (scan_sexps_forward):
7699 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7700 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7701 * syntax.h: Adjust decls to match defn changes elsewhere.
7702 (struct gl_state_s):
7703 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7704 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7705 MOST_POSITIVE_FIXNUM.
7706 * sysdep.c (wait_for_termination_1, wait_for_termination)
7707 (interruptible_wait_for_termination, mkdir):
7708 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7709 (emacs_read, emacs_write):
7710 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7711 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7712 and double all fit in int.
7713 * term.c (set_tty_color_mode):
7714 Check that fixnums are in proper range for system types.
7715 * termhooks.h (struct input_event):
7716 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7717 * textprop.c (validate_interval_range, interval_of)
7718 (Fadd_text_properties, set_text_properties_1)
7719 (Fremove_text_properties, Fremove_list_of_text_properties)
7720 (Ftext_property_any, Ftext_property_not_all)
7721 (copy_text_properties, text_property_list, extend_property_ranges)
7722 (verify_interval_modification):
7723 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7724 (Fnext_single_char_property_change)
7725 (Fprevious_single_char_property_change):
7726 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7727 (copy_text_properties):
7728 Check for integer overflow in index calculation.
7729 * undo.c (last_boundary_position, record_point, record_insert)
7730 (record_delete, record_marker_adjustment, record_change)
7731 (record_property_change):
7732 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7733 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7734 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7735 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7736 (Fx_hide_tip, Fx_file_dialog):
7737 * w32menu.c (set_frame_menubar):
7738 Use ptrdiff_t, not int, for consistency with rest of code.
7739 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7740 (select_window, Fdelete_other_windows_internal)
7741 (window_scroll_pixel_based, window_scroll_line_based)
7742 (Frecenter, Fset_window_configuration):
7743 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7744 (Fset_window_hscroll, run_window_configuration_change_hook)
7745 (set_window_buffer, temp_output_buffer_show, scroll_command)
7746 (Fscroll_other_window, Frecenter):
7747 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7748 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7749 Don't assume fixnum fits in int.
7750 (Fset_window_scroll_bars):
7751 Check that fixnums are in proper range for system types.
7752 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7753 (string_pos, c_string_pos, number_of_chars, init_iterator)
7754 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7755 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7756 (compute_display_string_end, handle_face_prop)
7757 (face_before_or_after_it_pos, handle_invisible_prop)
7758 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7759 (display_prop_intangible_p, string_buffer_position_lim)
7760 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7761 (get_overlay_strings_1, get_overlay_strings)
7762 (iterate_out_of_display_property, forward_to_next_line_start)
7763 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7764 (get_next_display_element, set_iterator_to_next)
7765 (get_visually_first_element, compute_stop_pos_backwards)
7766 (handle_stop_backwards, next_element_from_buffer)
7767 (move_it_in_display_line_to, move_it_in_display_line)
7768 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7769 (add_to_log, message_dolog, message_log_check_duplicate)
7770 (message2, message2_nolog, message3, message3_nolog
7771 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7772 (current_message_1, truncate_echo_area, truncate_message_1)
7773 (set_message, set_message_1, store_mode_line_noprop)
7774 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7775 (text_outside_line_unchanged_p, check_point_in_composition)
7776 (reconsider_clip_changes)
7777 (redisplay_internal, set_cursor_from_row, try_scrolling)
7778 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7779 (redisplay_window, find_last_unchanged_at_beg_row)
7780 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7781 (trailing_whitespace_p, find_row_edges, display_line)
7782 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7783 (display_mode_element, store_mode_line_string)
7784 (pint2str, pint2hrstr, decode_mode_spec)
7785 (display_count_lines, display_string, draw_glyphs)
7786 (x_produce_glyphs, x_insert_glyphs)
7787 (rows_from_pos_range, mouse_face_from_buffer_pos)
7788 (fast_find_string_pos, mouse_face_from_string_pos)
7789 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7790 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7791 (safe_call, init_from_display_pos, handle_fontified_prop)
7792 (handle_single_display_spec, load_overlay_strings)
7793 (with_echo_area_buffer, setup_echo_area_for_printing)
7794 (display_echo_area, echo_area_display)
7795 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7796 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7797 (redisplay_window, dump_glyph_row, display_mode_line)
7798 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7799 (handle_display_spec, display_prop_string_p):
7800 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7801 (handle_single_display_spec, build_desired_tool_bar_string)
7802 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7803 (get_specified_cursor_type):
7804 Check that fixnums are in proper range for system types.
7805 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7806 (Flookup_image_map):
7807 Don't assume fixnums fit in int.
7808 (compare_overlay_entries):
7809 Avoid mishandling comparisons due to subtraction overflow.
7810 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7811 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7812 (handle_tool_bar_click):
7813 Use int, not unsigned, since we prefer signed and the signedness
7814 doesn't matter here.
7815 (get_next_display_element, next_element_from_display_vector):
7816 Use int, not EMACS_INT, when int is wide enough.
7817 (start_hourglass): Use duration_to_sec_usec to do proper
7818 overflow checking on durations.
7819 * xfaces.c (Fbitmap_spec_p):
7820 Check that fixnums are in proper range for system types.
7821 (compare_fonts_by_sort_order):
7822 Avoid mishandling comparisons due to subtraction overflow.
7823 (Fx_family_fonts, realize_basic_faces):
7824 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7825 (Fx_family_fonts):
7826 Don't assume fixnum fits in int.
7827 Use SAFE_ALLOCA_LISP, not alloca.
7828 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7829 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7830 (face_at_buffer_position, face_for_overlay_string)
7831 (face_at_string_position):
7832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7833 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7834 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7835 (Fx_show_tip):
7836 Check that fixnums are in proper range for system types.
7837 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7838 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7839 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7840 (Fx_change_window_property): Don't assume fixnums fit in int.
7841 * xfont.c (xfont_chars_supported):
7842 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7843 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7844 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7845 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7846 * xml.c (parse_region):
7847 * xrdb.c (magic_file_p):
7848 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7849 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7850 (x_get_local_selection, x_reply_selection_request)
7851 (x_handle_selection_request, wait_for_property_change):
7852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7853 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7854 short is wide enough.
7855 (x_send_client_event): Don't assume fixnum fits in int.
7856 * xterm.c (x_x_to_emacs_modifiers):
7857 Don't assume EMACS_INT overflows nicely into int.
7858 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7859 may come from Lisp.
7860 (handle_one_xevent): NATNUMP can eval its arg twice.
7861 (x_connection_closed):
7862 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7863 * xterm.h: Adjust decls to match defn changes elsewhere.
7864 (struct scroll_bar): Use struct vectorlike_header
7865 rather than rolling our own approximation.
7866 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7867
7868 2012-05-25 Glenn Morris <rgm@gnu.org>
7869
7870 * lisp.mk (lisp): Update for more files being compiled now.
7871
7872 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7873
7874 * lread.c: Remove `read_pure' which makes no difference.
7875 (read_pure): Remove var.
7876 (unreadpure): Remove function.
7877 (readevalloop): Don't call read_list with -1 flag.
7878 (read1, read_vector): Don't test read_pure any more.
7879 (read_list): Simplify.
7880
7881 * fileio.c, character.h: Minor style tweaks.
7882
7883 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7884
7885 * window.h (clip_changed): Remove useless declaration.
7886
7887 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7888
7889 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7890 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7891
7892 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7893
7894 Remove src/m/*.
7895 This directory predates autoconf and is no longer needed nowadays.
7896 Move its few remaining bits of functionality to where they're needed.
7897 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7898 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7899 * m/template.h: Remove.
7900 * Makefile.in (M_FILE): Remove. All uses removed.
7901 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7902 * lisp.h (USE_LSB_TAG):
7903 * mem-limits.h (EXCEEDS_LISP_PTR):
7904 Use VAL_MAX, not VALBITS, in #if.
7905 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7906 (EMACS_UINT): Define unconditionally now.
7907 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7908 (BITS_PER_EMACS_INT): New constants, replacing
7909 what used to be in config.h, but not useful in #if.
7910 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7911 define them any more.
7912 (VAL_MAX): New macro.
7913 (VALMASK): Use it.
7914 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7915 BITS_PER_EMACS_INT, in #if.
7916 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7917 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7918 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7919 * s/ms-w32.h (DATA_START):
7920 Move here from removed file m/intel386.h.
7921 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7922 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7923
7924 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7925
7926 Assume C89 or later.
7927 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7928 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7929 (xrealloc):
7930 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7931 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7932 * textprop.c, tparam.c (NULL): Remove.
7933 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7934 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7935 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7936 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7937 * xterm.c (input_signal_count): Assume volatile works.
7938
7939 2012-05-21 Ken Brown <kbrown@cornell.edu>
7940
7941 * xgselect.c (xg_select): Fix first argument in call to 'select'
7942 (bug#11508).
7943
7944 2012-05-20 Ken Brown <kbrown@cornell.edu>
7945
7946 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7947 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7948
7949 2012-05-19 Ken Brown <kbrown@cornell.edu>
7950
7951 * xfns.c (x_in_use): Remove `static' qualifier.
7952 * xterm.h (x_in_use): Declare.
7953 * xgselect.c: Include xterm.h.
7954 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7955 and `display_arg' (bug#9754).
7956
7957 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7958
7959 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7960
7961 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7962 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7963
7964 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7965
7966 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7967
7968 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7969 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7970
7971 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7972 reference to image_cache->refcount.
7973 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7974
7975 2012-05-17 Juri Linkov <juri@jurta.org>
7976
7977 * search.c (Fword_search_regexp, Fword_search_backward)
7978 (Fword_search_forward, Fword_search_backward_lax)
7979 (Fword_search_forward_lax): Move functions to isearch.el
7980 (bug#10145, bug#11381).
7981
7982 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7983
7984 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7985
7986 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7987
7988 * lread.c (init_obarray): Declare Qt and Qnil as special.
7989
7990 2012-05-14 Glenn Morris <rgm@gnu.org>
7991
7992 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7993 Put "libexec" before "bin", for the sake of init_callproc_1.
7994
7995 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7996
7997 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7998
7999 * unexaix.c: Port to more-recent AIX compilers.
8000 (report_error, report_error_1, make_hdr, copy_sym)
8001 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8002 Make arguments const char *, not char *, to avoid violations of C
8003 standard and to fix some AIX warnings reported by Gilles Pion.
8004
8005 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8006
8007 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8008 already have overlays loaded.
8009 (handle_single_display_spec): Before returning without displaying
8010 fringe bitmap, synchronize the bidi iterator with the main display
8011 iterator, by calling iterate_out_of_display_property.
8012 (iterate_out_of_display_property): Detect buffer iteration by
8013 testing that it->string is a Lisp string.
8014 (get_next_display_element): When the current object is exhausted,
8015 and there's something on it->stack, call set_iterator_to_next to
8016 proceed with what's on the stack, instead of returning zero.
8017 (set_iterator_to_next): If called at the end of a Lisp string,
8018 proceed to consider_string_end without incrementing string
8019 position. Don't increment display vector index past the end of
8020 the display vector. (Bug#11417)
8021 (pos_visible_p): Don't report a position visible when move_it_to
8022 stopped at the last line of window, which happens to be scanned
8023 backwards by the bidi iteration. (Bug#11464)
8024
8025 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8026
8027 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8028 and right-margin display specs even if the spec is invalid or we
8029 are on a TTY, and thus unable to display on the fringes.
8030 That's because the text with the property will not be displayed anyway,
8031 so we need to signal to the caller that this is a "replacing"
8032 display spec. This fixes display when the spec is invalid or we
8033 are on a TTY.
8034
8035 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8036
8037 * unexaix.c (make_hdr): Fix typo in prototype.
8038 This bug broke the build on AIX. Problem reported by Gilles Pion.
8039
8040 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
8041
8042 * keyboard.c (kbd_buffer_get_event): Read special events also in
8043 batch mode. (Bug#11415)
8044
8045 2012-05-12 Glenn Morris <rgm@gnu.org>
8046
8047 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8048
8049 2012-05-12 Eli Zaretskii <eliz@gnu.org>
8050
8051 * lisp.mk (lisp): Add newcomment.elc.
8052
8053 2012-05-12 Glenn Morris <rgm@gnu.org>
8054
8055 * Makefile.in (MKDIR_P): New, set by configure.
8056 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8057
8058 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8059
8060 Remove unused function hourglass_started.
8061 * dispextern.h (hourglass_started):
8062 * w32fns.c (hourglass_started):
8063 * xdisp.c (hourglass_started): Remove.
8064
8065 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
8066
8067 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8068 Update dependencies.
8069
8070 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8071
8072 * xgselect.c (xg_select): Put maxfds+1 into a var.
8073 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8074
8075 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8076
8077 2012-05-10 Dave Abrahams <dave@boostpro.com>
8078
8079 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8080 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8081
8082 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
8083
8084 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8085 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8086 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8087 Initialize xd_registered_buses.
8088
8089 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8090
8091 Untag more efficiently if USE_LSB_TAG.
8092 This is based on a proposal by YAMAMOTO Mitsuharu in
8093 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8094 For an admittedly artificial (nth 8000 longlist) benchmark on
8095 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8096 Emacs's overall text size by 1%.
8097 * lisp.h (XUNTAG): New macro.
8098 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8099 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8100 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8101 * eval.c (Fautoload):
8102 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8103 * frame.h (XFRAME): Use XUNTAG.
8104
8105 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8106 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8107 Remove unportable assumptions about print widths of types like
8108 dbus_uint32_t.
8109 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8110 intptr_t when converting between pointer and integer, to avoid GCC
8111 warnings about wrong width.
8112
8113 2012-05-09 Eli Zaretskii <eliz@gnu.org>
8114
8115 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8116 stack for each reader_thread, instead of defaulting to 8MB
8117 determined by the linker. This avoids failures in creating
8118 subprocesses on Windows 7, see the discussion in this thread:
8119 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8120
8121 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8122
8123 Fix up display of the *Minibuf-0* buffer in the mini window.
8124 * keyboard.c (read_char): Don't clear the echo area if there's no
8125 message to clear.
8126 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8127 contents of *Minibuf-0*) if there's no message displayed in its stead.
8128
8129 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
8130
8131 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8132 batch mode.
8133
8134 2012-05-06 Chong Yidong <cyd@gnu.org>
8135
8136 * lisp.mk (lisp): Update.
8137
8138 2012-05-05 Jim Meyering <meyering@redhat.com>
8139
8140 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8141
8142 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8143
8144 * data.c (PUT_ERROR): New macro.
8145 (syms_of_data): Use it. Add new error type `user-error'.
8146 * undo.c (user_error): New function.
8147 (Fprimitive_undo): Use it.
8148 * print.c (print_error_message): Adjust print style for `user-error'.
8149 * keyboard.c (user_error): New function.
8150 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8151
8152 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8153
8154 Do not limit current-time-string to years 1000..9999.
8155 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8156 (Fcurrent_time_string): Support any year that is supported by the
8157 underlying localtime representation. Don't use asctime, as it
8158 has undefined behavior for years outside the range -999..9999.
8159
8160 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8161
8162 Fix race conditions involving setenv, gmtime, localtime, asctime.
8163 Without this fix, interrupts could mess up code that uses these
8164 nonreentrant functions, since setting TZ invalidates existing
8165 tm_zone or tzname values, and since most of these functions return
8166 pointers to static storage.
8167 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8168 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8169 Grow the critical sections to include not just invoking
8170 localtime/gmtime, but also accessing these functions' results
8171 including their tm_zone values if any, and any related TZ setting.
8172 (format_time_string): Last arg is now struct tm *, not struct tm **,
8173 so that the struct tm is saved in the critical section.
8174 All callers changed. Simplify allocation of initial buffer, partly
8175 motivated by the fact that memory allocation needs to be outside
8176 the critical section.
8177
8178 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8179
8180 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8181 with RESET_INTERVAL.
8182
8183 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8184 Remove duplicated buffer name initialization.
8185
8186 2012-05-02 Jim Meyering <jim@meyering.net>
8187
8188 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8189
8190 * xfns.c (x_window): Use xstrdup (Bug#11375).
8191
8192 2012-05-02 Eli Zaretskii <eliz@gnu.org>
8193
8194 * xdisp.c (pos_visible_p): If already at a newline from the
8195 display string before the 'while' loop, don't walk back the glyphs
8196 from it3.glyph_row. Solves assertion violation when the display
8197 string begins with a newline (egg.el). (Bug#11367)
8198
8199 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8200
8201 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8202 Move to simple.el.
8203
8204 2012-05-01 Glenn Morris <rgm@gnu.org>
8205
8206 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8207 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8208 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8209 All were removed before 23.1.
8210
8211 * dispnew.c: Remove HAVE_LIBNCURSES test;
8212 it is always true on relevant platforms.
8213
8214 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8215 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8216
8217 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8218
8219 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8220
8221 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8222 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8223 Remove.
8224
8225 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8226
8227 Do not avoid creating empty evaporating overlays (Bug#9642).
8228 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8229 That is, do not delete an evaporating overlay if it becomes
8230 empty after its bounds are adjusted to fit within its buffer.
8231 This fix caused other problems, and I'm reverting it until we get
8232 to the bottom of them.
8233
8234 2012-04-27 Chong Yidong <cyd@gnu.org>
8235
8236 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8237
8238 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8239
8240 * xdisp.c (pos_visible_p): If the window start position is beyond
8241 ZV, start the display from buffer beginning. Prevents assertion
8242 violation in init_iterator when the minibuffer window is scrolled
8243 via the scroll bar.
8244
8245 * window.c (window_scroll_pixel_based): Likewise.
8246
8247 2012-04-27 Chong Yidong <cyd@gnu.org>
8248
8249 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8250
8251 2012-04-27 Glenn Morris <rgm@gnu.org>
8252
8253 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8254 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8255
8256 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8257
8258 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8259 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
8260
8261 2012-04-26 Eli Zaretskii <eliz@gnu.org>
8262
8263 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8264 display element, check also the underlying string or buffer
8265 character. (Bug#11341)
8266
8267 * w32menu.c: Include w32heap.h.
8268 (add_menu_item): If the call to AppendMenuW (via
8269 unicode_append_menu) fails, disable Unicode menus only if we are
8270 running on Windows 9X/Me.
8271
8272 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8273
8274 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8275 (xgetint): Add missing shift for LSB tags.
8276
8277 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8278
8279 * keyboard.c (read_char): Don't wipe echo area for select window
8280 events: These might get delayed via `mouse-autoselect-window'
8281 (Bug#11304).
8282
8283 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8284
8285 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8286 manipulation of :loaded-from data.
8287
8288 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8289
8290 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8291 now a cons (bug#11311).
8292
8293 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8294
8295 Do not create empty overlays with the evaporate property (Bug#9642).
8296 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8297 if it becomes empty after its bounds are adjusted to fit within
8298 its buffer. Without this fix, in a nonempty buffer (let ((o
8299 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8300 yields an empty overlay that has the evaporate property, which is
8301 not supposed to happen.
8302
8303 Fix minor GTK3 problems found by static checking.
8304 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8305 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8306 (struct _EmacsFixedClass, emacs_fixed_get_type):
8307 Move decls here from emacsgtkfixed.h, since they needn't be public.
8308 (emacs_fixed_get_type): Now static.
8309 (emacs_fixed_class_init): Omit unused local.
8310 (emacs_fixed_child_type): Remove; unused.
8311 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8312 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8313 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8314 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8315 (EMACS_FIXED_GET_CLASS): Remove; unused.
8316 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8317
8318 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8319 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8320
8321 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8322
8323 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8324 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8325 (__malloc_size_t, __malloc_ptrdiff_t):
8326 Remove. All uses removed, replaced by the definiens if needed,
8327 since we can assume C89 or better now.
8328 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8329 (protect_malloc_state, align, get_contiguous_space)
8330 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8331 (malloc_atfork_handler_child, malloc_enable_thread)
8332 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8333 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8334 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8335 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8336 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8337 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8338 Define using prototypes, not old style.
8339 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8340 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8341 (align): Don't assume that signed integer overflow wraps around.
8342 Omit unused local var.
8343 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8344 (_free_internal_nolock, memalign, mallochook, reallochook):
8345 Omit no-longer-needed casts.
8346 (valloc): Use getpagesize, not __getpagesize.
8347 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8348 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8349
8350 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8351
8352 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
8353
8354 Move functions from C to Lisp. Make non-blocking method calls
8355 the default. Implement further D-Bus standard interfaces.
8356
8357 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8358 (QCdbus_request_name_allow_replacement)
8359 (QCdbus_request_name_replace_existing)
8360 (QCdbus_request_name_do_not_queue)
8361 (QCdbus_request_name_reply_primary_owner)
8362 (QCdbus_request_name_reply_in_queue)
8363 (QCdbus_request_name_reply_exists)
8364 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8365 (QCdbus_registered_serial, QCdbus_registered_method)
8366 (QCdbus_registered_signal): New Lisp objects.
8367 (XD_DEBUG_MESSAGE): Use sizeof.
8368 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8369 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8370 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8371 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8372 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8373 (xd_signature, xd_append_arg): Allow float for integer types.
8374 (xd_get_connection_references): New function.
8375 (xd_get_connection_address): Rename from xd_initialize.
8376 Return cached address.
8377 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8378 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8379 level.
8380 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8381 Return number of refcounts.
8382 (Fdbus_get_unique_name): Make stronger parameter check.
8383 (Fdbus_message_internal): New defun.
8384 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8385 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8386 (Fdbus_send_signal, Fdbus_register_service)
8387 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8388 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8389 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8390 (Vdbus_compiled_version, Vdbus_runtime_version)
8391 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8392 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8393 (Vdbus_message_type_signal): New defvars.
8394 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8395 Adapt docstring.
8396
8397 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8398
8399 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8400 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8401 Do not assume ptrdiff_t is the same width as 'int'.
8402
8403 * alloc.c: Handle unusual debugging option combinations.
8404 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8405 since the two debugging options are incompatible.
8406 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8407 is defined.
8408 (mem_init, mem_insert, mem_insert_fixup):
8409 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8410 (NEED_MEM_INSERT): Remove; no longer needed.
8411
8412 2012-04-22 Leo Liu <sdl.web@gmail.com>
8413
8414 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8415
8416 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8417
8418 * sysdep.c [__FreeBSD__]: Minor cleanups.
8419 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8420 Use Emacs indenting style more consistently. Avoid some casts.
8421 Use 'double' consistently rather than mixing 'float' and 'double'.
8422
8423 2012-04-21 Eduard Wiebe <usenet@pusto.de>
8424
8425 * sysdep.c (list_system_processes, system_process_attributes):
8426 Add implementation for FreeBSD (Bug#5243).
8427
8428 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8429
8430 * lisp.mk (lisp): Update.
8431
8432 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8433
8434 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8435 It is never used otherwise.
8436
8437 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8438
8439 * print.c (print_preprocess): Only check print_depth if print-circle
8440 is nil.
8441 (print_object): Check for cycles even when print-circle is nil and
8442 print-gensym is t, but only check print_depth if print-circle is nil.
8443
8444 2012-04-20 Chong Yidong <cyd@gnu.org>
8445
8446 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8447 set the status to "failed" and ensure that sentinel is run.
8448
8449 2012-04-20 Glenn Morris <rgm@gnu.org>
8450
8451 * process.c (Fset_process_inherit_coding_system_flag)
8452 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8453 (Fmake_network_process, Fmake_serial_process): Doc fix.
8454
8455 2012-04-20 Eli Zaretskii <eliz@gnu.org>
8456
8457 * xdisp.c (string_buffer_position_lim): Limit starting position to
8458 BEGV.
8459 (set_cursor_from_row): If called for a mode-line or header-line
8460 row, return zero immediately.
8461 (try_cursor_movement): If inside continuation line, don't back up
8462 farther than the first row after the header line, if any.
8463 Don't consider the header-line row as "partially visible", even if
8464 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8465
8466 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8467
8468 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8469 (bug#11238).
8470
8471 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
8472 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
8473
8474 configure: new option --enable-gcc-warnings (Bug#11207)
8475 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8476 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8477 (ALL_CFLAGS): Use new macros rather than old.
8478 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8479 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8480 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8481 -Wunused-result, -Wunused-variable. This should go away once
8482 the Emacs and Gnulib regex code is merged.
8483 (xmalloc, xrealloc): Now static.
8484
8485 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8486
8487 * dired.c (Fsystem_groups): Remove unused local.
8488
8489 2012-04-17 Glenn Morris <rgm@gnu.org>
8490
8491 * dired.c (Fsystem_users): Doc fix.
8492
8493 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8494
8495 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8496 (syms_of_dired): Add them.
8497
8498 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8499
8500 Fix minor alloc.c problems found by static checking.
8501 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8502 New extern decls, to avoid calling undeclared functions.
8503 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8504 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8505 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8506 (NEED_MEM_INSERT): New macro.
8507 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8508 Remove one incorrect comment and fix another.
8509
8510 Fix minor ralloc.c problems found by static checking.
8511 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8512 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8513 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8514 (r_alloc_sbrk): Now static.
8515
8516 Improve ralloc.c interface checking.
8517 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8518 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8519 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8520 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8521 [REL_ALLOC]: ... to here, to check interface.
8522 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8523 Remove decls. This fixes an "It stinks!".
8524
8525 * alloc.c (which_symbols): Fix alignment issue / type clash.
8526
8527 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8528
8529 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8530 (struct Lisp_Misc_Any): Likewise.
8531 (struct Lisp_Free): Likewise.
8532 * alloc.c (union aligned_Lisp_Symbol): Define.
8533 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8534 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8535 (union aligned_Lisp_Misc): Define.
8536 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8537 aligned_Lisp_Misc instead of union Lisp_Misc.
8538 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8539
8540 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8541
8542 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8543 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8544 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8545 * s/netbsd.h, s/sol2-6.h:
8546 Remove definition of GC_MARK_STACK, since the default now works.
8547 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8548 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8549 no longer the default.
8550 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8551
8552 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8553
8554 * lread.c (lisp_file_lexically_bound_p):
8555 Fix hang at ";-*-\n" (bug#11238).
8556
8557 2012-04-14 Eli Zaretskii <eliz@gnu.org>
8558
8559 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8560 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8561
8562 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8563
8564 * nsterm.m (constrainFrameRect): Always constrain when there is only
8565 one screen (Bug#10962).
8566
8567 2012-04-13 Ken Brown <kbrown@cornell.edu>
8568
8569 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8570
8571 2012-04-13 Reuben Thomas <rrt@sc3d.org>
8572
8573 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8574
8575 2012-04-11 Daniel Colascione <dancol@dancol.org>
8576
8577 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8578 against is gone. It's better to use vfork now so that when Cygwin
8579 gains a new, working vfork, we use it automatically (bug#10398).
8580
8581 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8582
8583 * window.c (save_window_save): Obey window-point-insertion-type.
8584
8585 2012-04-11 Glenn Morris <rgm@gnu.org>
8586
8587 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8588
8589 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8590
8591 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8592
8593 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
8594
8595 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8596 (force_quit_count): New var.
8597 (handle_interrupt): Use it.
8598
8599 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
8600
8601 * w32.c (w32_delayed_load): Record the full path of the library
8602 being loaded (bug#10424).
8603
8604 2012-04-09 Glenn Morris <rgm@gnu.org>
8605
8606 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8607 not just in the obarray, before snarfing them. (Bug#11036)
8608
8609 * Makefile.in ($(leimdir)/leim-list.el):
8610 Pass EMACS rather than BUILT_EMACS.
8611
8612 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8613
8614 * process.c (make_process):
8615 * process.h: Add integer `gnutls_handshakes_tried' member to
8616 process struct.
8617
8618 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8619 Add convenience `GNUTLS_LOG2i' macro.
8620
8621 * gnutls.c (gnutls_log_function2i): Convenience log function.
8622 (emacs_gnutls_read): Use new log functions,
8623 `gnutls_handshakes_tried' process member, and
8624 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8625 attempts per process (connection).
8626
8627 2012-04-09 Chong Yidong <cyd@gnu.org>
8628
8629 * eval.c (Fuser_variable_p, user_variable_p_eh)
8630 (lisp_indirect_variable): Functions deleted.
8631 (Fdefvar): Caller changed.
8632
8633 * callint.c (Finteractive, Fcall_interactively):
8634 * minibuf.c (Fread_variable): Callers changed.
8635
8636 2012-04-09 Eli Zaretskii <eliz@gnu.org>
8637
8638 * xdisp.c (set_cursor_from_row): If the display string appears in
8639 the buffer at position that is closer to point than the position
8640 after the display string, display the cursor on the first glyph of
8641 the display string. Fixes cursor display when a 'display' text
8642 property immediately follows invisible text. (Bug#11094)
8643
8644 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8645
8646 composite.c: use 'double' consistently
8647 * composite.c (get_composition_id): Use 'double' consistently
8648 instead of converting 'float' to 'double' and vice versa; this is
8649 easier to understand and avoids a GCC warning.
8650
8651 2012-04-09 Glenn Morris <rgm@gnu.org>
8652
8653 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8654 preparation for dumping it with emacs. (Bug#4789)
8655 (leimdir): New variable.
8656 ($(leimdir)/leim-list.el): New rule.
8657 (emacs$(EXEEXT)): Depend on leim-list.el.
8658
8659 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8660 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8661 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8662
8663 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8664
8665 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8666 proper alignment.
8667
8668 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
8669
8670 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8671 Remove unused local variable.
8672
8673 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8674
8675 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8676 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8677 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8678 objects, as mark_maybe_pointer will catch them otherwise.
8679 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8680 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8681
8682 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8683
8684 Fix typo that broke non-Windows builds.
8685 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8686
8687 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8688
8689 Support building on MS-Windows with libxml2.
8690
8691 * makefile.w32-in (OBJ2): Add xml.$(O).
8692 (GLOBAL_SOURCES): Add xml.c.
8693 ($(BLD)/xml.$(O)): New dependency list.
8694
8695 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8696 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8697 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8698 [!WINDOWSNT]: New macros.
8699 (init_libxml2_functions, libxml2_loaded_p): New functions.
8700 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8701 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8702 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8703 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8704 linked in).
8705 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8706 Call init_libxml2_functions before calling libxml2 functions.
8707 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8708
8709 * emacs.c: Don't include libxml/parser.h.
8710 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8711 xmlCleanupParser directly.
8712
8713 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8714
8715 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8716
8717 * indent.c (Fvertical_motion): If there is a display string at
8718 point, use it.vpos to compute how many lines to backtrack after
8719 move_it_to point. (Bug#11133)
8720
8721 2012-04-06 Eli Zaretskii <eliz@gnu.org>
8722
8723 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8724 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8725 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8726 macros related to unification of CJK characters. For the details,
8727 see the discussion following the message here:
8728 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8729
8730 2012-04-04 Chong Yidong <cyd@gnu.org>
8731
8732 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8733
8734 2012-04-01 Eli Zaretskii <eliz@gnu.org>
8735
8736 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8737 instead of alloca. (Bug#11138)
8738
8739 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8740
8741 * w32menu.c (is_simple_dialog): Properly check lisp types.
8742 (Bug#11141)
8743
8744 2012-03-31 Eli Zaretskii <eliz@gnu.org>
8745
8746 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8747 position we get to after a call to move_it_to fails the
8748 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8749 only if we wind up in a string from display property. (Bug#11063)
8750
8751 * window.c (Fdelete_other_windows_internal): Invalidate the row
8752 and column information about mouse highlight, so that redisplay
8753 restores it after reallocating the glyph matrices. (Bug#7464)
8754
8755 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8756 string comes from a `display' text property, use the buffer
8757 position of that property as if we actually saw that position in
8758 the row's glyphs.
8759 (move_it_by_lines): Remove the assertion that
8760 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8761 violated when there's a before-string at the beginning of a line.
8762 (Bug#11063)
8763
8764 2012-03-30 Eli Zaretskii <eliz@gnu.org>
8765
8766 * xdisp.c (append_space_for_newline): If the default face was
8767 remapped, use the remapped face for the appended newline.
8768 (extend_face_to_end_of_line): Use the remapped default face for
8769 extending the face to the end of the line.
8770 (display_line): Call extend_face_to_end_of_line when the default
8771 face was remapped. (Bug#11068)
8772
8773 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8774
8775 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8776
8777 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8778
8779 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8780
8781 2012-03-27 Glenn Morris <rgm@gnu.org>
8782
8783 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8784 Doc fixes.
8785
8786 2012-03-26 Kenichi Handa <handa@m17n.org>
8787
8788 * dispextern.h (struct glyph): Fix previous change. Change the
8789 bit length of glyphless.ch to 25 (Bug#11082).
8790
8791 2012-03-26 Chong Yidong <cyd@gnu.org>
8792
8793 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8794 (command_loop_1): Use it; inhibit selection update for
8795 handle-select-window too (Bug#8996).
8796
8797 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8798
8799 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8800
8801 2012-03-25 Kenichi Handa <handa@m17n.org>
8802
8803 * dispextern.h (struct glyph): Change the bit length of
8804 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8805
8806 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8807
8808 * s/ms-w32.h (tzname): Include time.h before redirecting to
8809 _tzname. Fixes the MSVC build. (Bug#9960)
8810
8811 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8812
8813 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8814 characters.
8815
8816 * xterm.c (XTread_socket): Only modify handling_signal if
8817 !SYNC_INPUT. (Bug#11080)
8818
8819 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8820
8821 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8822 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8823 when fetching a multibyte character consumes more bytes than
8824 CHAR_BYTES returns, due to unification of CJK characters in
8825 string_char. (Bug#11073)
8826
8827 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8828
8829 * process.c (wait_reading_process_output): Handle pty disconnect
8830 by refraining from sending oneself a SIGCHLD (bug#10933).
8831
8832 2012-03-22 Chong Yidong <cyd@gnu.org>
8833
8834 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8835
8836 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8837 Mark string as coming from a prefix property.
8838 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8839 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8840
8841 2012-03-21 Chong Yidong <cyd@gnu.org>
8842
8843 * xfaces.c (Vface_remapping_alist): Doc fix.
8844
8845 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8846
8847 * w32proc.c (Fw32_set_console_codepage)
8848 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8849 Doc fixes.
8850
8851 2012-03-20 Chong Yidong <cyd@gnu.org>
8852
8853 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8854 to reflect default non-nil value of redisplay-dont-pause.
8855
8856 2012-03-19 Kenichi Handa <handa@m17n.org>
8857
8858 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8859 it fit in a valid range (Bug#11003).
8860
8861 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8862
8863 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8864 that is not from display property, accept the row as a "cursor
8865 row" if one of the string's character has a non-nil `cursor'
8866 property. Fixes cursor positioning when there are newlines in
8867 overlay strings, e.g. in icomplete.el. (Bug#11035)
8868
8869 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8870
8871 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8872
8873 2012-03-12 Chong Yidong <cyd@gnu.org>
8874
8875 * eval.c (inhibit_lisp_code): Rename from
8876 inhibit_window_configuration_change_hook; move from window.c.
8877
8878 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8879 * window.c (run_window_configuration_change_hook)
8880 (syms_of_window): Callers changed.
8881
8882 2012-03-11 Chong Yidong <cyd@gnu.org>
8883
8884 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8885
8886 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8887
8888 2012-03-10 Chong Yidong <cyd@gnu.org>
8889
8890 * frame.c (other_visible_frames): Don't assume the selected frame
8891 is visible (Bug#10955).
8892
8893 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8894
8895 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8896
8897 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8898
8899 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8900 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8901 zero (Bug#10954).
8902
8903 2012-03-03 Glenn Morris <rgm@gnu.org>
8904
8905 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8906
8907 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8908
8909 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8910 position past the first glyph_row that ends at ZV. (Bug#10902)
8911 (redisplay_window, next_element_from_string): Fix typos in
8912 comments.
8913 (redisplay_window): Pass to move_it_vertically the margin in
8914 pixels, not in screen lines.
8915
8916 2012-03-02 Glenn Morris <rgm@gnu.org>
8917
8918 * buffer.c (buffer-list-update-hook): Doc fix.
8919
8920 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8921
8922 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8923 push_it before setting up the iterator for the first overlay
8924 string, even if we have an empty string loaded.
8925 (next_overlay_string): If there's an empty string on the iterator
8926 stack, pop the stack. (Bug#10903)
8927
8928 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8929
8930 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8931 Suggested by Stefan Monnier in
8932 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8933 * alloc.c (widen_to_Lisp_Object): New static function.
8934 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8935 and widening them to Lisp_Objects. This would work even if
8936 USE_LSB_TAG is defined and wide integers are used, which might
8937 happen in a future version of Emacs.
8938
8939 2012-02-25 Chong Yidong <cyd@gnu.org>
8940
8941 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8942 Doc fix.
8943
8944 * xselect.c (Fx_selection_exists_p): Doc fix.
8945 (x_clipboard_manager_save_all): Print an informative message
8946 before saving to clipboard manager.
8947
8948 2012-02-24 Chong Yidong <cyd@gnu.org>
8949
8950 * keyboard.c (process_special_events): Handle all X selection
8951 requests in kbd_buffer, not just the next one (Bug#8869).
8952
8953 2012-02-23 Chong Yidong <cyd@gnu.org>
8954
8955 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8956 call when setting menu-bar-lines and tool-bar-lines parameters.
8957 (unwind_create_frame_1): New helper function.
8958
8959 * window.c (inhibit_window_configuration_change_hook): New var.
8960 (run_window_configuration_change_hook): Obey it.
8961 (syms_of_window): Initialize it.
8962
8963 2012-02-22 Chong Yidong <cyd@gnu.org>
8964
8965 * xterm.c (x_draw_image_relief): Add missing type check for
8966 Vtool_bar_button_margin (Bug#10743).
8967
8968 2012-02-21 Chong Yidong <cyd@gnu.org>
8969
8970 * fileio.c (Vfile_name_handler_alist): Doc fix.
8971
8972 * buffer.c (Fget_file_buffer): Protect against invalid file
8973 handler return value.
8974
8975 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8976
8977 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8978 when computing $valmask.
8979
8980 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8981 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8982 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8983 It's useless in that case, and it can cause problems on hosts
8984 that allocate halves of EMACS_INT values separately.
8985 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8986 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8987 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8988 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8989 it avoids undefined behavior on hosts where shifting right by more
8990 than the word width has undefined behavior.
8991
8992 2012-02-19 Chong Yidong <cyd@gnu.org>
8993
8994 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8995 (Funhandled_file_name_directory, Ffile_name_as_directory)
8996 (Fdirectory_file_name, Fexpand_file_name)
8997 (Fsubstitute_in_file_name): Protect against invalid file handler
8998 return values (Bug#10845).
8999
9000 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9001
9002 * .gdbinit (pitx): Fix incorrect references to fields of the
9003 iterator stack.
9004
9005 2012-02-17 Chong Yidong <cyd@gnu.org>
9006
9007 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9008
9009 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9010
9011 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9012 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9013
9014 2012-02-15 Chong Yidong <cyd@gnu.org>
9015
9016 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9017 marked as special. Also, starting docstrings with * is obsolete.
9018
9019 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9020
9021 * gnutls.c (emacs_gnutls_write): Fix last change.
9022
9023 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9024
9025 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9026 send_process.
9027
9028 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9029
9030 * keymap.c (Fsingle_key_description): Handle char ranges.
9031
9032 2012-02-12 Chong Yidong <cyd@gnu.org>
9033
9034 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9035 as that creates a dangerous corner case.
9036
9037 * window.c (Fdelete_window_internal): Invalidate the mouse
9038 highlight (Bug#9904).
9039
9040 2012-02-12 Glenn Morris <rgm@gnu.org>
9041
9042 * xselect.c (Fx_own_selection_internal)
9043 (Fx_get_selection_internal, Fx_disown_selection_internal)
9044 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9045 * nsselect.m (Fx_own_selection_internal)
9046 (Fx_disown_selection_internal, Fx_selection_exists_p)
9047 (Fx_selection_owner_p, Fx_get_selection_internal):
9048 Sync docs and argument specs with the xselect.c versions.
9049
9050 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9051
9052 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9053
9054 2012-02-11 Eli Zaretskii <eliz@gnu.org>
9055
9056 * w32select.c (Fx_selection_exists_p): Sync doc string and
9057 argument list with xselect.c. (Bug#10783)
9058
9059 * w16select.c (Fx_selection_exists_p): Sync doc string and
9060 argument list with xselect.c. (Bug#10783)
9061
9062 2012-02-10 Glenn Morris <rgm@gnu.org>
9063
9064 * fns.c (Fsecure_hash): Doc fix.
9065
9066 2012-02-09 Kenichi Handa <handa@m17n.org>
9067
9068 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9069
9070 2012-02-07 Chong Yidong <cyd@gnu.org>
9071
9072 * buffer.c (Fbuffer_local_variables)
9073 (buffer_lisp_local_variables): Handle unbound vars correctly;
9074 don't let Qunbound leak into Lisp.
9075
9076 2012-02-07 Glenn Morris <rgm@gnu.org>
9077
9078 * image.c (Fimagemagick_types): Doc fix.
9079
9080 * image.c (imagemagick-render-type): Change it from a lisp object
9081 to an integer. Move the doc here from the lisp manual.
9082 Treat all values not equal to 0 the same.
9083
9084 2012-02-06 Chong Yidong <cyd@gnu.org>
9085
9086 * doc.c (store_function_docstring): Avoid applying docstring of
9087 alias to base function (Bug#2603).
9088
9089 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9090
9091 * .gdbinit (pp1, pv1): Remove redundant defines.
9092 (pr): Use pp.
9093
9094 2012-02-04 Chong Yidong <cyd@gnu.org>
9095
9096 * nsterm.m: Declare a global (Bug#10694).
9097
9098 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9099
9100 * w32.c (get_emacs_configuration_options):
9101 Include --enable-checking, if specified, in the return value.
9102
9103 2012-02-04 Martin Rudalics <rudalics@gmx.at>
9104
9105 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9106 after rounding frame sizes. (Bug#9723)
9107
9108 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9109
9110 * keyboard.c (adjust_point_for_property): Don't position point
9111 before BEGV. (Bug#10696)
9112
9113 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9114
9115 Handle overflow when computing char display width (Bug#9496).
9116 * character.c (char_width): Return EMACS_INT, not int.
9117 (char_width, c_string_width): Check for overflow when
9118 computing the width; this is possible now that individual
9119 characters can have unbounded width. Problem introduced
9120 by merge from Emacs 23 on 2012-01-19.
9121
9122 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
9123
9124 * dbusbind.c (Fdbus_register_method): Mention the return value
9125 :ignore in the docstring.
9126
9127 2012-02-02 Glenn Morris <rgm@gnu.org>
9128
9129 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9130
9131 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9132 Unconditionally set to t. (Bug#10673)
9133 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9134 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9135 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9136
9137 2012-02-02 Kenichi Handa <handa@m17n.org>
9138
9139 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9140 0, do not call append_composite_glyph.
9141
9142 2012-02-02 Kenichi Handa <handa@m17n.org>
9143
9144 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9145 NULL (Bug#6988).
9146 (x_produce_glyphs): If the component of a composition is a null
9147 string, set it->pixel_width to 1 to avoid zero-width glyph.
9148
9149 2012-02-01 Eli Zaretskii <eliz@gnu.org>
9150
9151 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9152 first 2 arguments are identical. This makes inserting large
9153 output from a subprocess an order of magnitude faster on
9154 MS-Windows, where all sbrk'ed memory is always contiguous.
9155
9156 2012-01-31 Glenn Morris <rgm@gnu.org>
9157
9158 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9159 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9160 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9161
9162 2012-01-29 Glenn Morris <rgm@gnu.org>
9163
9164 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9165
9166 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9167
9168 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9169
9170 2012-01-28 Chong Yidong <cyd@gnu.org>
9171
9172 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9173
9174 2012-01-26 Chong Yidong <cyd@gnu.org>
9175
9176 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9177
9178 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9179 repeat counts (Bug#10507).
9180
9181 2012-01-26 Glenn Morris <rgm@gnu.org>
9182
9183 * lread.c (syms_of_lread): Doc fix.
9184
9185 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9186
9187 * coding.c (encode_designation_at_bol): Change return value to
9188 EMACS_INT.
9189
9190 2012-01-25 Chong Yidong <cyd@gnu.org>
9191
9192 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9193
9194 2012-01-21 Chong Yidong <cyd@gnu.org>
9195
9196 * floatfns.c (Fcopysign): Make the second argument non-optional,
9197 since nil is not allowed anyway.
9198
9199 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9200
9201 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9202 (send_process): Likewise.
9203
9204 2012-01-19 Martin Rudalics <rudalics@gmx.at>
9205
9206 * window.c (save_window_save, Fcurrent_window_configuration)
9207 (Vwindow_persistent_parameters): Do not use Qstate.
9208 Rewrite doc-strings.
9209
9210 2012-01-19 Kenichi Handa <handa@m17n.org>
9211
9212 * character.c (char_width): New function.
9213 (Fchar_width, c_string_width, lisp_string_width):
9214 Use char_width (Bug#9496).
9215
9216 2012-01-16 Martin Rudalics <rudalics@gmx.at>
9217
9218 * window.c (Vwindow_persistent_parameters): New variable.
9219 (Fset_window_configuration, save_window_save): Handle persistent
9220 window parameters.
9221
9222 2012-01-14 Eli Zaretskii <eliz@gnu.org>
9223
9224 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9225 thrashing the stack of the thread. (Bug#9087)
9226
9227 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9228
9229 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9230
9231 2012-01-11 Eli Zaretskii <eliz@gnu.org>
9232
9233 * xdisp.c (rows_from_pos_range): Handle the case where the
9234 highlight ends on a newline. (Bug#10464)
9235 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9236 he end column for display of highlight that ends on a newline
9237 before a R2L line.
9238
9239 2012-01-11 Glenn Morris <rgm@gnu.org>
9240
9241 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9242 from load-path also when installation-directory is nil. (Bug#10208)
9243
9244 2012-01-10 Glenn Morris <rgm@gnu.org>
9245
9246 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9247
9248 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9249 Update template values to be closer to their typical values these days.
9250
9251 2012-01-09 Eli Zaretskii <eliz@gnu.org>
9252
9253 * xdisp.c (rows_from_pos_range): Accept additional argument
9254 DISP_STRING, and accept any glyph in a row whose object is that
9255 string as eligible for mouse highlight. Fixes mouse highlight of
9256 display strings from overlays. (Bug#10464)
9257
9258 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
9259
9260 emacs: fix an auto-save permissions race condition (Bug#10400)
9261 * fileio.c (auto_saving_dir_umask): New static var.
9262 (Fmake_directory_internal): Use it.
9263 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9264 creating the directory. The old code temporarily assigns
9265 too-generous permissions to the directory.
9266 (do_auto_save_eh): Clear it.
9267 (Fdo_auto_save): Catch all errors, not just file errors, so
9268 that the var is always cleared.
9269
9270 2012-01-07 Eli Zaretskii <eliz@gnu.org>
9271
9272 * search.c (scan_buffer): Pass character positions to
9273 know_region_cache, not byte positions. (Bug#6540)
9274
9275 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
9276
9277 * w32.c (sys_rename): Report EXDEV when rename of a directory
9278 fails because the target is on another logical disk. (Bug#10284)
9279
9280 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9281
9282 * xterm.c (x_embed_request_focus): New function.
9283
9284 * xterm.h: Add prototype.
9285
9286 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9287
9288 2012-01-05 Glenn Morris <rgm@gnu.org>
9289
9290 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9291
9292 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9293
9294 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9295 Load gnutls_transport_set_lowat only if GnuTLS version is below
9296 2.11.1.
9297 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9298 GnuTLS versions below 2.11.1.
9299
9300 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9301
9302 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9303 to the doc string advising against its use for altering the way
9304 windows are scrolled.
9305
9306 2011-12-28 Kenichi Handa <handa@m17n.org>
9307
9308 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9309 coding-system ASCII compatible only when it does not produce BOM
9310 on encoding (Bug#10383).
9311
9312 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9313
9314 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9315 can scroll.
9316 (create_and_show_popup_menu): Always use menu_position_func for
9317 Gtk3 (Bug#10361).
9318
9319 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9320
9321 * callint.c (Fcall_interactively): Don't truncate prompt string.
9322
9323 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9324
9325 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9326 property that ends at ZV, so that the bidi iteration could be
9327 resumed from there (after widening). (Bug#10360)
9328
9329 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9330
9331 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9332
9333 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9334
9335 * nsterm.m (x_free_frame_resources):
9336 Release f->output_data.ns->miniimage.
9337 (ns_index_color): Fix indentation. Do not retain
9338 color_table->colors[i].
9339
9340 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9341 before returning.
9342
9343 * nsfns.m (x_set_background_color): Assign return value from
9344 ns_index_color to face-background instead of NSColor*.
9345 (ns_implicitly_set_icon_type): Fix indentation.
9346 Change assignment in for loop to comparison.
9347
9348 * emacs.c (ns_pool): New variable.
9349 (main): Assign ns_pool.
9350 (Fkill_emacs): Call ns_release_autorelease_pool.
9351
9352 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9353 autorelease fdesc, release fdAttrs and tdict.
9354 (ns_get_covering_families): Release charset.
9355 (ns_findfonts): Release NSFontDescriptor created with new.
9356 (ns_uni_to_glyphs): Fix indentation.
9357 (setString): Release attrStr before assigning new value.
9358
9359 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9360
9361 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9362 and NS_IMPL_COCOA.
9363 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9364 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9365
9366 2011-12-18 David Reitter <reitter@cmu.edu>
9367
9368 * nsterm.m (ns_term_init): Subscribe for notifications
9369 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9370 to method trackingNotification in EmacsMenu.
9371
9372 * nsmenu.m (trackingMenu): New variable.
9373 (trackingNotification): New method (from Aquamacs).
9374 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9375 from Aquamacs (Bug#7030).
9376
9377 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9378
9379 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9380 (symbol_to_nsstring): Fix indentation.
9381 (ns_symbol_to_pb): New function.
9382 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9383 (Fns_rotate_cut_buffers_internal): Remove.
9384 (Fns_store_selection_internal): Rename from
9385 Fns_store_cut_buffer_internal.
9386 (ns_get_foreign_selection, Fx_own_selection_internal)
9387 (Fx_disown_selection_internal, Fx_selection_exists_p)
9388 (Fns_get_selection_internal, Fns_store_selection_internal):
9389 Use ns_symbol_to_pb and check if return value is nil.
9390 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9391 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9392 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9393 renamed to Sns_store_selection_internal.
9394 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9395 and remove this function.
9396 (ns_handle_selection_clear): Remove, never used.
9397 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9398 here.
9399
9400 2011-12-17 Ken Brown <kbrown@cornell.edu>
9401
9402 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9403 GID is unknown (Bug#10257).
9404
9405 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9406
9407 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9408 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9409 which caused a build failure on GNU/Linux IA-64. This problem was
9410 introduced by my 2011-10-07 patch.
9411
9412 2011-12-15 Juri Linkov <juri@jurta.org>
9413
9414 * image.c (imagemagick_error): New function. (Bug#10112)
9415 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9416 Use `imagemagick_error' where ImageMagick functions return
9417 `MagickFalse'.
9418 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9419 proper order.
9420
9421 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9422
9423 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9424 fill background (Bug#8992).
9425
9426 2011-12-13 Martin Rudalics <rudalics@gmx.at>
9427
9428 * window.c (Vwindow_combination_resize)
9429 (Vwindow_combination_limit): Use t instead of non-nil in
9430 doc-strings.
9431 (Vrecenter_redisplay): Add first sentence of doc-string on
9432 separate line.
9433 (Frecenter): Fix doc-string typo.
9434
9435 2011-12-11 Kenichi Handa <handa@m17n.org>
9436
9437 * coding.c (Funencodable_char_position): Pay attention to the
9438 buffer text relocation (Bug#9389).
9439
9440 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9441
9442 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9443 gtk_init (Bug#10100).
9444
9445 2011-12-10 Eli Zaretskii <eliz@gnu.org>
9446
9447 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9448 IT->string is nil. (Bug#10263)
9449
9450 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9451
9452 * nsterm.h (x_free_frame_resources): Declare.
9453
9454 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9455 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9456
9457 * nsterm.h (ns_get_defaults_value): Declare.
9458
9459 * nsterm.m (ns_default): Call ns_get_defaults_value.
9460
9461 2011-12-09 Eli Zaretskii <eliz@gnu.org>
9462
9463 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9464 (Bug#10170)
9465
9466 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9467
9468 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9469 that where the value of an _OBJC_* symbol points to is in the .bss
9470 section (Bug#10240).
9471
9472 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9473
9474 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9475 after the loop to call ccl_driver at least once (Bug#8619).
9476
9477 2011-12-08 Kenichi Handa <handa@m17n.org>
9478
9479 * ftfont.c (get_adstyle_property): Fix previous change
9480 (Bug#10233).
9481
9482 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
9483
9484 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9485 dirs from the default value of EMACSLOADPATH (bug#10208).
9486
9487 2011-12-07 Glenn Morris <rgm@gnu.org>
9488
9489 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9490 installation and source directories as well. (Bug#10208)
9491
9492 2011-12-06 Chong Yidong <cyd@gnu.org>
9493
9494 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9495
9496 2011-12-06 Glenn Morris <rgm@gnu.org>
9497
9498 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9499 as an error, not just -1. (Bug#10217)
9500
9501 2011-12-05 Chong Yidong <cyd@gnu.org>
9502
9503 * keyboard.c (process_special_events): New function.
9504 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9505
9506 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9507
9508 * coding.c (encode_designation_at_bol): Don't use uninitialized
9509 local variable (Bug#9318).
9510
9511 2011-12-05 Kenichi Handa <handa@m17n.org>
9512
9513 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9514 return Qnil (Bug#8046, Bug#10193).
9515
9516 2011-12-05 Kenichi Handa <handa@m17n.org>
9517
9518 * coding.c (encode_designation_at_bol): New args charbuf_end and
9519 dst. Return the number of produced bytes. Callers changed.
9520 (coding_set_source): Return how many bytes coding->source was
9521 relocated.
9522 (coding_set_destination): Return how many bytes
9523 coding->destination was relocated.
9524 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9525 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9526
9527 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9528
9529 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9530 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9531 macro (Bug#9318).
9532
9533 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9534
9535 The following changes are to fix Bug#9318.
9536
9537 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9538 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9539 (encode_coding_iso_2022, encode_coding_sjis)
9540 (encode_coding_big5, encode_coding_charset): Use the above macros.
9541
9542 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
9543
9544 * lisp.h (process_quit_flag): Fix external declaration.
9545
9546 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9547
9548 Don't macro-inline non-performance-critical code.
9549 * eval.c (process_quit_flag): New function.
9550 * lisp.h (QUIT): Use it.
9551
9552 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9553
9554 * nsfns.m (get_geometry_from_preferences): New function.
9555 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9556
9557 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9558
9559 * emacs.c (Qkill_emacs): Define.
9560 (syms_of_emacs): Initialize it.
9561 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9562 Qquit_flag to `kill-emacs' instead.
9563 (quit_throw_to_read_char): Add parameter `from_signal'.
9564 All callers changed. Call Fkill_emacs if requested and safe.
9565 * lisp.h (QUIT): Call Fkill_emacs if requested.
9566
9567 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9568
9569 * widget.c (update_wm_hints): Return if wmshell is null.
9570 (widget_update_wm_size_hints): New function.
9571
9572 * widget.h (widget_update_wm_size_hints): Declare.
9573
9574 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9575 widget_update_wm_size_hints (Bug#10104).
9576
9577 2011-12-03 Eli Zaretskii <eliz@gnu.org>
9578
9579 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9580 before a newline, prepare the bidi iterator for consuming the
9581 newline, and keep the current paragraph direction. (Bug#10183)
9582 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9583
9584 2011-12-02 Juri Linkov <juri@jurta.org>
9585
9586 * search.c (Fword_search_regexp): New Lisp function created from
9587 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9588 (Fword_search_backward, Fword_search_forward)
9589 (Fword_search_backward_lax, Fword_search_forward_lax):
9590 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9591 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9592
9593 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9594
9595 * fileio.c (Finsert_file_contents): Move after-change-function call
9596 to before the "handled:" label, since all "goto handled" appear in
9597 cases where the *-change-functions have already been properly called
9598 (bug#10117).
9599
9600 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9601
9602 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9603 waiting for input. (Bug#10169)
9604
9605 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9606
9607 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9608 verifies glyph row's hash code--we have just reallocated the
9609 glyphs, so their contents can be complete garbage. (Bug#10164)
9610
9611 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
9612
9613 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9614
9615 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9616
9617 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9618 attributes are tested _before_ calling verify_row_hash, to protect
9619 against GCC re-ordering of the tests. (Bug#10164)
9620
9621 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9622
9623 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9624
9625 * xterm.c (handle_one_xevent): Only set async_visible and friends
9626 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9627 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9628 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9629
9630 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9631
9632 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9633 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9634 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9635 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9636 All uses changed to use GCPRO1 etc.
9637 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9638 Revert to old implementation (i.e., before 2011-03-11).
9639
9640 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9641
9642 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9643 of scroll runs so as to avoid assigning disabled bogus rows and
9644 unnecessary graphics copy operations.
9645
9646 2011-11-27 Eli Zaretskii <eliz@gnu.org>
9647
9648 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9649 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9650 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9651 (malloc, free, realloc, calloc): Redirect to e_* only when
9652 compiling Emacs.
9653
9654 * lisp.h (GCTYPEBITS): Move before first use.
9655 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9656 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9657 this macro definition.
9658
9659 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9660 _MSC_VER.
9661
9662 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9663
9664 * gtkutil.c (xg_create_frame_widgets):
9665 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9666 present with Gtk+ 2.0.
9667
9668 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9669
9670 * fileio.c (Finsert_file_contents): Undo previous change; see
9671 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9672
9673 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9674
9675 Rename locals to avoid shadowing.
9676 * fileio.c (Finsert_file_contents):
9677 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9678 * process.c (wait_reading_process_output):
9679 Rename inner 'proc' to 'p' to avoid shadowing.
9680 Indent for consistency with usual Emacs style.
9681
9682 2011-11-25 Eli Zaretskii <eliz@gnu.org>
9683
9684 * xdisp.c (redisplay_window): If cursor row is not fully visible
9685 after recentering, and scroll-conservatively is set to a large
9686 number, scroll window by a few more lines to make the cursor fully
9687 visible and out of scroll-margin. (Bug#10105)
9688 (start_display): Don't move to the next line if the display should
9689 start at a newline that is part of a display vector or an overlay
9690 string. (Bug#10119)
9691
9692 2011-11-24 Juri Linkov <juri@jurta.org>
9693
9694 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9695 after the `MagickPingImage' call. (Bug#10112)
9696
9697 2011-11-23 Chong Yidong <cyd@gnu.org>
9698
9699 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9700
9701 2011-11-23 Martin Rudalics <rudalics@gmx.at>
9702
9703 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9704 making another buffer current. (Bug#10114)
9705
9706 2011-11-23 Glenn Morris <rgm@gnu.org>
9707
9708 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9709
9710 2011-11-23 Chong Yidong <cyd@gnu.org>
9711
9712 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9713 using it (Bug#5984).
9714
9715 2011-11-22 Eli Zaretskii <eliz@gnu.org>
9716
9717 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9718 and header-lines, as they don't have one computed for them.
9719 (Bug#10098)
9720
9721 * .gdbinit (prow): Make displayed values more self-explaining.
9722 Add row's hash code.
9723
9724 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9725
9726 * process.c (wait_reading_process_output): Fix asynchrounous
9727 GnuTLS socket handling on some versions of the GnuTLS library.
9728 (wait_reading_process_output): Add comment and URL.
9729
9730 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9731
9732 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9733
9734 2011-11-21 Chong Yidong <cyd@gnu.org>
9735
9736 * window.c (Fnext_window, Fprevious_window): Doc fix.
9737
9738 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9739
9740 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9741
9742 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9743
9744 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9745
9746 2011-11-20 Martin Rudalics <rudalics@gmx.at>
9747
9748 * window.c (Fset_window_combination_limit): Rename argument
9749 STATUS to LIMIT.
9750 (Vwindow_combination_limit): Remove "status" from doc-string.
9751
9752 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9753
9754 * m/ibms390.h: Remove.
9755 * m/ibms390x.h: Don't include "ibms390.h".
9756
9757 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9758
9759 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9760 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9761
9762 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9763
9764 * casetab.c (Fset_case_table):
9765 * charset.c (Fcharset_after): Fix typos.
9766
9767 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9768
9769 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9770 Otherwise, valgrind does not work on some platforms.
9771 Problem reported by Andreas Schwab in
9772 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9773 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9774 is set, removing the need for VIRT_ADDRESS_VARIES.
9775 (PURE_P): Use a more-efficient implementation that needs just one
9776 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9777 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9778 to 4 (xorl, subq, cmpq, setbe).
9779 * alloc.c (pure): Always extern now, since that's the
9780 VIRT_ADDR_VARIES behavior.
9781 (PURE_POINTER_P): Use a single comparison, not two, for
9782 consistency with the new puresize.h.
9783 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9784 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9785 Remove VIRT_ADDR_VARIES no longer needed.
9786
9787 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9788
9789 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9790 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9791 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9792 behave as if the cursor position were at the window margin.
9793
9794 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9795 and the cursor position is out of bounds, behave as if the cursor
9796 position were at the window margin. (Bug#10075)
9797
9798 2011-11-18 Chong Yidong <cyd@gnu.org>
9799
9800 * window.c (Fwindow_combination_limit): Make first argument
9801 non-optional, since it is meaningless for live windows like the
9802 selected window.
9803
9804 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9805
9806 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9807
9808 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9809
9810 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9811 (graft_intervals_into_buffer): Simplify.
9812
9813 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9814
9815 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9816 hash values of the two rows.
9817 (copy_row_except_pointers): Preserve the used[] arrays and the
9818 hash values of the two rows. (Bug#10035)
9819 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9820
9821 * xdisp.c (row_hash): New function, body extracted from
9822 compute_line_metrics.
9823 (compute_line_metrics): Call row_hash, instead of computing the
9824 hash code inline.
9825
9826 * dispnew.c (verify_row_hash): Call row_hash for computing the
9827 hash code of a row, instead of duplicating code from xdisp.c.
9828
9829 * dispextern.h (row_hash): Add prototype.
9830
9831 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9832
9833 * frame.c (delete_frame): Don't delete the terminal when the last
9834 X frame is closed if emacs is built with GTK toolkit.
9835
9836 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9837
9838 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9839
9840 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9841
9842 * window.c (Vwindow_splits): Rename to
9843 Vwindow_combination_resize. Suggested by Juri Linkov.
9844 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9845 of Vwindow_splits.
9846
9847 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9848
9849 * nsfns.m (Fns_font_name):
9850 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9851
9852 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9853
9854 * window.h (window): Rename slot "nest" to "combination_limit".
9855 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9856 (Fset_window_nest): Rename to Fset_window_combination_limit.
9857 (Vwindow_nest): Rename to Vwindow_combination_limit.
9858 (recombine_windows, make_parent_window, make_window)
9859 (Fsplit_window_internal, saved_window)
9860 (Fset_window_configuration, save_window_save): Rename all
9861 occurrences of window_nest to window_combination_limit.
9862
9863 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9864
9865 * image.c (imagemagick_load_image): Fix typo.
9866
9867 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9868
9869 * xdisp.c (display_line): Move the call to
9870 highlight_trailing_whitespace before the call to
9871 compute_line_metrics, since the latter needs to see the final
9872 faces of all the glyphs to compute ROW's hash value.
9873 Fixes assertion violations in row_equal_p. (Bug#10035)
9874
9875 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9876
9877 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9878 just return (bug#10044).
9879
9880 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9881
9882 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9883 with user-defined heap size. Bump the default size of the temacs
9884 heap to 27MB, to avoid memory warning when running temacs.
9885 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9886
9887 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9888 current_matrix and desired_matrix. (Bug#9990)
9889 (verify_row_hash) [XASSERTS]: New function.
9890 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9891 that the hash value of glyph rows is correct.
9892
9893 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9894
9895 * window.h (window): Remove splits slot.
9896 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9897 (Fdelete_other_windows_internal, make_parent_window)
9898 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9899 (Fset_window_configuration, save_window_save): Don't deal with
9900 split status of windows.
9901 (saved_window): Remove splits slot.
9902 (Vwindow_splits): Rewrite doc-string.
9903
9904 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9905
9906 * xfns.c (unwind_create_frame):
9907 * nsfns.m (unwind_create_frame):
9908 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9909 Vframe_list (Bug#9999).
9910
9911 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9912
9913 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9914
9915 2011-11-11 Kenichi Handa <handa@m17n.org>
9916
9917 * callproc.c (Fcall_process): Set the member dst_multibyte of
9918 process_coding.
9919
9920 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9921
9922 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9923 avoid a crash (bug#9496).
9924
9925 2011-11-09 Chong Yidong <cyd@gnu.org>
9926
9927 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9928 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9929
9930 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9931
9932 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9933
9934 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9935
9936 Avoid some portability problems by eschewing 'extern inline' functions.
9937 The trivial performance wins aren't worth the portability hassles; see
9938 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9939 et seq.
9940 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9941 (window_box_width, window_box_left, window_box_left_offset)
9942 (window_box_right, window_box_right_offset): Undo previous change,
9943 by removing the "extern"s.
9944 * intervals.c (adjust_intervals_for_insertion)
9945 (adjust_intervals_for_deletion): Undo previous change,
9946 making these static again.
9947 (offset_intervals, temp_set_point_both, temp_set_point)
9948 (copy_intervals_to_string): No longer inline.
9949 * xdisp.c (window_text_bottom_y, window_box_width)
9950 (window_box_height, window_box_left_offset)
9951 (window_box_right_offset, window_box_left, window_box_right)
9952 (window_box): No longer inline.
9953
9954 2011-11-08 Chong Yidong <cyd@gnu.org>
9955
9956 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9957 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9958 Signal an error if not a live window.
9959 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9960 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9961
9962 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9963
9964 * lisp.h (syms_of_abbrev): Remove declaration.
9965 Reported by CHENG Gao <chenggao@royau.me>.
9966
9967 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9968
9969 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9970 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9971 of temacs in GUI mode.
9972
9973 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9974
9975 * window.h: Declare delete_all_child_windows instead of
9976 delete_all_subwindows.
9977 * window.c (Fwindow_nest, Fset_window_nest)
9978 (Fset_window_new_total, Fset_window_new_normal)
9979 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9980 (delete_all_subwindows): Rename to delete_all_child_windows.
9981 (Fdelete_other_windows_internal, Fset_window_configuration):
9982 Call delete_all_child_windows instead of delete_all_subwindows.
9983 * frame.c (delete_frame): Call delete_all_child_windows instead
9984 of delete_all_subwindows.
9985
9986 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9987
9988 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9989 This is also needed for porting to any host where GC_MARK_STACK is
9990 not GC_MAKE_GCPROS_NOOPS.
9991 (which_symbols): Use it.
9992
9993 2011-11-07 Kenichi Handa <handa@m17n.org>
9994
9995 * coding.c (coding_set_destination): Check coding->src_pos only
9996 when coding->src_object is a buffer (bug#9910).
9997
9998 * process.c (send_process): Set the member src_multibyte of coding
9999 to 0 (bug#9911) when sending a unibyte text.
10000
10001 * callproc.c (Fcall_process): Set the member src_multibyte of
10002 process_coding to 0 (bug#9912).
10003
10004 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10005
10006 * xmenu.c (cleanup_widget_value_tree): New function.
10007 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10008 calling free_menubar_widget_value_tree directly (Bug#9830).
10009
10010 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10011
10012 Fix some portability problems with 'inline'.
10013 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10014 (window_box_width, window_box_left, window_box_left_offset)
10015 (window_box_right, window_box_right_offset): Declare extern.
10016 Otherwise, these inline functions do not conform to C99 and
10017 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10018 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10019 * intervals.c (adjust_intervals_for_insertion)
10020 (adjust_intervals_for_deletion): Now extern, because otherwise the
10021 extern inline functions 'offset_intervals' couldn't refer to it.
10022 (static_offset_intervals): Remove.
10023 (offset_intervals): Rewrite using the old contents of
10024 static_offset_intervals. The old version didn't conform to C99
10025 because an extern inline function contained a reference to an
10026 identifier with static linkage.
10027
10028 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10029
10030 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10031 GC.
10032
10033 2011-11-06 Eli Zaretskii <eliz@gnu.org>
10034
10035 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10036 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10037 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10038 return Qleft_to_right.
10039
10040 2011-11-06 Chong Yidong <cyd@gnu.org>
10041
10042 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10043 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10044 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10045 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10046 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10047 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10048 (Fwindow_vscroll): Doc fix.
10049 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10050 argument, since it makes no sense to pass a live window and for
10051 consistency with window-child.
10052
10053 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10054
10055 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10056 support MSVC.
10057
10058 2011-11-05 Jason Rumney <jasonr@gnu.org>
10059
10060 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10061 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10062 fonts (Bug#6029).
10063 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10064 bitwise arithmetic preventing use of unicode-sip and non-truetype
10065 opentype fonts.
10066
10067 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10068
10069 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10070 "emacs"-only part.
10071
10072 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10073 initialization code to keep similarity to xfns.c after changes
10074 from 2011-11-05.
10075
10076 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10077
10078 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10079 (unwind_create_frame): New function (Bug#9943).
10080 (Fx_create_frame): Restructure code to be more similar to the one in
10081 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10082 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10083 Move terminal->reference_count++ just before making the frame official
10084 (Bug#9943).
10085
10086 * nsterm.m (x_free_frame_resources): New function.
10087 (x_destroy_window): Move code to x_free_frame_resources.
10088
10089 * xfns.c (unwind_create_frame): Fix comment.
10090 (Fx_create_frame, x_create_tip_frame):
10091 Move terminal->reference_count++ just before making the frame
10092 official. Move initialization of image_cache_refcount and
10093 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10094
10095 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10096
10097 Support MSVC build with newer versions of Visual Studio.
10098 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10099 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10100 nt/gmake.defs.
10101
10102 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10103 which are not supported by MSVC.
10104 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10105 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10106 bitfields.
10107 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10108 types in bitfields.
10109 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10110
10111 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10112
10113 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
10114
10115 Support MSVC build with newer versions of Visual Studio.
10116 * w32.c: Don't include w32api.h for MSVC.
10117 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10118
10119 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10120 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10121 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10122 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10123 e_* cousins.
10124 (alloca) [_MSC_VER]: Define to _alloca.
10125
10126 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10127
10128 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10129
10130 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10131
10132 * xdisp.c (note_mouse_highlight): If either of
10133 previous/next-single-property-change returns nil, treat that as
10134 the beginning or the end of the buffer. (Bug#9955)
10135
10136 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10137
10138 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10139 label is not null (Bug#9951).
10140 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10141 may be NULL.
10142
10143 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10144
10145 * window.c (Fwindow_body_size): Mention in the doc string that the
10146 return value is in frame's canonical units. (Bug#9949)
10147
10148 2011-11-03 Eli Zaretskii <eliz@gnu.org>
10149
10150 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10151
10152 * w32fns.c (unwind_create_frame): If needed, free the glyph
10153 matrices of the partially constructed frame. (Bug#9943)
10154 * xfns.c (unwind_create_frame): Likewise.
10155
10156 2011-11-01 Eli Zaretskii <eliz@gnu.org>
10157
10158 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10159 Don't stop backward scan on the continuation glyph, even though
10160 its CHARPOS is positive.
10161 (mouse_face_from_buffer_pos, note_mouse_highlight):
10162 Rename cover_string to disp_string.
10163
10164 2011-11-01 Martin Rudalics <rudalics@gmx.at>
10165
10166 * window.c (temp_output_buffer_show): Don't use
10167 Vtemp_buffer_show_specifiers.
10168 (Vtemp_buffer_show_specifiers): Remove unused variable.
10169
10170 2011-10-30 Eli Zaretskii <eliz@gnu.org>
10171
10172 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10173 past the beginning of the current glyph matrix.
10174
10175 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
10176
10177 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10178 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10179 HAVE_GTK3 (Bug#9869).
10180
10181 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10182 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10183
10184 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10185
10186 * xterm.c: Declare x_handle_net_wm_state to return int.
10187 (handle_one_xevent): Check if we are iconified but don't have
10188 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10189 (get_current_wm_state): Return non-zero if not hidden,
10190 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10191 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10192 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10193 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10194
10195 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10196
10197 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10198 so that this new function doesn't get optimized away by a
10199 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10200
10201 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10202
10203 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10204
10205 2011-10-29 Eli Zaretskii <eliz@gnu.org>
10206
10207 Fix the `xbytecode' command.
10208 * .gdbinit (xprintbytestr): New command.
10209 (xwhichsymbols): Rename from `which'; all callers changed.
10210 (xbytecode): Print the byte-code string as well.
10211
10212 2011-10-29 Kim Storm <storm@cua.dk>
10213
10214 * alloc.c (which_symbols): New function.
10215
10216 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10217
10218 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10219 line. (Bug#9903)
10220
10221 2011-10-29 Glenn Morris <rgm@gnu.org>
10222
10223 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10224 Not clear what it was for, and it causes various bugs. (Bug#9839)
10225
10226 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10227
10228 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10229 possible random value that matches one of those tested as
10230 condition to clear the mouse face.
10231
10232 2011-10-28 Chong Yidong <cyd@gnu.org>
10233
10234 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10235
10236 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10237
10238 * window.c (make_window): Initialize phys_cursor_on_p.
10239
10240 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10241
10242 * lisp.h (struct Lisp_Symbol): Update comments.
10243
10244 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
10245
10246 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10247
10248 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10249
10250 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10251 <oslsachem@gmail.com> for helping to debug this.
10252
10253 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10254 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10255 (g_b_init_get_glyph_outline_w): New static variables.
10256 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10257 (GetGlyphOutlineW_Proc): New typedefs.
10258 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10259 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10260 New functions.
10261 (w32font_open_internal, compute_metrics):
10262 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10263 instead of calling the "wide" APIs directly.
10264
10265 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10266
10267 * w32.h (syms_of_w32font): Add prototype.
10268
10269 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10270
10271 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10272 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10273 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10274 (Fmove_to_window_line): Doc fix.
10275
10276 2011-10-27 Chong Yidong <cyd@gnu.org>
10277
10278 * process.c (make_process): Set gnutls_state to NULL.
10279
10280 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10281 non-NULL, regardless of GNUTLS_INITSTAGE.
10282 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10283 an error. Set process slots as soon as we allocate them.
10284
10285 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10286
10287 2011-10-27 Chong Yidong <cyd@gnu.org>
10288
10289 * gnutls.c (emacs_gnutls_deinit): New function.
10290 Deallocate credentials structures as well as calling gnutls_deinit.
10291 (Fgnutls_deinit, Fgnutls_boot): Use it.
10292
10293 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10294 (deactivate_process): Call emacs_gnutls_deinit.
10295
10296 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10297
10298 * image.c (x_create_x_image_and_pixmap):
10299 * w32.c (sys_rename, w32_delayed_load):
10300 * w32font.c (fill_in_logfont):
10301 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10302
10303 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10304
10305 * w32fns.c (w32_default_color_map): New function,
10306 extracted from Fw32_default_color_map.
10307 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10308
10309 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10310
10311 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10312
10313 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10314
10315 * keyboard.c (test_undefined): New function (bug#9751).
10316 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10317
10318 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10319
10320 * sysdep.c (init_sys_modes): Fix the check for the controlling
10321 terminal (Bug#6649).
10322
10323 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10324
10325 * dispextern.h (struct bidi_it): New member next_en_type.
10326
10327 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10328 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10329 current character, check also for next_en_type being WEAK_EN.
10330 (bidi_resolve_weak): Don't enter the expensive loop if the current
10331 position is before next_en_pos. Record the bidi type of the first
10332 non-ET, non-BN character we find, in addition to its position.
10333 (bidi_level_of_next_char): Invalidate next_en_type when
10334 next_en_pos is over-stepped.
10335
10336 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10337
10338 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10339 * editfns.c: Rewrite current-time-zone so that it invokes
10340 the equivalent of (format-time-string "%Z") to get the time zone name.
10341 This fixes a bug when the time zone name contains characters that
10342 need converting from the system time locale to Emacs internal format.
10343 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10344 that patch fixed format-time-string to do the conversion, but
10345 I forgot to fix current-time-zone.
10346 (format_time_string): New function, containing most of
10347 what Fformat_time_string used to contain.
10348 (Fformat_time_string): Rewrite in terms of format_time_string.
10349 This doesn't change this function's behavior.
10350 (current-time-zone): Rewrite to use format_time_string.
10351 This fixes the bug reported by Michael Schierl in
10352 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10353 Jason Rumney's 2007-06-07 change worked around this bug, but
10354 didn't fix it.
10355 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10356
10357 2011-10-19 Eli Zaretskii <eliz@gnu.org>
10358
10359 * xdisp.c (start_display): If the character at POS is displayed
10360 via a display vector, reset IT->current.dpvec_index to zero.
10361 (try_window_reusing_current_matrix): If a line ends in a display
10362 vector or the next line starts in a display vector, continue
10363 redrawing the window even though the character position of
10364 start_row was reached.
10365 (Bug#9771, part 2)
10366
10367 2011-10-18 Chong Yidong <cyd@gnu.org>
10368
10369 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10370 with nobreak-char-display too.
10371
10372 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10373
10374 Fix part 3 of bug#9771.
10375 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10376 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10377 non-neutral characters if the current character is a paragraph
10378 separator (a.k.a. Newline). This avoids running the same
10379 expensive loop twice, once when we consume the preceding newline
10380 and the other time when the line actually needs to be displayed.
10381 Avoid the loop when we see neutrals on the base embedding level
10382 following a character whose directionality is the same as the
10383 paragraph's. This avoids running the expensive loop when a line
10384 ends in a long sequence of neutrals, like control characters.
10385 Add assertion against STRONG_AL type. Slightly rearrange code
10386 that determines the type of a neutral given the first non-neutral
10387 that follows it.
10388 (bidi_level_of_next_char): Set next_en_pos to zero when
10389 invalidating its info.
10390
10391 2011-10-17 Eli Zaretskii <eliz@gnu.org>
10392
10393 * xdisp.c (push_display_prop): Determine whether to record string
10394 or buffer position by IT->string, not by IT->method. Allow
10395 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10396 (move_it_vertically_backward): Don't look for character position
10397 immediately after the newline when in a continuation line.
10398 (Bug#9771, part 1)
10399
10400 2011-10-15 Martin Rudalics <rudalics@gmx.at>
10401
10402 * window.c (coordinates_in_window): Rewrite and delabelize
10403 vertical border check. (Bug#5357) (Bug#9618)
10404
10405 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10406
10407 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10408 errors in XSetWindowBorder (bug#9310).
10409
10410 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10411
10412 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10413 avoid crash when xmalloc overrun checking is enabled.
10414
10415 2011-10-13 Eli Zaretskii <eliz@gnu.org>
10416
10417 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10418 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10419 cursor motion with <left> and <right> arrow keys.
10420
10421 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10422 some callers set that themselves.
10423
10424 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10425
10426 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10427 display string and the previous row comes from the same string and
10428 is empty. (Bug#9739) (Bug#9738)
10429
10430 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10431
10432 * doc.c (get_doc_string): Encode file name (bug#9735).
10433
10434 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10435
10436 * bidi.c (bidi_level_of_next_char):
10437 * xdisp.c (get_visually_first_element): Remove old incorrect
10438 comments regarding the Unicode Line Separator character.
10439
10440 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10441
10442 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10443
10444 * alloc.c (Fgc_status): Do not access beyond zombies array
10445 boundary if nzombies > MAX_ZOMBIES.
10446 * alloc.c (dump_zombies): Add missing format specifier.
10447
10448 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10449
10450 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10451 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10452
10453 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10454 Some packages use them to denote characters with modifiers.
10455
10456 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10457
10458 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10459 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10460 matching a pp-number. Rename parameter var to var1.
10461
10462 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10463
10464 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10465
10466 2011-10-08 Glenn Morris <rgm@gnu.org>
10467
10468 * callint.c (Fcall_interactively): Give a more explicit error for the
10469 'c' case with a non-character input. (Bug#8479)
10470
10471 2011-10-08 Eli Zaretskii <eliz@gnu.org>
10472
10473 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10474 lines.
10475 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10476 lines that are hscrolled on the left.
10477
10478 * dispnew.c (buffer_posn_from_coords): Account for a possible
10479 presence of header-line. (Bug#4426)
10480
10481 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10482
10483 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10484 Don't advertise functionality which we discourage or doesn't work.
10485
10486 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10487
10488 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10489 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10490 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10491 this makes Emacs dump core during garbage collection on rare
10492 occasions. sizeof is obviously inferior to offsetof here, so
10493 stick with offsetof.
10494 (GC_POINTER_ALIGNMENT): New macro.
10495 (mark_memory): Omit 3rd (offset) arg; caller changed.
10496 Don't assume EMACS_INT alignment is the same as pointer alignment.
10497
10498 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10499
10500 * keyboard.c (read_key_sequence_remapped): New var.
10501 (read_key_sequence): Compute remapping in the right buffer.
10502 (command_loop_1): Use read_key_sequence's remapping directly.
10503
10504 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10505
10506 * dired.c (file_name_completion): Don't expand file name.
10507 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10508 before checking file name handler.
10509
10510 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10511 they've been requested explicitly (bug#9591).
10512
10513 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
10514
10515 * keymap.c (Fsingle_key_description): Use make_specified_string
10516 instead of build_string to build string from push_key_description.
10517 (Bug#5193)
10518
10519 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10520
10521 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10522 This fixes a Y2038 bug on 64-bit hosts.
10523 * buffer.c (reset_buffer):
10524 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10525 (Fclear_buffer_auto_save_failure):
10526 Use 0, not -1, to represent an unset failure time, since time_t
10527 might not be signed.
10528
10529 Remove dependency on glibc malloc internals.
10530 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10531 Move back here from lisp.h, but with their new implementations.
10532 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10533 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10534 * charset.c (charset_table_init): New static var.
10535 (syms_of_charset): Use it instead of xmalloc. This removes a
10536 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10537 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10538 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10539 Move back to alloc.c.
10540 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10541 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10542
10543 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10544
10545 * nsterm.m (windowDidResize): Call x_set_window_size only when
10546 ns_in_resize is true. Otherwise set pixelwidth/height and
10547 call change_frame_size (Bug#9628).
10548
10549 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10550
10551 Port --enable-checking=all to Fedora 14 x86-64.
10552 * charset.c (syms_of_charset): Also account for glibc malloc's
10553 internal overhead when calculating the initial malloc maximum.
10554
10555 Port --enable-checking=all to Fedora 14 x86.
10556 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10557 Move to lisp.h.
10558 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10559 (overrun_check_realloc, overrun_check_free):
10560 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10561 That way, xmalloc returns a properly-aligned pointer even if
10562 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10563 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10564 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10565 into account when calculating the initial malloc maximum.
10566 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10567 Move here from alloc.c, so that charset.c can use it too.
10568 Properly align; the old code wasn't right for common 32-bit hosts
10569 when configured with --enable-checking=all.
10570 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10571 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10572
10573 2011-09-29 Eli Zaretskii <eliz@gnu.org>
10574
10575 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10576 use EDOM.
10577
10578 2011-09-28 Eli Zaretskii <eliz@gnu.org>
10579
10580 * xdisp.c (compute_display_string_end): If there's no display
10581 string at CHARPOS, return -1.
10582
10583 * bidi.c (bidi_fetch_char): When compute_display_string_end
10584 returns a negative value, treat the character as a normal
10585 character not covered by a display string. (Bug#9624)
10586
10587 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
10588
10589 * lread.c (Fread_from_string): Fix typo in docstring.
10590
10591 2011-09-27 Eli Zaretskii <eliz@gnu.org>
10592
10593 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10594 newline, reseat the iterator instead of bidi-iterating there one
10595 character at a time. (Bug#9610)
10596 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10597 TO_CHARPOS if the bidi iterator is at base embedding level.
10598
10599 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10600
10601 * lread.c (readevalloop): Use correct code for NBSP.
10602 (read1): Likewise. (Bug#9608)
10603
10604 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
10605
10606 * dbusbind.c (Fdbus_register_signal): When service is not
10607 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10608
10609 2011-09-25 Glenn Morris <rgm@gnu.org>
10610
10611 * buffer.c (truncate-lines): Doc fix.
10612
10613 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
10614
10615 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10616 (Fset_window_next_buffers): Doc fix.
10617
10618 2011-09-24 Glenn Morris <rgm@gnu.org>
10619
10620 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10621
10622 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10623
10624 Fix minor problems found by static checking.
10625 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10626 * indent.c (Fvertical_motion): Fix == vs = typo.
10627
10628 2011-09-24 Eli Zaretskii <eliz@gnu.org>
10629
10630 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10631 Default value is now t. Doc fix.
10632
10633 * indent.c (Fvertical_motion): Compute and apply the overshoot
10634 logic when moving up, not only when moving down. Fix the
10635 confusing name and values of the it_overshoot_expected variable;
10636 logic changes accordingly. (Bug#9254) (Bug#9549)
10637
10638 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10639 CHARPOS is covered by a display string which includes newlines.
10640 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10641 is covered by a display string with embedded newlines.
10642
10643 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
10644
10645 * dbusbind.c (Fdbus_register_signal): Add match rule to
10646 Vdbus_registered_objects_table. (Bug#9581)
10647 (Fdbus_register_method, Vdbus_registered_objects_table):
10648 Fix docstring.
10649
10650 2011-09-24 Jim Meyering <meyering@redhat.com>
10651
10652 do not ignore write error for any output size
10653 The previous change was incomplete.
10654 While it makes emacs --batch detect the vast majority of stdout
10655 write failures, errors were still ignored whenever the output size is
10656 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10657 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10658 && echo FAIL: ignored write error
10659 FAIL: ignored write error
10660 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10661 && echo FAIL: ignored write error
10662 FAIL: ignored write error
10663 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10664
10665 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10666
10667 * emacs.c (Fkill_emacs): In noninteractive mode exit
10668 non-successfully if a write error occurred on stdout. (Bug#9574)
10669
10670 2011-09-21 Eli Zaretskii <eliz@gnu.org>
10671
10672 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10673 the xassert test.
10674
10675 * dispextern.h (struct it): Update the comment documenting what
10676 can it->OBJECT be.
10677
10678 2011-09-20 Eli Zaretskii <eliz@gnu.org>
10679
10680 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10681 a display string, extend search for cursor position to end of row.
10682 (find_row_edges): If the row ends in a newline from a display
10683 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10684 Handle the case of a display string with multiple newlines.
10685 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10686 non-empty line. Fixes confusing cursor motion with arrow keys at
10687 the beginning of a line that starts with whitespace.
10688
10689 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10690
10691 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10692 (bug#9493).
10693
10694 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
10695
10696 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10697 boolean (Bug#9154).
10698
10699 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10700
10701 * xdisp.c (display_line): Record maximum and minimum buffer
10702 positions even if no glyphs were produced (e.g., by a zero-width
10703 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10704 buffer positions that will be removed from the glyph row because
10705 they don't fit.
10706 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10707 column is beyond frame width: don't subtract 1 "pixel" when
10708 computing width of the stretch.
10709 (reseat_at_next_visible_line_start): Undo the change made on
10710 2011-09-17 that saved paragraph information and restored it after
10711 the call to `reseat'. (Bug#9545)
10712
10713 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10714
10715 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10716 and turn window cursor on if cleared (Bug#9415).
10717
10718 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10719
10720 * search.c (boyer_moore): Take unibyte characters from pattern
10721 literally. (Bug#9458)
10722
10723 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10724
10725 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10726
10727 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10728
10729 Fix minor problem found by static checking.
10730 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10731 initialized, to pacify gcc -Wuninitialized.
10732
10733 * fileio.c: Report proper errno when syscall falls.
10734 (Finsert_file_contents): Save and restore errno,
10735 so that report_file_error outputs the correct diagnostic.
10736 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10737
10738 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10739
10740 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10741
10742 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10743
10744 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10745 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10746
10747 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10748
10749 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10750 about the current paragraph and restore it after the call to reseat.
10751
10752 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10753 (bidi_find_paragraph_start): Search back for paragraph beginning
10754 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10755 (bidi_move_to_visually_next): Only trigger paragraph-related
10756 computations when the last character is a newline or at EOB, not
10757 just any NEUTRAL_B. (Bug#9470)
10758
10759 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10760 truncated lines if point is covered by a display string. (Bug#9524)
10761
10762 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10763
10764 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10765 (cons_to_x_long): New function.
10766 (lisp_data_to_selection_data): Use it. Correct the test for
10767 short-versus-long data; it was negated. Break out of vector
10768 loop, for efficiency, when a long datum is discovered.
10769
10770 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10771
10772 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10773
10774 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10775
10776 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10777 GCC PR/17406) by declaring this function with external scope.
10778
10779 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10780
10781 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10782 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10783
10784 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10785
10786 * editfns.c (Fformat): Correctly handle text properties on "%%".
10787
10788 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10789
10790 * xterm.c (x_draw_composite_glyph_string_foreground):
10791 * w32term.c (x_draw_composite_glyph_string_foreground):
10792 * term.c (encode_terminal_code):
10793 * composite.c (composition_update_it, get_composition_id):
10794 * xdisp.c (get_next_display_element)
10795 (fill_composite_glyph_string): Add comments about special meaning
10796 of TAB characters in a composition.
10797
10798 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10799
10800 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10801 This occurs when processing a multibyte format.
10802 Problem reported by Wolfgang Jenker.
10803
10804 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10805
10806 * xdisp.c (try_cursor_movement): Only check for exact match if
10807 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10808
10809 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10810
10811 Remove unused external symbols.
10812 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10813 * xdisp.c (calc_pixel_width_or_height): Now static.
10814 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10815 * indent.c (check_display_width):
10816 * w32term.c: Fix comment to match code.
10817 * xterm.c, xterm.h (x_catching_errors): Remove.
10818
10819 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10820
10821 * xselect.c: Use signed conversions more consistently (Bug#9498).
10822 (selection_data_to_lisp_data): Assume incoming selection data are
10823 signed integers, not unsigned. This is to be consistent with
10824 outgoing selection data, which was modified to use signed integers
10825 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10826 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10827 expects long, not unsigned long.
10828
10829 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10830
10831 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10832 computation of loop end. Reported by Johan Bockgård
10833 <bojohan@gnu.org>.
10834
10835 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10836
10837 * frame.c (Fother_visible_frames_p): Function deleted.
10838
10839 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10840
10841 * indent.c (compute_motion): Process display vector front to back
10842 rather than the other way around. (Bug#2496)
10843
10844 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10845
10846 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10847
10848 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10849
10850 * minibuf.c (Fread_from_minibuffer): Doc fix.
10851
10852 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10853
10854 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10855 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10856
10857 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10858
10859 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10860 value for non-existent files.
10861
10862 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10863
10864 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10865 set its "size" to -1. This will set the modtime_size field of
10866 the corresponding buffer to -1, which is what
10867 verify-visited-file-modtime expects for files that do not exist.
10868 (Bug#9139)
10869
10870 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10871
10872 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10873 here ...
10874 * lisp.h: ... from here. push_key_description is no longer
10875 defined in keyboard.c, so its declaration should not be in
10876 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10877 logically belongs with push_key_description.
10878
10879 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10880
10881 * buffer.h: Include <sys/types.h> instead of <time.h>.
10882 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10883 Problem reported by Herbert J. Skuhra.
10884
10885 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10886
10887 * xml.c (parse_region): Make the parsing work for
10888 non-comment-starting XML files again (bug#9144).
10889
10890 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10891
10892 * image.c (gif_load): Fix calculation of bottom and right corner.
10893 (Bug#9468)
10894
10895 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10896
10897 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10898 redisplay in small windows.
10899
10900 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10901
10902 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10903
10904 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10905
10906 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10907 Operate on live windows only.
10908
10909 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10910
10911 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10912
10913 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10914
10915 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10916 only under bidi iteration.
10917
10918 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10919
10920 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10921
10922 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10923
10924 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10925 Without this fix, the command to link temacs failed due to an
10926 undefined symbol __builtin_isnan. This is because
10927 /usr/include/iso/math_c99.h #defines isnan(x) to
10928 __builtin_isnan(x), but the bundled gcc, which identifies itself
10929 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10930 a __builtin_isnan.
10931 * floatfns.c (isnan): #undef, and then #define to a clone of
10932 what's in data.c.
10933 (Fisnan): Always define, since it's always available now.
10934 (syms_of_floatfns): Always define isnan at the Lisp level.
10935
10936 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10937
10938 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10939
10940 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10941
10942 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10943 The previous code assumed that file offsets (off_t values) fit in
10944 EMACS_INT variables, which is not true on typical 32-bit hosts.
10945 The code messed up by falsely reporting buffer overflow in cases
10946 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10947 when "big" contains more than 2**29 bytes, even though this
10948 inserts just one byte and does not overflow the buffer.
10949 (Finsert_file_contents): Store file offsets as off_t
10950 values, not as EMACS_INT values. Check for overflow when
10951 converting between EMACS_INT and off_t. When checking for
10952 buffer overflow or for overlap, take the offsets into account.
10953 Don't use EMACS_INT for small values where int suffices.
10954 When checking for overlap, fix a typo: ZV was used where
10955 ZV_BYTE was intended.
10956 (Fwrite_region): Don't assume off_t fits into 'long'.
10957 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10958
10959 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10960
10961 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10962
10963 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10964
10965 sprintf-related integer and memory overflow issues (Bug#9412).
10966
10967 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10968 (esprintf, exprintf, evxprintf): New functions.
10969 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10970 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10971 (modify_event_symbol): Do not assume that the length of
10972 name_alist_or_stem is safe to alloca and fits in int.
10973 (Fexecute_extended_command): Likewise for function name and binding.
10974 (Frecursion_depth): Wrap around reliably on integer overflow.
10975 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10976 since some callers pass EMACS_INT values.
10977 (Fsingle_key_description): Don't crash if symbol name contains more
10978 than MAX_ALLOCA bytes.
10979 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10980 (get_minibuffer): Arg is now EMACS_INT, not int.
10981 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10982 (esprintf, exprintf, evxprintf): New decls.
10983 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10984
10985 * dbusbind.c (signature_cat): New function.
10986 (xd_signature, Fdbus_register_signal):
10987 Do not overrun buffer; instead, report string overflow.
10988
10989 * dispnew.c (add_window_display_history): Don't overrun buffer.
10990 Truncate instead; this is OK since it's just a log.
10991
10992 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10993 even if the time zone offset is outlandishly large.
10994 Don't mishandle offset == INT_MIN.
10995
10996 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10997 when creating daemon; the previous buffer-overflow check was incorrect.
10998
10999 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11000 which has the guts of the old verror function.
11001
11002 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11003 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11004
11005 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11006 (font_unparse_xlfd): Don't blindly alloca long strings.
11007 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11008 fits in int, when using sprintf. Use single snprintf to count
11009 length of string rather than counting it via multiple sprintfs;
11010 that's simpler and more reliable.
11011 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11012 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11013 sprintf, in case result does not fit in int.
11014
11015 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11016 (fontset_from_font): Print it.
11017
11018 * frame.c (tty_frame_count): Now printmax_t, not int.
11019 (make_terminal_frame, set_term_frame_name): Print it.
11020 (x_report_frame_params): In X, window IDs are unsigned long,
11021 not signed long, so print them as unsigned.
11022 (validate_x_resource_name): Check for implausibly long names,
11023 and don't assume name length fits in 'int'.
11024 (x_get_resource_string): Don't blindly alloca invocation name;
11025 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11026 not fit in int.
11027
11028 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11029 (xg_check_special_colors, xg_set_geometry):
11030 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11031
11032 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11033 Use esprintf, not sprintf, in case result does not fit in int.
11034
11035 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11036 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11037 it as a large positive number.
11038 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11039 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11040
11041 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11042 in case result does not fit in int.
11043
11044 * print.c (float_to_string): Detect width overflow more reliably.
11045 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11046 buffer overrun. Don't assume list length fits in 'int'. Treat
11047 print length of 0 as 0, not as infinity; to be consistent with other
11048 uses of print length in this function. Don't overflow print length
11049 index. Don't assume hash table size fits in 'long', or that
11050 vectorlike size fits in 'unsigned long'.
11051
11052 * process.c (make_process): Use printmax_t, not int, to format
11053 process-name gensyms.
11054
11055 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11056
11057 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11058 to avoid potential buffer overrun.
11059
11060 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11061 if X resource line is longer than 512 bytes.
11062
11063 * xfns.c (x_window): Make sprintf buffer a bit bigger
11064 to avoid potential buffer overrun.
11065
11066 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11067
11068 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11069
11070 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11071
11072 Integer overflow fixes for scrolling, etc.
11073 Without these, Emacs silently mishandles large integers sometimes.
11074 For example, "C-u 4294967297 M-x recenter" was treated as if
11075 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11076
11077 * xdisp.c (try_window_id): Check Emacs fixnum range before
11078 converting to 'int'.
11079
11080 * window.c (window_scroll_line_based, Frecenter):
11081 Check that an Emacs fixnum is in range before assigning it to 'int'.
11082 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11083 values converted from Emacs fixnums.
11084 (Frecenter): Don't wrap around a line count if it is out of 'int'
11085 range; instead, treat it as an extreme value.
11086 (Fset_window_configuration, compare_window_configurations):
11087 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11088
11089 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11090 that can exceed INT_MAX. Check that EMACS_INT value is in range
11091 before assigning it to the (possibly-narrower) index.
11092 (match_limit): Don't assume that a fixnum can fit in 'int'.
11093
11094 * print.c (print_object): Use ptrdiff_t, not int, for index that can
11095 exceed INT_MAX.
11096
11097 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11098 (Fvertical_motion): Don't wrap around LINES values that don't fit
11099 in 'int'. Instead, treat them as extreme values. This is good
11100 enough for windows, which can't have more than INT_MAX lines anyway.
11101
11102 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11103
11104 * Require libxml/parser.h to avoid compilation warning.
11105
11106 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11107
11108 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11109 since this reportedly can destroy thread storage.
11110
11111 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
11112
11113 * syntax.c (find_defun_start): Update all cache variables if
11114 exiting early (Bug#9401).
11115
11116 2011-08-30 Eli Zaretskii <eliz@gnu.org>
11117
11118 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11119
11120 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11121 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11122 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11123
11124 * term.c (tty_append_glyph): New function.
11125 (produce_stretch_glyph): Static function and its prototype deleted.
11126
11127 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11128 Add prototypes.
11129
11130 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11131
11132 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11133 when checking :margin (Bug#9390).
11134 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11135 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11136 so that the name doesn't mislead. All uses changed.
11137
11138 2011-08-28 Johan Bockgård <bojohan@gnu.org>
11139
11140 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11141 set_tty_hooks.
11142
11143 2011-08-27 Eli Zaretskii <eliz@gnu.org>
11144
11145 * xdisp.c (move_it_to): Don't bail out early when reaching
11146 position beyond to_charpos, if we are scanning backwards.
11147 (move_it_vertically_backward): When DY == 0, make sure we get to
11148 the first character in the line after the newline.
11149
11150 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11151
11152 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11153 (ccl_driver): Do not generate an out-of-range pointer.
11154 (Fccl_execute_on_string): Remove unnecessary check for
11155 integer overflow, noted by Stefan Monnier in
11156 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11157 Remove a FIXME that didn't need fixing.
11158 Simplify the newly-introduced buffer reallocation code.
11159
11160 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
11161
11162 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11163
11164 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
11165
11166 Integer and memory overflow issues (Bug#9196).
11167
11168 * doc.c (get_doc_string): Rework so that
11169 get_doc_string_buffer_size is the actual buffer size, rather than
11170 being 1 less than the actual buffer size; this makes xpalloc more
11171 convenient.
11172
11173 * image.c (x_allocate_bitmap_record, cache_image):
11174 * xselect.c (Fx_register_dnd_atom):
11175 Simplify previous changes by using xpalloc.
11176
11177 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11178 since either will do and ptrdiff_t is convenient with xpalloc.
11179
11180 * charset.c (charset_table_size)
11181 (struct charset_sort_data.priority): Now ptrdiff_t.
11182 (charset_compare): Don't overflow if priorities differ greatly.
11183 (Fsort_charsets): Don't assume list length fits in int.
11184 Check for size-calculation overflow when allocating sort data.
11185 (syms_of_charset): Allocate an initial charset table that is
11186 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11187
11188 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11189
11190 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11191 The actual value is always <= INT_MAX, and leaving it unsigned made
11192 overflow checking harder.
11193
11194 * dispextern.h (struct glyph_matrix.rows_allocated)
11195 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11196 with xpalloc. The values are still always <= INT_MAX.
11197
11198 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11199
11200 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11201 (SAFE_NALLOCA): New macro.
11202
11203 * region-cache.c (struct boundary.pos, find_cache_boundary)
11204 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11205 (set_cache_region, invalidate_region_cache)
11206 (revalidate_region_cache, know_region_cache, region_cache_forward)
11207 (region_cache_backward, pp_cache):
11208 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11209 so that ptrdiff_t * can be passed to xpalloc.
11210 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11211 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11212 (pp_cache): Don't assume cache_len fits in int.
11213 * region-cache.h: Adjust extern decls to match.
11214
11215 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11216 EMACS_INT, since either will do, for xpalloc.
11217
11218 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11219 (xnmalloc, xnrealloc, xpalloc): New functions.
11220
11221 * bidi.c (bidi_shelve_header_size): New constant.
11222 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11223 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11224
11225 * bidi.c (bidi_cache_shrink):
11226 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11227 (overlay_strings):
11228 Don't update size of array until after memory allocation succeeds,
11229 because xmalloc/xrealloc may not return.
11230 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11231 now that we have proper integer overflow checking.
11232 (record_overlay_string, overlay_strings): Catch overflows when
11233 calculating size of overlay_str_buf.
11234
11235 * callproc.c (Fcall_process): Check for size overflow when
11236 calculating size of args2.
11237 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11238 Normally we prefer signed values, but sticking with ptrdiff_t would
11239 require adding more-complicated checks.
11240
11241 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11242 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11243 Redo buffer-overflow calculations to avoid integer overflow.
11244 Add a FIXME comment where memory seems to be over-allocated.
11245
11246 * character.c (Fstring): Check for size-calculation overflow.
11247
11248 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11249 unnecessary integer overflow. Check for size overflow.
11250 (encode_coding_object): Don't update size until xmalloc succeeds.
11251
11252 * composite.c (get_composition_id): Check for overflow in glyph
11253 length calculations.
11254
11255 Integer and memory overflow fixes for display code.
11256 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11257 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11258 (scrolling_window): Check for overflow in size calculations.
11259 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11260 Don't assume glyph table len fits in int.
11261 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11262 (row_table_size): Now ptrdiff_t, not int.
11263 (scrolling_window): Avoid overflow in size calculations.
11264 Don't update size until allocation succeeds.
11265 * fns.c (concat): Check for overflow in size calculations.
11266 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11267 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11268 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11269
11270 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11271 (get_doc_string): Check for size calculation overflow.
11272 Don't update size until allocation succeeds.
11273 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11274 EMACS_INT, where ptrdiff_t will do.
11275 (Fsubstitute_command_keys): Check for string overflow.
11276
11277 * editfns.c (set_time_zone_rule): Don't assume environment length
11278 fits in int.
11279 (message_length): Now ptrdiff_t, not int.
11280 (Fmessage_box): Don't update size until allocation succeeds.
11281 Don't assume message length fits in int.
11282 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11283
11284 * emacs.c (main): Do not reallocate argv, since there is a null at
11285 the end that can be overwritten, and this way there's no need to
11286 worry about size-calculation overflow.
11287 (sort_args): Check for size-calculation overflow.
11288
11289 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11290 alloc succeeds.
11291 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11292
11293 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11294 (x_set_scroll_bar_width, x_figure_window_size):
11295 Check for integer overflow.
11296 (x_set_alpha): Do not assume XINT fits in int.
11297
11298 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11299 This is for the members text_lines, text_cols, total_lines, total_cols,
11300 where the system imposes an 'int' limit.
11301
11302 * fringe.c (Fdefine_fringe_bitmap):
11303 Don't update size until alloc works.
11304
11305 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11306 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11307
11308 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11309 Check for size-calculation overflow.
11310 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11311 do, as we prefer signed integers.
11312 (id_to_widget.max_size, id_to_widget.used)
11313 (xg_store_widget_in_map, xg_remove_widget_from_map)
11314 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11315 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11316 Use and return ptrdiff_t, not int.
11317 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11318 * gtkutil.h: Change prototypes to match the above.
11319
11320 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11321 are duplicate now that they've been promoted to lisp.h.
11322 (x_allocate_bitmap_record, x_alloc_image_color)
11323 (make_image_cache, cache_image, xpm_load):
11324 Don't update size until alloc is done.
11325 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11326 (x_detect_edges):
11327 Check for size calculation overflow.
11328 (ct_colors_allocated_max): New constant.
11329 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11330 overflow.
11331
11332 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11333 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11334 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11335 Use ptrdiff_t, not int, to count maps.
11336 (read_char_minibuf_menu_prompt): Check for overflow in size
11337 calculations. Don't update size until allocation succeeds.
11338 Redo calculations to avoid overflow.
11339 * keyboard.h: Change prototypes to match the above.
11340
11341 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11342 to count maps.
11343 (current_minor_maps): Check for size calculation overflow.
11344 * keymap.h: Change prototypes to match the above.
11345
11346 * lread.c (read1, init_obarray): Don't update size until alloc done.
11347
11348 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11349 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11350
11351 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11352 Now ptrdiff_t, not int.
11353 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11354 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11355
11356 * process.c (Fnetwork_interface_list): Check for overflow
11357 in size calculation.
11358
11359 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11360
11361 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11362 overflow. Don't bother calling xmalloc when xrealloc will do.
11363
11364 * search.c (Freplace_match): Check for size calculation overflow.
11365 (Fset_match_data): Don't assume list lengths fit in 'int'.
11366
11367 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11368 for command line length. Do not attempt to address one before the
11369 beginning of an array, as that's not portable.
11370
11371 * term.c (max_frame_lines): Remove; unused.
11372 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11373 not int.
11374 (encode_terminal_code, calculate_costs): Check for size
11375 calculation overflow.
11376 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11377 table lengths and related sizes. Don't update size until alloc
11378 done. Redo calculations to avoid overflow.
11379 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11380
11381 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11382 subtracting pointers.
11383 (gobble_line): Check for overflow more carefully. Don't update size
11384 until alloc done.
11385
11386 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11387 Don't update size until alloc done.
11388 Redo size calculations to avoid overflow.
11389 Check for size calculation overflow.
11390 (main) [DEBUG]: Fix typo in invoking tparam1.
11391
11392 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11393 Use ptrdiff_t, not int, for sizes.
11394 (store_mode_line_noprop_char): Don't update size until alloc done.
11395
11396 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11397 Use ptrdiff_t, not int, for sizes.
11398 (Finternal_make_lisp_face, cache_face):
11399 Check for size calculation overflow.
11400 (cache_face): Treat size calculation overflows as if they were
11401 memory exhaustion (the usual treatment), rather than aborting.
11402
11403 * xfns.c (x_encode_text, x_set_name_internal)
11404 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11405 sizes, since they can exceed INT_MAX in size. Check for size
11406 calculation overflow.
11407
11408 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11409 (xg_select): Check for size calculation overflow.
11410 Don't update size until alloc done.
11411
11412 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11413 as sprintf is limited to int lengths.
11414
11415 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11416 (X_LONG_MIN): New macros.
11417 Use them to make the following changes clearer.
11418 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11419 This change doesn't affect the value now, but it may help remind
11420 future maintainers not to raise the value too much later.
11421 (SELECTION_QUANTUM): Remove, replacing with ...
11422 (selection_quantum): ... new function, which avoids overflow.
11423 All uses changed.
11424 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11425 assumption that selection length fits in 'int'.
11426 (x_reply_selection_request, x_handle_selection_request)
11427 (x_get_window_property, receive_incremental_selection)
11428 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11429 (lisp_data_to_selection_data, clean_local_selection_data):
11430 Use ptrdiff_t, not int, to record length of selection.
11431 (x_reply_selection_request, x_get_window_property)
11432 (receive_incremental_selection, x_property_data_to_lisp):
11433 Redo calculations to avoid overflow.
11434 (x_reply_selection_request): When sending hint, ceiling it at
11435 X_LONG_MAX rather than relying on wraparound overflow to send
11436 something.
11437 (x_get_window_property, receive_incremental_selection)
11438 (lisp_data_to_selection_data, x_property_data_to_lisp):
11439 Check for size-calculation overflow.
11440 (x_get_window_property, receive_incremental_selection)
11441 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11442 Don't store size until memory allocation succeeds.
11443 (x_get_window_property): Plug memory leak on memory exhaustion.
11444 Don't double-block input; malloc is safe here. Don't assume 2**34
11445 - 4 fits in unsigned long. Add an xassert to check
11446 XGetWindowProperty overflow. Be more careful about overflow
11447 calculations, and distinguish size from memory overflow better.
11448 (receive_incremental_selection): When tracing, don't assume
11449 unsigned int is less than INT_MAX.
11450 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11451 harmful) conversions of unsigned short to int.
11452 (lisp_data_to_selection_data): Don't assume that integers
11453 in the range -65535 through -1 fit in an X unsigned short.
11454 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11455 result parameters unless successful. Rely on cons_to_unsigned
11456 to report problems with elements; the old code wasn't right anyway.
11457 (x_check_property_data): Check for int overflow; we cannot use
11458 a wider type due to X limits.
11459 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11460
11461 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11462
11463 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11464 (x_term_init): Check for size calculation overflow.
11465 (x_color_cells): Don't store size until memory allocation succeeds.
11466 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11467 Don't assume alloca size is less than MAX_ALLOCA.
11468 (x_term_init): Don't assume length fits in int (sprintf is limited
11469 to int size).
11470
11471 Use ptrdiff_t for composition IDs.
11472 * character.c (lisp_string_width):
11473 * composite.c (composition_table_size, n_compositions)
11474 (get_composition_id, composition_gstring_from_id):
11475 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11476 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11477 * window.c (Frecenter):
11478 Use ptrdiff_t, not int, for composition IDs.
11479 * composite.c (get_composition_id): Check for integer overflow.
11480 * composite.h: Adjust prototypes to match the above changes.
11481
11482 Use ptrdiff_t for hash table indexes.
11483 * category.c (hash_get_category_set):
11484 * ccl.c (ccl_driver):
11485 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11486 * coding.c (coding_system_charset_list, detect_coding_system):
11487 * coding.h (struct coding_system.id):
11488 * composite.c (get_composition_id, gstring_lookup_cache):
11489 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11490 * image.c (xpm_get_color_table_h):
11491 * lisp.h (hash_lookup, hash_put):
11492 * minibuf.c (Ftest_completion):
11493 Use ptrdiff_t for hash table indexes, not int (which is too
11494 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11495 32-bit --with-wide-int hosts).
11496
11497 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11498 Add a FIXME comment about memory leaks.
11499 (syms_of_charset): Don't assume xmalloc returns.
11500
11501 Don't assume that stated character widths fit in int.
11502 * character.c (Fchar_width, c_string_width, lisp_string_width):
11503 * character.h (CHAR_WIDTH):
11504 * indent.c (MULTIBYTE_BYTES_WIDTH):
11505 Use sanitize_char_width to avoid undefined and/or bad behavior
11506 with outlandish widths.
11507 * character.h (sanitize_tab_width): Rename from sanitize_width,
11508 now that we have two such functions. All uses changed.
11509 (sanitize_char_width): New inline function.
11510
11511 Don't assume that tab-width fits in int.
11512 * character.h (sanitize_width): New inline function.
11513 (SANE_TAB_WIDTH): New macro.
11514 (ASCII_CHAR_WIDTH): Use it.
11515 * indent.c (sane_tab_width): Remove. All uses replaced by
11516 SANE_TAB_WIDTH (current_buffer).
11517 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11518
11519 * fileio.c: Integer overflow issues with file modes.
11520 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11521
11522 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11523 Remove unreachable code.
11524 (read_hex, load_charset_map_from_file): Check for integer overflow.
11525
11526 * xterm.c: Don't go over XClientMessageEvent limit.
11527 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11528 (x_send_scroll_bar_event): Likewise. Check that the size does not
11529 exceed limits imposed by XClientMessageEvent, as well as the usual
11530 ptrdiff_t and size_t limits.
11531
11532 * keyboard.c: Overflow, signedness and related fixes.
11533 (make_lispy_movement): Use same integer type in forward decl
11534 that is used in the definition.
11535 (read_key_sequence, keyremap_step):
11536 Change bufsize argument back to int, undoing my 2011-03-30 change.
11537 We prefer signed types, and int is wide enough here.
11538 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11539 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11540 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11541 length, not size_t. Use ptrdiff_t for index, not int.
11542 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11543 possibility of integer overflow.
11544
11545 Overflow, signedness and related fixes for images.
11546
11547 * dispextern.h (struct it.stack[0].u.image.image_id)
11548 (struct_it.image_id, struct image.id, struct image_cache.size)
11549 (struct image_cache.used, struct image_cache.ref_count):
11550 * gtkutil.c (update_frame_tool_bar):
11551 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11552 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11553 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11554 * nsmenu.m (update_frame_tool_bar):
11555 * xdisp.c (calc_pixel_width_or_height):
11556 * xfns.c (image_cache_refcount):
11557 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11558 on typical 64-bit hosts.
11559
11560 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11561 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11562 Omit unnecessary casts to int.
11563 (parse_image_spec): Check that integers fall into 'int' range
11564 when the callers expect that.
11565 (image_ascent): Redo ascent calculation to avoid int overflow.
11566 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11567 (lookup_image): Remove unnecessary tests.
11568 (xbm_image_p): Locals are now of int, not EMACS_INT,
11569 since parse_image_check makes sure they fit into int.
11570 (png_load, gif_load, svg_load_image):
11571 Prefer int to unsigned where either will do.
11572 (tiff_handler): New function, combining the cores of the
11573 old tiff_error_handler and tiff_warning_handler.
11574 This function is rewritten to use vsnprintf and thereby avoid
11575 stack buffer overflows. It uses only the features of vsnprintf
11576 that are common to both POSIX and native Microsoft.
11577 (tiff_error_handler, tiff_warning_handler): Use it.
11578 (tiff_load, gif_load, imagemagick_load_image):
11579 Don't assume :index value fits in 'int'.
11580 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11581 (imagemagick_load_image): Check that crop parameters fit into
11582 the integer types that MagickCropImage accepts. Don't assume
11583 Vimagemagick_render_type has a nonnegative value. Don't assume
11584 size_t fits in 'long'.
11585 (gs_load): Use printmax_t to print the widest integers possible.
11586 Check for integer overflow when computing image height and width.
11587
11588 2011-08-26 Eli Zaretskii <eliz@gnu.org>
11589
11590 * xdisp.c (redisplay_window): Don't force window start if point
11591 will be invisible in the resulting window. (Bug#9324)
11592
11593 2011-08-25 Eli Zaretskii <eliz@gnu.org>
11594
11595 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11596 the display spec is of the form `(space ...)'.
11597 (handle_display_spec): Return the value returned by
11598 handle_single_display_spec, not just 1 or zero.
11599 (handle_single_display_spec): If the display spec is of the form
11600 `(space ...)', and specifies display in the text area, return 2
11601 rather than 1.
11602 (try_cursor_movement): Check for the need to scroll more
11603 accurately, and prefer exact match for point under bidi.
11604 Don't advance `row' beyond the last row of the window.
11605
11606 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11607 into disp_prop; all users changed.
11608
11609 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11610 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11611 for the text covered by the display property.
11612
11613 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
11614
11615 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11616 Change return value to nil.
11617 (Frecord_buffer): Delete unused function.
11618
11619 2011-08-24 Eli Zaretskii <eliz@gnu.org>
11620
11621 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11622 buffers, return left-to-right.
11623 (set_cursor_from_row): Consider candidate row a win if its glyph
11624 represents a newline and point is on that newline. Fixes cursor
11625 positioning on the newline at EOL of R2L text within L2R
11626 paragraph, and vice versa.
11627 (try_cursor_movement): Check continued rows, in addition to
11628 continuation rows. Fixes unwarranted scroll when point enters a
11629 continued line of R2L text within an L2R paragraph, or vice versa.
11630 (cursor_row_p): Consider the case of point being equal to
11631 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11632 from the end of a short line to the beginning of a continued line
11633 of R2L text within L2R paragraph.
11634 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11635 composed characters.
11636
11637 * bidi.c (bidi_check_type): Use xassert.
11638 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11639 members.
11640
11641 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11642
11643 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11644 a character.
11645
11646 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
11647
11648 * nsfont.m (ns_otf_to_script): Fix typo.
11649
11650 2011-08-22 Kenichi Handa <handa@m17n.org>
11651
11652 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11653 extra slot even if the purpose is char-code-property-table.
11654
11655 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11656
11657 * xdisp.c (redisplay_window): When computing centering_position,
11658 account for the height of the header line. (Bug#8874)
11659
11660 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11661 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11662 candidate is selected by the mouse, and that candidate has a
11663 composed character under the mouse.
11664
11665 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11666 coordinates reported by pos-visible-in-window-p for a composed
11667 character in column zero.
11668
11669 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11670
11671 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11672
11673 2011-08-22 Eli Zaretskii <eliz@gnu.org>
11674
11675 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11676 consider it a hit if to_charpos is anywhere in the range of the
11677 composed buffer positions.
11678
11679 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
11680
11681 * image.c (gif_load): Don't assume that each subimage has the same
11682 dimensions as the base image. Handle disposal method that is
11683 "undefined" by the gif spec (Bug#9335).
11684
11685 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
11686
11687 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11688 (Fcondition_case): Document `debug' symbol in error handler.
11689
11690 2011-08-19 Eli Zaretskii <eliz@gnu.org>
11691
11692 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11693 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11694 from an Org mode buffer to a Speedbar frame.
11695
11696 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11697 a composition, take its buffer position from IT->cmp_it.charpos.
11698 Fixes cursor positioning at the beginning of a line that begins
11699 with a composed character.
11700
11701 2011-08-18 Eli Zaretskii <eliz@gnu.org>
11702
11703 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11704 character bidirectional type, use STRONG_L instead. Fixes crashes
11705 in a buffer produced by `describe-categories'.
11706
11707 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11708 members before the level stack, so they would be saved and
11709 restored when copying iterator state. Fixes incorrect reordering
11710 around TABs covered by display properties.
11711
11712 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11713
11714 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11715
11716 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
11717
11718 * eval.c (internal_condition_case, internal_condition_case_1)
11719 (internal_condition_case_2, internal_condition_case_n):
11720 Remove unnecessary aborts (Bug#9081).
11721
11722 2011-08-17 Eli Zaretskii <eliz@gnu.org>
11723
11724 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11725 has no `load' handler, try opening the file locally. (Bug#9311)
11726
11727 2011-08-16 Ken Brown <kbrown@cornell.edu>
11728
11729 * gmalloc.c: Expand comment.
11730
11731 2011-08-16 Eli Zaretskii <eliz@gnu.org>
11732
11733 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11734 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11735
11736 2011-08-16 Ken Brown <kbrown@cornell.edu>
11737
11738 Fix memory allocation problems in Cygwin build (Bug#9273).
11739
11740 * unexcw.c ( __malloc_initialized): Declare external variable.
11741 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11742
11743 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11744 New variables.
11745 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11746 dumped emacs.
11747 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11748 in the static heap.
11749 [CYGWIN] (special_realloc): New function.
11750 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11751 requests to realloc storage in the static heap.
11752
11753 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11754
11755 * bidi.c (bidi_initialize): Remove unused local.
11756
11757 2011-08-15 Eli Zaretskii <eliz@gnu.org>
11758
11759 * bidimirror.h:
11760 * biditype.h: Remove file.
11761 * makefile.w32-in ($(BLD)/bidi.$(O)):
11762 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11763
11764 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11765
11766 * chartab.c: Improve commentary for the uniprop_table API.
11767
11768 * bidi.c (bidi_paragraph_init): Support zero value of
11769 bidi_ignore_explicit_marks_for_paragraph_level.
11770 (bidi_initialize): Use uniprop_table instead of including
11771 biditype.h and bidimirror.h.
11772
11773 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11774 coordinates of the iterator when restoring from ppos_it.
11775 (Bug#9296)
11776
11777 2011-08-14 Kenichi Handa <handa@m17n.org>
11778
11779 * process.c (create_process): Call setup_process_coding_systems
11780 after the pid of the process is set to -1 (Bug#8162).
11781
11782 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11783
11784 * xdisp.c (move_it_in_display_line_to): Don't invoke
11785 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11786 ppos_it. Fixes vertical cursor motion when line beginning is
11787 covered by an image. (Bug#9296)
11788
11789 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11790
11791 * nsterm.h (ns_run_ascript): Declare.
11792 (NSAPP_DATA2_RUNASSCRIPT): Define.
11793
11794 * nsfns.m (as_script, as_result, as_status): New static variables.
11795 (ns_run_ascript): New function.
11796 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11797 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11798 the event loop. Get status from as_status (Bug#7276).
11799
11800 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11801 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11802 the event loop (Bug#7276).
11803
11804 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11805
11806 * gnutls.c (QCgnutls_bootprop_priority)
11807 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11808 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11809 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11810 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11811 (QCgnutls_bootprop_verify_hostname_error)
11812 (QCgnutls_bootprop_callbacks_verify): Rename from
11813 Qgnutls_bootprop_..., all uses changed.
11814
11815 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11816 uses changed.
11817
11818 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11819
11820 * xfaces.c (Qframe_set_background_mode): Now static.
11821 * dispextern.h (Qframe_set_background_mode): Remove decl.
11822
11823 * process.c (Fnetwork_interface_info): Declare local only if needed.
11824
11825 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11826
11827 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11828 (Fnetwork_interface_list): Allocate in increments of bytes instead
11829 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11830 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11831 sockaddr.
11832 (struct ifflag_def): notrailers is smart on OSX.
11833 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11834 Get hardware address with getifaddrs if available.
11835
11836 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11837
11838 * xdisp.c (iterate_out_of_display_property): xassert that
11839 IT->position is set to within IT->object's boundaries. Break from
11840 the loop as soon as EOB is reached; avoids infloops in redisplay
11841 when IT->position is set up wrongly due to some bug.
11842 Set IT->current to match the bidi iterator unconditionally.
11843 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11844 entry. Force push_it to save on the stack the current
11845 buffer/string position, to be restored by pop_it. Fix flags in
11846 the iterator structure wrt the object coming from a display
11847 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11848 properties. (Bug#9284)
11849
11850 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11851
11852 * fontset.c (fontset_get_font_group): Add proper type checks.
11853 (Bug#9172)
11854
11855 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11856
11857 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11858 and LC_VERSION_MIN_MACOSX.
11859 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11860 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11861
11862 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11863
11864 * xdisp.c (forward_to_next_line_start): Allow to use the
11865 no-display-properties-and-no-overlays under bidi display.
11866 Set disp_pos in the bidi iterator to avoid searches for display
11867 properties and overlays.
11868
11869 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11870
11871 * editfns.c (Fset_time_zone_rule): Document relationship with the
11872 setenv function.
11873
11874 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11875 the font entity extracted from the cache (Bug#8109).
11876
11877 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11878
11879 * composite.c (autocmp_chars): Don't reset point. That is done by
11880 restore_point_unwind (Bug#5984).
11881
11882 2011-08-07 Juri Linkov <juri@jurta.org>
11883
11884 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11885 to show the arg `TIME' instead of `TIMEVAL'.
11886
11887 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11888
11889 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11890 display property strides EOL and includes a newline, as in
11891 longlines-mode. (Bug#9254)
11892 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11893 word-wrap under bidirectional display. (Bug#9224)
11894
11895 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11896 is non-zero, even if the data buffer is NULL. Fixes a crash in
11897 vertical-motion with longlines-mode. (Bug#9254)
11898
11899 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11900
11901 * bidi.c <bidi_cache_total_alloc>: Now static.
11902 (bidi_initialize): Initialize bidi_cache_total_alloc.
11903
11904 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11905 cache. (Bug#9221)
11906
11907 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11908 amount allocated this far in `bidi_cache_total_alloc'.
11909 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11910 non-zero, only free the data buffer without restoring the cache
11911 contents. All callers changed.
11912
11913 * dispextern.h (bidi_unshelve_cache): Update prototype.
11914
11915 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11916 (move_it_in_display_line, move_it_to)
11917 (move_it_vertically_backward, move_it_by_lines): Replace the call
11918 to xfree to an equivalent call to bidi_unshelve_cache.
11919 (move_it_in_display_line_to): Fix logic of returning
11920 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11921
11922 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11923
11924 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11925 came from a string character with a `cursor' property. (Bug#9229)
11926
11927 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11928
11929 * Makefile.in (LIB_PTHREAD): New variable.
11930 (LIBES): Add LIB_PTHREAD (Bug#9216).
11931
11932 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11933 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11934
11935 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11936
11937 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11938
11939 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11940
11941 * xterm.c (x_find_topmost_parent): New function.
11942 (x_set_frame_alpha): Find topmost parent window with
11943 x_find_topmost_parent and set the property there also (bug#9181).
11944 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11945
11946 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11947
11948 * callproc.c (Fcall_process): Avoid vfork clobbering
11949 the local vars buffer, coding_systems, current_dir.
11950
11951 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11952
11953 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11954
11955 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11956
11957 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11958 so that it is not optimized away.
11959
11960 * xdisp.c (compute_display_string_pos): Remove unused local.
11961
11962 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11963
11964 Fix slow cursor motion and scrolling in large buffers with
11965 selective display, like Org Mode buffers. (Bug#9218)
11966
11967 * dispextern.h (struct bidi_it): New member disp_prop_p.
11968
11969 * xdisp.c: Remove one-slot cache of display string positions.
11970 (compute_display_string_pos): Accept an additional argument
11971 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11972 for a display string or property. If found, set DISP_PROP_P
11973 non-zero.
11974
11975 * bidi.c (bidi_fetch_char): Accept an additional argument
11976 DISP_PROP_P, and pass it to compute_display_string_pos.
11977 Only handle text covered by a display string if DISP_PROP_P is returned
11978 non-zero. All callers of bidi_fetch_char changed.
11979
11980 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11981
11982 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11983
11984 2010-12-03 Don March <don@ohspite.net>
11985
11986 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11987 last character M-[char] is translated to ESC [char] (bug#7541).
11988
11989 2011-08-02 Kenichi Handa <handa@m17n.org>
11990
11991 * lisp.h (uniprop_table): Extern it.
11992
11993 * chartab.c (uniprop_table): Make it non-static.
11994
11995 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11996
11997 * xdisp.c (forward_to_next_line_start): Accept additional argument
11998 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11999 on the newline.
12000 (reseat_at_next_visible_line_start): Use the bidi iterator state
12001 returned by forward_to_next_line_start to restore the state of
12002 it->bidi_it after backing up to previous newline. (Bug#9212)
12003
12004 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12005
12006 * regex.c (re_comp): Protoize.
12007 (re_exec): Fix return type.
12008 (regexec): Fix type of `ret'. (Bug#9203)
12009
12010 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12011
12012 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12013 This is needed if max-image-size is a floating-point number.
12014
12015 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12016
12017 * print.c (print_object): Print empty symbol as ##.
12018
12019 * lread.c (read1): Read ## as empty symbol.
12020
12021 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12022
12023 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12024 setting frame foreground color (Bug#9175).
12025 (x_set_background_color): Likewise.
12026
12027 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12028 contents (Bug#9176).
12029 (EmacsTooltip -init): Remove bezels and add shadows to
12030 tooltip windows.
12031
12032 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12033 or scroll bar (Bug#8470).
12034
12035 * nsfont.m (nsfont_open): Remove assignment to voffset and
12036 unnecessary vars hshink, expand, hd, full_height, min_height.
12037 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12038
12039 * nsterm.h (nsfont_info): Remove voffset field.
12040
12041 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12042
12043 Implement strike-through and overline on NextStep (Bug#8863).
12044
12045 * nsfont.m (nsfont_open): Use underline position provided by font,
12046 instead of hard-coded value of 2.
12047 (nsfont_draw): Call ns_draw_text_decoration instead.
12048
12049 * nsterm.h: Add declaration for ns_draw_text_decoration.
12050
12051 * nsterm.m (ns_draw_text_decoration): New function for drawing
12052 underline, overline, and strike-through.
12053 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12054 ns_draw_text_decoration. Change treatment of cursor drawing to
12055 accommodate underlining, etc.
12056
12057 2011-07-28 Eli Zaretskii <eliz@gnu.org>
12058
12059 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12060 default.
12061
12062 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12063
12064 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12065 Without this fix, if a signal arrives just after memory fills up,
12066 'malloc' might be invoked reentrantly.
12067
12068 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12069 In other words, assume that every image size is allowed, on non-X
12070 hosts. This assumption is probably wrong, but it lets Emacs compile.
12071
12072 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12073
12074 * regex.c (re_iswctype): Convert return values to boolean.
12075
12076 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12077
12078 * xdisp.c (compute_display_string_pos): Don't use cached display
12079 string position if the buffer had its restriction changed.
12080 (Bug#9184)
12081
12082 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12083
12084 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12085
12086 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12087
12088 Integer signedness and overflow and related fixes. (Bug#9079)
12089
12090 * bidi.c: Integer size and overflow fixes.
12091 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12092 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12093 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12094 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12095 (bidi_find_other_level_edge):
12096 Use ptrdiff_t instead of EMACS_INT where either will do.
12097 This works better on 32-bit hosts configured --with-wide-int.
12098 (bidi_cache_ensure_space): Check for size-calculation overflow.
12099 Use % rather than repeated addition, for better worst-case speed.
12100 Don't set bidi_cache_size until after xrealloc returns, because it
12101 might not return.
12102 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12103 (bidi_cache_ensure_space): Also check that the bidi cache size
12104 does not exceed that of the largest Lisp string or buffer. See Eli
12105 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12106
12107 * alloc.c (__malloc_size_t): Remove.
12108 All uses replaced by size_t. See Andreas Schwab's note
12109 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12110
12111 * image.c: Improve checking for integer overflow.
12112 (check_image_size): Assume that f is nonnull, since
12113 it is always nonnull in practice. This is one less thing to
12114 worry about when checking for integer overflow later.
12115 (x_check_image_size): New function, which checks for integer
12116 overflow issues inside X.
12117 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12118 This removes the need for a memory_full check.
12119 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12120 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12121 (xbm_read_bitmap_data): Change locals back to 'int', since
12122 their values must fit in 'int'.
12123 (xpm_load_image, png_load, tiff_load):
12124 Invoke x_create_x_image_and_pixmap earlier,
12125 to avoid much needless work if the image is too large.
12126 (tiff_load): Treat overly large images as if
12127 x_create_x_image_and_pixmap failed, not as malloc failures.
12128 (gs_load): Use x_check_image_size.
12129
12130 * gtkutil.c: Omit integer casts.
12131 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12132 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12133
12134 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12135
12136 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12137 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12138 would wrongly return t on a 64-bit host.
12139
12140 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12141 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12142 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12143 and therefore cause GCC to emit a bogus diagnostic in some cases.
12144
12145 * image.c: Integer signedness and overflow and related fixes.
12146 This is not an exhaustive set of fixes, but it's time to
12147 record what I've got.
12148 (lookup_pixel_color, check_image_size): Remove redundant decls.
12149 (check_image_size): Don't assume that arbitrary EMACS_INT values
12150 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12151 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12152 (tiff_load, imagemagick_load_image):
12153 Check for overflow in size calculations.
12154 (x_create_x_image_and_pixmap): Remove unnecessary test for
12155 xmalloc returning NULL; that can't happen.
12156 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12157 (xpm_color_bucket): Use better integer hashing function.
12158 (xpm_cache_color): Don't possibly over-allocate memory.
12159 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12160 (gif_memory_source):
12161 Use ptrdiff_t, not int or size_t, to record sizes.
12162 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12163 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12164 either works, as we prefer signed integers.
12165 (tiff_read_from_memory, tiff_write_from_memory):
12166 Return tsize_t, not size_t, since that's what the TIFF API wants.
12167 (tiff_read_from_memory): Don't fail simply because the read would
12168 go past EOF; instead, return a short read.
12169 (tiff_load): Omit no-longer-needed casts.
12170 (Fimagemagick_types): Don't assume size fits into 'int'.
12171
12172 Improve hashing quality when configured --with-wide-int.
12173 * fns.c (hash_string): New function, taken from sxhash_string.
12174 Do not discard information about ASCII character case; this
12175 discarding is no longer needed.
12176 (sxhash-string): Use it. Change sig to match it. Caller changed.
12177 * lisp.h: Declare it.
12178 * lread.c (hash_string): Remove, since we now use fns.c's version.
12179 The fns.c version returns a wider integer if --with-wide-int is
12180 specified, so this should help the quality of the hashing a bit.
12181
12182 * emacs.c: Integer overflow minor fix.
12183 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12184 Define only if GNU_LINUX.
12185 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12186
12187 * dispnew.c: Integer signedness and overflow fixes.
12188 Remove unnecessary forward decls, that were a maintenance hassle.
12189 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12190 All uses changed.
12191 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12192 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12193 (prepare_desired_row, line_draw_cost):
12194 Use int, not unsigned, where either works.
12195 (save_current_matrix, restore_current_matrix):
12196 Use ptrdiff_t, not size_t, where either works.
12197 (init_display): Check for overflow more accurately, and without
12198 relying on undefined behavior.
12199
12200 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12201 Remove, replacing with the new symbols in lisp.h. All uses changed.
12202 * fileio.c (make_temp_name):
12203 * filelock.c (lock_file_1, lock_file):
12204 * xdisp.c (message_dolog):
12205 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12206 Use pMd etc. instead.
12207 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12208 replacing the pWIDE etc. symbols removed from editfns.c.
12209
12210 * keyboard.h (num_input_events): Now uintmax_t.
12211 This is (very slightly) less likely to mess up due to wraparound.
12212 All uses changed.
12213
12214 * buffer.c: Integer signedness fixes.
12215 (alloc_buffer_text, enlarge_buffer_text):
12216 Use ptrdiff_t rather than size_t when either will do, as we prefer
12217 signed integers.
12218
12219 * alloc.c: Integer signedness and overflow fixes.
12220 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12221 (__malloc_size_t): Default to size_t, not to int.
12222 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12223 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12224 Prefer ptrdiff_t to size_t when either would do, as we prefer
12225 signed integers.
12226 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12227 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12228 Now const. Initialize with values that are in range even if char
12229 is signed.
12230 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12231 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12232 These functions do the right thing with sizes > 2**32.
12233 (check_depth): Now ptrdiff_t, not int.
12234 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12235 Adjust to new way of storing sizes. Check for size overflow bugs
12236 in rest of code.
12237 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12238 slightly wrong anyway, as it missed one instance of
12239 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12240 (refill_memory_reserve): Omit needless cast to size_t.
12241 (mark_object_loop_halt): Mark as externally visible.
12242
12243 * xselect.c: Integer signedness and overflow fixes.
12244 (Fx_register_dnd_atom, x_handle_dnd_message):
12245 Use ptrdiff_t, not size_t, since we prefer signed.
12246 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12247 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12248 x_dnd_atoms_size and x_dnd_atoms_length.
12249
12250 * doprnt.c: Prefer signed to unsigned when either works.
12251 * eval.c (verror):
12252 * doprnt.c (doprnt):
12253 * lisp.h (doprnt):
12254 * xdisp.c (vmessage):
12255 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12256 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12257 prefer signed arithmetic to avoid comparison confusion.
12258 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12259 but is a bit tricky.
12260
12261 Assume freestanding C89 headers, string.h, stdlib.h.
12262 * data.c, doprnt.c, floatfns.c, print.c:
12263 Include float.h unconditionally.
12264 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12265 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12266 * regex.c: Likewise for stddef.h, string.h.
12267 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12268 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12269 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12270 (STDC_HEADERS): Remove obsolete defines.
12271 * sysdep.c: Include limits.h unconditionally.
12272
12273 Assume support for memcmp, memcpy, memmove, memset.
12274 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12275 * regex.c (memcmp, memcpy):
12276 Remove; we assume C89 now.
12277
12278 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12279 (__malloc_safe_bcopy): Remove; no longer needed.
12280
12281 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12282 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12283 well either way, and we prefer signed to unsigned.
12284
12285 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12286
12287 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12288 closes the connection while we're reading (bug#9182).
12289
12290 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12291
12292 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12293 are specified (Bug#9168).
12294
12295 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12296
12297 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12298 Found by GCC static checking and --with-wide-int on a 32-bit host.
12299
12300 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12301
12302 * xdisp.c (compute_display_string_pos): Fix logic of caching
12303 previous display string position. Initialize cached_prev_pos to
12304 -1. Fixes slow-down at the beginning of a buffer.
12305
12306 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12307
12308 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12309 for attrs[LFACE_FONTSET_INDEX].
12310
12311 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12312
12313 * xml.c (parse_region): Remove unused local
12314 that was recently introduced.
12315
12316 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12317
12318 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12319 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12320
12321 * xdisp.c (move_it_in_display_line_to): Record the best matching
12322 position for TO_CHARPOS while scanning the line, and restore it on
12323 exit if none of the characters scanned was an exact match.
12324 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12325 when exact match is impossible due to invisible text, and the
12326 lines are truncated.
12327
12328 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12329
12330 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12331 for OSX >= 10.7.
12332
12333 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12334
12335 Fix a significant slow-down of cursor motion with C-n, C-p,
12336 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12337 auto-repeat under bidi redisplay in fontified buffers.
12338 * xdisp.c (compute_stop_pos_backwards): New function.
12339 (next_element_from_buffer): Call compute_stop_pos_backwards to
12340 find a suitable prev_stop when we find ourselves before
12341 base_level_stop.
12342 (reseat): Don't look for prev_stop, as that could mean a very long
12343 run.
12344 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12345 <cached_disp_overlay_modiff>: Cache for last found display string
12346 position.
12347 (compute_display_string_pos): Return the cached position if asked
12348 about the same buffer in the same area of character positions, and
12349 the buffer wasn't changed since the time the display string
12350 position was cached.
12351
12352 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12353
12354 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12355 is an integer, which is important for empty lines. (Bug#9149)
12356
12357 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
12358
12359 * frame.c (Fmodify_frame_parameters): In tty case, update the
12360 default face if necessary (Bug#4238).
12361
12362 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
12363
12364 * editfns.c (Fstring_to_char): No need to explain what a character
12365 is in the docstring (Bug#6576).
12366
12367 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12368
12369 * xml.c (parse_region): Make sure we always return a tree.
12370
12371 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12372
12373 * xml.c (parse_region): If a document contains only comments,
12374 return that, too.
12375
12376 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12377
12378 * xml.c (make_dom): Return comments, too.
12379
12380 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12381
12382 Port to OpenBSD.
12383 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12384 and the surrounding thread.
12385 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12386 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12387 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12388 timer goes off.
12389 * s/openbsd.h (BROKEN_SIGIO): Define.
12390 * unexelf.c (unexec) [__OpenBSD__]:
12391 Don't update the .mdebug section of the Alpha COFF symbol table.
12392
12393 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12394
12395 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12396 (bug#8460).
12397
12398 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12399
12400 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12401 This fixes some race conditions on the permissions of any newly
12402 created file.
12403
12404 * alloc.c (valid_pointer_p): Use pipe, not open.
12405 This fixes some permissions issues when debugging.
12406
12407 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12408 If fchown fails to set both uid and gid, try to set just gid,
12409 as that is sometimes allowed. Adjust the file's mode to eliminate
12410 setuid or setgid bits that are inappropriate if fchown fails.
12411
12412 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12413
12414 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12415 to compare Lisp_Objects.
12416 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12417 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12418 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12419
12420 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12421
12422 * lread.c (read_integer): Unread even EOF character.
12423 (read1): Likewise. Properly record start position of symbol.
12424
12425 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12426 symbol character follows.
12427
12428 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12429
12430 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12431 This works around a problem with the previous change to Fcopy_file.
12432 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12433 and without this change, GCC might complain about discarding
12434 fchown's return value.
12435
12436 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
12437
12438 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12439
12440 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12441
12442 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12443
12444 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12445
12446 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12447 it's used from the C level.
12448
12449 * process.c: Use the same condition for POLL_FOR_INPUT in both
12450 keyboard.c and process.c (bug#1858).
12451
12452 2011-07-09 Lawrence Mitchell <wence@gmx.li>
12453
12454 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12455 (Fgnutls_boot): Use it.
12456
12457 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12458
12459 * doc.c (Fsubstitute_command_keys): Revert last change.
12460
12461 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12462
12463 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12464 quotes the next character, and doesn't affect other longer
12465 sequences (bug#8935).
12466
12467 * lread.c (syms_of_lread): Clarify that is isn't only
12468 `eval-buffer' and `eval-defun' that's affected by
12469 `lexical-binding' (bug#8460).
12470
12471 2011-07-15 Eli Zaretskii <eliz@gnu.org>
12472
12473 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12474 bidi redisplay when a line includes both an image and is truncated.
12475
12476 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12477
12478 Fix minor problems found by static checking.
12479 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12480 (elsz): Now a signed constant, not a size_t var. We prefer signed
12481 types to unsigned, to avoid integer comparison confusion. Without
12482 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12483 "cannot optimize loop, the loop counter may overflow", a symptom
12484 of the confusion.
12485 * indent.c (Fvertical_motion): Mark locals as initialized.
12486 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12487
12488 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12489
12490 * search.c (Fre_search_backward): Mention `case-fold-search' in
12491 all the re_search_* functions (bug#8138).
12492
12493 * keyboard.c (Fopen_dribble_file): Document when the file is
12494 closed (bug#8056).
12495
12496 2011-07-14 Eli Zaretskii <eliz@gnu.org>
12497
12498 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12499 bidi_cache_idx.
12500
12501 Support bidi reordering of display and overlay strings.
12502 * xdisp.c (compute_display_string_pos)
12503 (compute_display_string_end): Accept additional argument STRING.
12504 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12505 (reseat_to_string): Initialize bidi_it->string.s and
12506 bidi_it->string.schars.
12507 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12508 NULL (avoids a crash in bidi_paragraph_init).
12509 Initialize itb.string.lstring.
12510 (init_iterator): Call bidi_init_it only of a valid
12511 buffer position was specified. Initialize paragraph_embedding to
12512 L2R.
12513 (reseat_to_string): Initialize the bidi iterator.
12514 (display_string): If we need to ignore text properties of
12515 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12516 original value of -1 will not work with bidi.)
12517 (compute_display_string_pos): First arg is now struct
12518 `text_pos *'; all callers changed. Support display properties on
12519 Lisp strings.
12520 (compute_display_string_end): Support display properties on Lisp
12521 strings.
12522 (init_iterator, reseat_1, reseat_to_string): Initialize the
12523 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12524 when iterating on a string not from display properties).
12525 (compute_display_string_pos, compute_display_string_end):
12526 Fix calculation of the object to scan. Fixes an error when using
12527 arrow keys.
12528 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12529 base_level_stop; instead, set base_level_stop to BEGV.
12530 Fixes crashes in vertical-motion.
12531 (next_element_from_buffer): Improve commentary for when
12532 the iterator is before prev_stop.
12533 (init_iterator): Initialize bidi_p from the default value of
12534 bidi-display-reordering, not from buffer-local value. Use the
12535 buffer-local value only if initializing for buffer iteration.
12536 (handle_invisible_prop): Support invisible properties on strings
12537 that are being bidi-reordered.
12538 (set_iterator_to_next): Support bidi reordering of C strings and
12539 Lisp strings.
12540 (next_element_from_string): Support bidi reordering of Lisp
12541 strings.
12542 (handle_stop_backwards): Support Lisp strings as well.
12543 (display_string): Support display of R2L glyph rows.
12544 Use IT_STRING_CHARPOS when displaying from a Lisp string.
12545 (init_iterator): Don't initialize it->bidi_p for strings
12546 here.
12547 (reseat_to_string): Initialize it->bidi_p for strings here.
12548 (next_element_from_string, next_element_from_c_string)
12549 (next_element_from_buffer): Add xassert's for correspondence
12550 between IT's object being iterated and it->bidi_it.string
12551 structure.
12552 (face_before_or_after_it_pos): Support bidi iteration.
12553 (next_element_from_c_string): Handle the case of the first string
12554 character that is not the first one in the visual order.
12555 (get_visually_first_element): New function, refactored from common
12556 parts of next_element_from_buffer, next_element_from_string, and
12557 next_element_from_c_string.
12558 (tool_bar_lines_needed, redisplay_tool_bar)
12559 (display_menu_bar): Force left-to-right direction. Add a FIXME
12560 comment for making that be controlled by a user option.
12561 (push_it, pop_it): Save and restore the state of the
12562 bidi iterator. Save and restore the bidi_p flag.
12563 (pop_it): Iterate out of display property for string iteration as
12564 well.
12565 (iterate_out_of_display_property): Support iteration over strings.
12566 (handle_single_display_spec): Set up it->bidi_it for iteration
12567 over a display string, and call bidi_init_it.
12568 (handle_single_display_spec, next_overlay_string)
12569 (get_overlay_strings_1, push_display_prop): Set up the bidi
12570 iterator for displaying display or overlay strings.
12571 (forward_to_next_line_start): Don't use the shortcut if
12572 bidi-iterating.
12573 (back_to_previous_visible_line_start): If handle_display_prop
12574 pushed the iterator stack, restore the internal state of the bidi
12575 iterator by calling bidi_pop_it same number of times.
12576 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12577 and we are bidi-iterating, don't decrement the iterator position;
12578 instead, set the first_elt flag in the bidi iterator, to produce
12579 the same effect.
12580 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12581 (push_display_prop): xassert that we are iterating a buffer.
12582 (push_it, pop_it): Save and restore paragraph_embedding member.
12583 (handle_single_display_spec, next_overlay_string)
12584 (get_overlay_strings_1, reseat_1, reseat_to_string)
12585 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12586 correctly. Don't assume unibyte strings are not bidi-reordered.
12587 (compute_display_string_pos)
12588 (compute_display_string_end): Fix handling the case of C string.
12589 (push_it, pop_it): Save and restore from_disp_prop_p.
12590 (handle_single_display_spec, push_display_prop): Set the
12591 from_disp_prop_p flag.
12592 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12593 (pop_it): Call iterate_out_of_display_property only if we are
12594 popping after iteration over a string that came from a display
12595 property. Fix a typo in popping stretch info. Add an assertion
12596 for verifying that the iterator position is in sync with the bidi
12597 iterator.
12598 (handle_single_display_spec, get_overlay_strings_1)
12599 (push_display_prop): Fix initialization of paragraph direction for
12600 string when that of the parent object is not yet determined.
12601 (reseat_1): Call bidi_init_it to resync the bidi
12602 iterator with IT's position. (Bug#7616)
12603 (find_row_edges): If ROW->start.pos gives position
12604 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12605 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12606 Reset the from_disp_prop_p flag.
12607 (SAVE_IT, RESTORE_IT): New macros.
12608 (pos_visible_p, face_before_or_after_it_pos)
12609 (back_to_previous_visible_line_start)
12610 (move_it_in_display_line_to, move_it_in_display_line)
12611 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12612 (try_scrolling, redisplay_window, display_line): Use them when
12613 saving a temporary copy of the iterator and restoring it back.
12614 (back_to_previous_visible_line_start, reseat_1)
12615 (init_iterator): Empty the bidi cache "stack".
12616 (move_it_in_display_line_to): If iterator ended up at
12617 EOL, but we never saw any buffer positions smaller than
12618 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12619 motion in bidi-reordered lines.
12620 (move_it_in_display_line_to): Record prev_method and prev_pos
12621 immediately before the call to set_iterator_to_next. Fixes cursor
12622 motion in bidi-reordered lines with stretch glyphs and strings
12623 displayed in margins. (Bug#8133) (Bug#8867)
12624 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12625 TO_CHARPOS.
12626 (pos_visible_p): Support positions in bidi-reordered lines.
12627 Save and restore bidi cache.
12628
12629 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12630 (bidi_paragraph_info): Delete unused struct.
12631 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12632 (bidi_cache_start): New variable.
12633 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12634 to zero.
12635 (bidi_cache_fetch_state, bidi_cache_search)
12636 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12637 (bidi_cache_find, bidi_peek_at_next_level)
12638 (bidi_level_of_next_char, bidi_find_other_level_edge)
12639 (bidi_move_to_visually_next): Compare cache index with
12640 bidi_cache_start rather than with zero.
12641 (bidi_fetch_char): Accept new argument STRING; all callers
12642 changed. Support iteration over a string. Support strings with
12643 display properties. Support unibyte strings. Fix the type of
12644 `len' according to what STRING_CHAR_AND_LENGTH expects.
12645 (bidi_paragraph_init, bidi_resolve_explicit_1)
12646 (bidi_resolve_explicit, bidi_resolve_weak)
12647 (bidi_level_of_next_char, bidi_move_to_visually_next):
12648 Support iteration over a string.
12649 (bidi_set_sor_type, bidi_resolve_explicit_1)
12650 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12651 can now be zero (for strings); special values 0 and -1 were
12652 changed to -1 and -2, respectively.
12653 (bidi_char_at_pos): New function.
12654 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12655 Call it instead of FETCH_MULTIBYTE_CHAR.
12656 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12657 initialized to valid values.
12658 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12659 values.
12660 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12661 the test for valid cached positions. Fix the logic for looking up
12662 the sentinel state in the cache. GCPRO the Lisp string we are
12663 iterating.
12664 (bidi_push_it, bidi_pop_it): New functions.
12665 (bidi_initialize): Initialize the bidi cache start stack pointer.
12666 (bidi_cache_ensure_space): New function, refactored from part of
12667 bidi_cache_iterator_state. Don't assume the required size is just
12668 one BIDI_CACHE_CHUNK away.
12669 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12670 (bidi_count_bytes, bidi_char_at_pos): New functions.
12671 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12672 always valid if bidi_cache_idx is valid.
12673 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12674 is valid if it's going to be used.
12675 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12676 (bidi_cache_fetch_state, bidi_cache_search)
12677 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12678 (bidi_cache_iterator_state, bidi_cache_find)
12679 (bidi_find_other_level_edge, bidi_cache_start_stack):
12680 All variables related to cache indices are now EMACS_INT.
12681
12682 * dispextern.h (struct bidi_string_data): New structure.
12683 (struct bidi_it): New member `string'. Make flag members be 1-bit
12684 fields, and put them last in the struct.
12685 (compute_display_string_pos, compute_display_string_end):
12686 Update prototypes.
12687 (bidi_push_it, bidi_pop_it): Add prototypes.
12688 (struct iterator_stack_entry): New members bidi_p,
12689 paragraph_embedding, and from_disp_prop_p.
12690 (struct it): Member bidi_p is now a bit field 1 bit wide.
12691 (bidi_shelve_cache, bidi_unshelve_cache):
12692 Declare prototypes.
12693
12694 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12695 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12696 and vector-like objects.
12697
12698 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12699 cache around display iteration.
12700
12701 * window.c (Fwindow_end, window_scroll_pixel_based)
12702 (displayed_window_lines, Frecenter): Save and restore the bidi
12703 cache around display iteration.
12704
12705 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12706
12707 * editfns.c (Fdelete_region): Clarify the use of the named
12708 parameters (bug#6788).
12709
12710 2011-07-14 Martin Rudalics <rudalics@gmx.at>
12711
12712 * indent.c (Fvertical_motion): Set and restore w->pointm when
12713 saving and restoring the window's buffer (Bug#9006).
12714
12715 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12716
12717 * editfns.c (Fstring_to_char): Clarify just what is returned
12718 (bug#6576). Text by Eli Zaretskii.
12719
12720 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
12721
12722 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12723
12724 2011-07-13 Eli Zaretskii <eliz@gnu.org>
12725
12726 * buffer.c (mmap_find): Fix a typo.
12727
12728 2011-07-13 Johan Bockgård <bojohan@gnu.org>
12729
12730 Fix execution of x selection hooks.
12731 * xselect.c (Qx_lost_selection_functions)
12732 (Qx_sent_selection_functions): New vars.
12733 (syms_of_xselect): DEFSYM them.
12734 (x_handle_selection_request): Pass Qx_sent_selection_functions
12735 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12736 (x_handle_selection_clear,x_clear_frame_selections):
12737 Pass Qx_lost_selection_functions rather than
12738 Vx_lost_selection_functions to Frun_hook_with_args.
12739
12740 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12741
12742 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12743 The old code sometimes used this field without initializing it.
12744
12745 * alloc.c (gc_sweep): Don't read past end of array.
12746 In theory, the old code could also have corrupted Emacs internals,
12747 though it'd be very unlikely.
12748
12749 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12750
12751 * character.c (Fcharacterp): Don't advertise optional ignored
12752 argument. (Bug#4026)
12753
12754 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12755
12756 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12757 key" (bug#4257).
12758
12759 * window.c (Fset_window_start): Doc fix (bug#4199).
12760 (Fset_window_hscroll): Ditto.
12761
12762 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12763
12764 Fix minor new problems caught by GCC 4.6.1.
12765 * term.c (init_tty): Remove unused local.
12766 * xsettings.c (store_monospaced_changed): Define this function only
12767 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12768 not used otherwise.
12769
12770 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
12771
12772 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12773
12774 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12775
12776 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12777 are the mini-buffer and the echo area (bug#3320).
12778
12779 * term.c (init_tty): Remove support for supdup, c10 and perq
12780 terminals, which are no longer supported (bug#1482).
12781
12782 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12783
12784 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12785
12786 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12787
12788 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12789 for non-popups (Bug#3642).
12790
12791 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12792
12793 * alloc.c (reset_malloc_hooks): Protoize.
12794 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12795 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12796 * cm.c (losecursor): Likewise.
12797 * data.c (fmod): Likewise.
12798 * dispnew.c (swap_glyphs_in_rows): Likewise.
12799 * emacs.c (memory_warning_signal): Likewise.
12800 * floatfns.c (float_error): Likewise.
12801 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12802 (otf_open, font_otf_capability, generate_otf_features)
12803 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12804 Likewise.
12805 * image.c (pbm_read_file): Likewise.
12806 * indent.c (string_display_width): Likewise.
12807 * intervals.c (check_for_interval, search_for_interval)
12808 (inc_interval_count, count_intervals, root_interval)
12809 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12810 * lread.c (defalias): Likewise.
12811 * ralloc.c (r_alloc_check): Likewise.
12812 * regex.c (set_image_of_range_1, set_image_of_range)
12813 (regex_grow_registers): Likewise.
12814 * sysdep.c (strerror): Likewise.
12815 * termcap.c (valid_filename_p, tprint, main): Likewise.
12816 * tparam.c (main): Likewise.
12817 * unexhp9k800.c (run_time_remap, save_data_space)
12818 (update_file_ptrs, read_header, write_header, calculate_checksum)
12819 (copy_file, copy_rest, display_header): Likewise.
12820 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12821 Likewise.
12822 * xdisp.c (check_it): Likewise.
12823 * xfaces.c (register_color, unregister_color, unregister_colors):
12824 Likewise.
12825 * xfns.c (print_fontset_result): Likewise.
12826 * xrdb.c (member, fatal, main): Likewise.
12827
12828 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12829
12830 Fix minor problems found by static checking (Bug#9031).
12831 * chartab.c (char_table_set_range, map_sub_char_table):
12832 Remove unused locals.
12833 (uniprop_table): Now static.
12834 * composite.c (_work_char): Remove unused static var.
12835
12836 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12837
12838 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12839
12840 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12841
12842 * gtkutil.c (qttip_cb): Remove code without function.
12843
12844 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12845
12846 * w32.c (pthread_sigmask): New stub.
12847
12848 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12849
12850 Use pthread_sigmask, not sigprocmask (Bug#9010).
12851 sigprocmask is portable only for single-threaded applications, and
12852 Emacs can be multi-threaded when it uses GTK.
12853 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12854 (LIBES): Use it.
12855 * callproc.c (Fcall_process):
12856 * process.c (create_process):
12857 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12858 Use pthread_sigmask, not sigprocmask.
12859
12860 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12861
12862 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12863 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12864 wrong (Bug#8591).
12865
12866 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12867
12868 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12869 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12870 (xg_hide_tooltip): Fix comment.
12871
12872 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12873 in registerServicesMenuSendTypes.
12874 (validRequestorForSendType): Don't check ns_return_types.
12875
12876 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12877 ns_return_type.
12878
12879 2011-07-08 Jason Rumney <jasonr@gnu.org>
12880
12881 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12882 SH_SHOW for hidden windows (Bug#5482).
12883
12884 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12885 frame struct members of non-existent frames (Bug#6284).
12886
12887 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12888
12889 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12890 variable firstTime not needed on OSX >= 10.6.
12891 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12892 >= 10.5. Use setKnobProportion, setDoubleValue.
12893
12894 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12895 (MAC_OS_X_VERSION_10_5): Define if not defined.
12896 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12897 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12898 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12899
12900 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12901 cString and lossyCString on OSX >= 10.4.
12902
12903 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12904 sizeToFit on OSX >= 10.2.
12905
12906 * nsimage.m (allocInitFromFile): Don't use deprecated method
12907 bestRepresentationForDevice on OSX >= 10.6.
12908
12909 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12910 to avoid warning.
12911
12912 * emacs.c: Declare unexec_init_emacs_zone.
12913
12914 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12915
12916 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12917
12918 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12919 on svcsMenu (Bug#8842).
12920
12921 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12922 ns_return_types.
12923 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12924
12925 * nsterm.m (QUTF8_STRING): Declare.
12926 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12927 (validRequestorForSendType): Return type is (id).
12928 Change indexOfObjectIdenticalTo to indexOfObject.
12929 Check if we have local selection before returning self (Bug#8842).
12930 (writeSelectionToPasteboard): Put local selection into paste board
12931 if we have a local selection (Bug#8842).
12932 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12933
12934 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12935 (ns_get_local_selection): Declare.
12936
12937 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12938
12939 * keymap.c (describe_map_tree): Don't insert a double newline at
12940 the end of the buffer (bug#1169) and return whether we inserted
12941 something.
12942
12943 * callint.c (Fcall_interactively): Change "reading args" to
12944 "providing args" to try to clarify what it does (bug#1010).
12945
12946 2011-07-07 Kenichi Handa <handa@m17n.org>
12947
12948 * composite.c (composition_compute_stop_pos): Ignore a static
12949 composition starting before CHARPOS (Bug#8915).
12950
12951 * xdisp.c (handle_composition_prop): Likewise.
12952
12953 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12954
12955 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12956 (Bug#9015)
12957
12958 2011-07-07 Kenichi Handa <handa@m17n.org>
12959
12960 * character.h (unicode_category_t): New enum type.
12961
12962 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12963 (Qchar_code_property_table): New variable.
12964 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12965 (UNIPROP_COMPRESSED_FORM_P): New macros.
12966 (char_table_ascii): Uncompress the compressed values.
12967 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12968 Uncompress the compressed values.
12969 (sub_char_table_ref_and_range): Likewise.
12970 (char_table_ref_and_range): Uncompress the compressed values.
12971 (sub_char_table_set): New arg is_uniprop. Callers changed.
12972 Uncompress the compressed values.
12973 (sub_char_table_set_range): Args changed. Callers changed.
12974 (char_table_set_range): Adjuted for the above change.
12975 (map_sub_char_table): Delete args default_val and parent. Add arg
12976 top. Give decoded values to a Lisp function.
12977 (map_char_table): Adjust for the above change. Give decoded
12978 values to a Lisp function. Gcpro more variables.
12979 (uniprop_table_uncompress)
12980 (uniprop_decode_value_run_length): New functions.
12981 (uniprop_decoder, uniprop_decoder_count): New variables.
12982 (uniprop_get_decoder, uniprop_encode_value_character)
12983 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12984 New functions.
12985 (uniprop_encoder, uniprop_encoder_count): New variables.
12986 (uniprop_get_encoder, uniprop_table)
12987 (Funicode_property_table_internal, Fget_unicode_property_internal)
12988 (Fput_unicode_property_internal): New functions.
12989 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12990 Sunicode_property_table_internal, Sget_unicode_property_internal,
12991 and Sput_unicode_property_internal. Defvar_lisp
12992 char-code-property-alist.
12993
12994 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12995 Vunicode_category_table.
12996
12997 * font.c (font_range): Adjust for the change of
12998 Vunicode_category_table.
12999
13000 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13001
13002 * m/iris4d.h: Remove file, move contents ...
13003 * s/irix6-5.h: ... here.
13004
13005 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13006
13007 Remove unportable assumption about struct layout (Bug#8884).
13008 * alloc.c (mark_buffer):
13009 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13010 (clone_per_buffer_values): Don't assume that
13011 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13012 This isn't true in general, and it's particularly not true
13013 if Emacs is configured with --with-wide-int.
13014 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13015 New macros, used in the buffer.c change.
13016
13017 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13018
13019 * xsettings.c: Use both GConf and GSettings if both are available.
13020 (store_config_changed_event): Add comment.
13021 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13022 (store_tool_bar_style_changed): New functions.
13023 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
13024 (struct xsettings): Move font inside HAVE_XFT.
13025 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13026 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13027 Move inside HAVE_XFT.
13028 (something_changed_gsettingsCB): Rename from something_changedCB.
13029 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13030 also.
13031 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13032 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
13033 (something_changed_gconfCB): Rename from something_changedCB.
13034 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13035 (parse_settings): Move check for font inside HAVE_XFT.
13036 (read_settings, apply_xft_settings): Add comment.
13037 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13038 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13039 call store_font_name_changed.
13040 (xft_settings_event): Add comment.
13041 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13042 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13043 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13044 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13045 (xsettings_initialize): Call init_gsettings last.
13046 (xsettings_get_system_font, xsettings_get_system_normal_font):
13047 Add comment.
13048
13049 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13050
13051 Random fixes. E.g., (random) never returned negative values.
13052 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13053 subseconds part to the entropy, as that's a bit more random.
13054 Prefer signed to unsigned, since the signedness doesn't matter and
13055 in general we prefer signed. When given a limit, use a
13056 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13057 latter isn't right if USE_2_TAGS_FOR_INTS.
13058 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13059 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13060
13061 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13062
13063 * textprop.c (text_property_stickiness):
13064 Obey Vtext_property_default_nonsticky.
13065 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13066 * w32fns.c (syms_of_w32fns):
13067 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13068
13069 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13070
13071 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13072 This is more efficient than Ffile_directory_p and avoids a minor race.
13073
13074 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13075
13076 * buffer.c (Foverlay_put): Say what the return value is
13077 (bug#7835).
13078
13079 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13080 is a directory before asking whether to use the file name
13081 (bug#7564).
13082 (barf_or_query_if_file_exists): Make the "File is a directory"
13083 error be more correct.
13084
13085 * fns.c (Frequire): Remove the mention of the .gz files, since
13086 that's installation-specific, but keep the mention of
13087 `get-load-suffixes'.
13088
13089 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13090
13091 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13092 Report string overflow if the output is too long.
13093
13094 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
13095
13096 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13097 (syms_of_gnutls): Remove duplicate DEFSYM for
13098 Qgnutls_bootprop_verify_hostname_error, an error for
13099 Qgnutls_bootprop_verify_error (which is no longer used).
13100
13101 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13102 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13103 Also (re)move comments that are misplaced or no longer relevant.
13104
13105 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13106
13107 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13108
13109 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
13110
13111 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13112 and background color parameters if they have been changed.
13113
13114 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13115
13116 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13117
13118 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13119
13120 * xsettings.c (SYSTEM_FONT): Define only when used.
13121 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13122
13123 * keymap.c (access_keymap_1): Now static.
13124
13125 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
13126
13127 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13128 leave any prefix arg for the up event (Bug#1586).
13129
13130 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13131
13132 * lread.c (syms_of_lread): Mention single symbols defined by
13133 `defvar' or `defconst' (bug#7154).
13134
13135 * fns.c (Frequire): Mention .el.gz files (bug#7314).
13136 (Frequire): Mention get-load-suffixes.
13137
13138 2011-07-02 Martin Rudalics <rudalics@gmx.at>
13139
13140 * window.h (window): Remove clone_number slot.
13141 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13142 Remove.
13143 (make_parent_window, make_window, saved_window)
13144 (Fset_window_configuration, save_window_save): Don't deal with
13145 clone numbers.
13146 * buffer.c (Qclone_number): Remove declaration.
13147 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13148
13149 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13150
13151 Add multiple inheritance to keymaps.
13152 * keymap.c (Fmake_composed_keymap): New function.
13153 (Fset_keymap_parent): Simplify.
13154 (fix_submap_inheritance): Remove.
13155 (access_keymap_1): New function extracted from access_keymap to handle
13156 embedded parents and handle lists of maps.
13157 (access_keymap): Use it.
13158 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13159 (Fcopy_keymap): Handle embedded parents.
13160 (Fcommand_remapping, define_as_prefix): Simplify.
13161 (Fkey_binding): Simplify.
13162 (syms_of_keymap): Move minibuffer-local-completion-map,
13163 minibuffer-local-filename-completion-map,
13164 minibuffer-local-must-match-map, and
13165 minibuffer-local-filename-must-match-map to Elisp.
13166 (syms_of_keymap): Defsubr make-composed-keymap.
13167 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13168 (parse_menu_item): Trivial simplification.
13169
13170 2011-07-01 Glenn Morris <rgm@gnu.org>
13171
13172 * Makefile.in (SETTINGS_LIBS): Fix typo.
13173
13174 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13175
13176 * coding.c (Fencode_coding_string): Record the last coding system
13177 used, as the function doc string says (bug#8738).
13178
13179 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13180
13181 * xsettings.c (store_monospaced_changed): Take new font as arg and
13182 check for change against current_mono_font.
13183 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13184 (emacs_settings_constructor, emacs_settings_get_property)
13185 (emacs_settings_set_property, emacs_settings_class_init)
13186 (emacs_settings_init, gsettings_obj): Remove.
13187 (something_changedCB): New function for HAVE_GSETTINGS.
13188 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13189 with value as argument.
13190 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13191 g_settings_new (Bug#8967). Do not create gsettings_obj.
13192 Remove calls to g_settings_bind. Connect something_changedCB to
13193 "changed".
13194
13195 * xgselect.c: Add defined (HAVE_GSETTINGS).
13196 (xgselect_initialize): Ditto.
13197
13198 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13199 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13200 xg_select.
13201
13202 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13203
13204 * eval.c (struct backtrace): Simplify and port the data structure.
13205 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13206 signed bit field, as this assumption is not portable and it makes
13207 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13208 "char debug_on_exit : 1" as this is not portable either; instead,
13209 use the portable "unsigned int debug_on_exit : 1". Remove unused
13210 member evalargs. Remove obsolete comments about cc bombing out.
13211
13212 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13213
13214 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
13215 Let HAVE_GSETTINGS override HAVE_GCONF.
13216 (store_monospaced_changed): New function.
13217 (EMACS_SETTINGS): A new type derived from GObject to handle
13218 GSettings notifications.
13219 (emacs_settings_constructor, emacs_settings_get_property)
13220 (emacs_settings_set_property, emacs_settings_class_init):
13221 New functions.
13222 (gsettings_client, gsettings_obj): New variables.
13223 (GSETTINGS_SCHEMA): New define.
13224 (something_changedCB): Call store_monospaced_changed.
13225 (init_gsettings): New function.
13226 (xsettings_initialize): Call init_gsettings.
13227 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13228 to NULL.
13229
13230 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13231 GCONF_CFLAGS/LIBS.
13232
13233 2011-06-29 Martin Rudalics <rudalics@gmx.at>
13234
13235 * window.c (resize_root_window, grow_mini_window)
13236 (shrink_mini_window): Rename Qresize_root_window to
13237 Qwindow_resize_root_window and Qresize_root_window_vertically to
13238 Qwindow_resize_root_window_vertically.
13239
13240 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13241
13242 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13243
13244 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
13245
13246 * makefile.w32-in: Redesign dependencies so they reflect more
13247 clearly which files are directly included by each source file,
13248 and not through other includes.
13249
13250 2011-06-27 Martin Rudalics <rudalics@gmx.at>
13251
13252 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13253 (sort_overlays, overlay_strings): When an overlay's clone number
13254 matches the window's clone number process the overlay even if
13255 the overlay's window property doesn't match the current window.
13256
13257 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13258 (Fwindow_hchild): Rename to Fwindow_left_child.
13259 (Fwindow_next): Rename to Fwindow_next_sibling.
13260 (Fwindow_prev): Rename to Fwindow_prev_sibling.
13261 (resize_window_check): Rename to window_resize_check.
13262 (resize_window_apply): Rename to window_resize_apply.
13263 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13264 (Fdelete_other_windows_internal, resize_frame_windows)
13265 (Fsplit_window_internal, Fdelete_window_internal)
13266 (grow_mini_window, shrink_mini_window)
13267 (Fresize_mini_window_internal): Fix callers accordingly.
13268
13269 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13270
13271 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13272 (emacs_fixed_set_min_size): Remove.
13273 (emacs_fixed_new): Take frame as argument.
13274
13275 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13276 (_EmacsFixedPrivate): Remove minwidth/height.
13277 Add struct frame *f.
13278 (emacs_fixed_init): Initialize priv->f.
13279 (get_parent_class, emacs_fixed_set_min_size): Remove.
13280 (emacs_fixed_new): Set priv->f to argument.
13281 (emacs_fixed_get_preferred_width)
13282 (emacs_fixed_get_preferred_height): Use min_width/height from
13283 frames size_hint to set minimum and natural (Bug#8919).
13284 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13285 and use min_width/height from frames size_hint to set
13286 min_width/height (Bug#8919).
13287
13288 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13289 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13290 Fix indentation.
13291
13292 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13293
13294 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13295 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13296 called at ZV.
13297
13298 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13299
13300 * process.c (wait_reading_process_output): Bypass select if
13301 waiting for a cell while ignoring keyboard input, and input is
13302 pending. Suggested by Jan Djärv (Bug#8869).
13303
13304 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13305
13306 Use gnulib's dup2 module instead of rolling our own.
13307 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13308
13309 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13310
13311 * dispnew.c (scrolling_window): Before scrolling, turn off a
13312 mouse-highlight in the window being scrolled.
13313
13314 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13315
13316 Move DEFSYM to lisp.h and use everywhere.
13317
13318 * character.h (DEFSYM): Move declaration...
13319 * lisp.h (DEFSYM): ...here.
13320
13321 * gnutls.c:
13322 * minibuf.c:
13323 * w32menu.c:
13324 * w32proc.c:
13325 * w32select.c: Don't include character.h.
13326
13327 * alloc.c (syms_of_alloc):
13328 * buffer.c (syms_of_buffer):
13329 * bytecode.c (syms_of_bytecode):
13330 * callint.c (syms_of_callint):
13331 * casefiddle.c (syms_of_casefiddle):
13332 * casetab.c (init_casetab_once):
13333 * category.c (init_category_once, syms_of_category):
13334 * ccl.c (syms_of_ccl):
13335 * cmds.c (syms_of_cmds):
13336 * composite.c (syms_of_composite):
13337 * dbusbind.c (syms_of_dbusbind):
13338 * dired.c (syms_of_dired):
13339 * dispnew.c (syms_of_display):
13340 * doc.c (syms_of_doc):
13341 * editfns.c (syms_of_editfns):
13342 * emacs.c (syms_of_emacs):
13343 * eval.c (syms_of_eval):
13344 * fileio.c (syms_of_fileio):
13345 * fns.c (syms_of_fns):
13346 * frame.c (syms_of_frame):
13347 * fringe.c (syms_of_fringe):
13348 * insdel.c (syms_of_insdel):
13349 * keymap.c (syms_of_keymap):
13350 * lread.c (init_obarray, syms_of_lread):
13351 * macros.c (syms_of_macros):
13352 * msdos.c (syms_of_msdos):
13353 * print.c (syms_of_print):
13354 * process.c (syms_of_process):
13355 * search.c (syms_of_search):
13356 * sound.c (syms_of_sound):
13357 * syntax.c (init_syntax_once, syms_of_syntax):
13358 * terminal.c (syms_of_terminal):
13359 * textprop.c (syms_of_textprop):
13360 * undo.c (syms_of_undo):
13361 * w32.c (globals_of_w32):
13362 * window.c (syms_of_window):
13363 * xdisp.c (syms_of_xdisp):
13364 * xfaces.c (syms_of_xfaces):
13365 * xfns.c (syms_of_xfns):
13366 * xmenu.c (syms_of_xmenu):
13367 * xsettings.c (syms_of_xsettings):
13368 * xterm.c (syms_of_xterm): Use DEFSYM.
13369
13370 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13371
13372 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13373
13374 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13375
13376 Integer and buffer overflow fixes (Bug#8873).
13377
13378 * print.c (printchar, strout): Check for string overflow.
13379 (PRINTPREPARE, printchar, strout):
13380 Don't set size unless allocation succeeds.
13381
13382 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13383 for sizes. Check for string overflow more accurately.
13384 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13385
13386 * macros.c: Integer and buffer overflow fixes.
13387 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13388 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13389 Use ptrdiff_t, not int, for sizes.
13390 Don't increment bufsize until after realloc succeeds.
13391 Check for size-calculation overflow.
13392 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13393
13394 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13395
13396 * lread.c: Integer overflow fixes.
13397 (read_integer): Radix is now EMACS_INT, not int,
13398 to improve quality of diagnostics for out-of-range radices.
13399 Calculate buffer size correctly for out-of-range radices.
13400 (read1): Check for integer overflow in radices, and in
13401 read-circle numbers.
13402 (read_escape): Avoid int overflow.
13403 (Fload, openp, read_buffer_size, read1)
13404 (substitute_object_recurse, read_vector, read_list, map_obarray):
13405 Use ptrdiff_t, not int, for sizes.
13406 (read1): Use EMACS_INT, not int, for sizes.
13407 Check for size overflow.
13408
13409 * image.c (cache_image): Check for size arithmetic overflow.
13410
13411 * lread.c: Integer overflow issues.
13412 (saved_doc_string_size, saved_doc_string_length)
13413 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13414 Now ptrdiff_t, not int.
13415 (read1): Don't assume doc string length fits in int. Check for
13416 out-of-range doc string lengths.
13417 (read_list): Don't assume file position fits in int.
13418 (read_escape): Check for hex character overflow.
13419
13420 2011-06-22 Leo Liu <sdl.web@gmail.com>
13421
13422 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13423 Move to minibuffer.el.
13424
13425 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13426
13427 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13428 The following patches are for when GLYPH_DEBUG && !XASSERT.
13429 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13430 * dispnew.c (flush_stdout):
13431 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13432 Mark as externally visible.
13433 * dispnew.c (check_window_matrix_pointers): Now static.
13434 * dispnew.c (window_to_frame_vpos):
13435 * xfns.c (unwind_create_frame):
13436 * xterm.c (x_check_font): Remove unused local.
13437 * scroll.c (CHECK_BOUNDS):
13438 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13439 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13440 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13441 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13442 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13443 Now static.
13444 (debug_method_add): Use va_list and vsprintf rather than relying
13445 on undefined behavior with wrong number of arguments.
13446 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13447 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13448 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13449 since we're not interested in debugging glyphs with old libraries.
13450 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13451 GCC 4.6.0's static checking.
13452
13453 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13454
13455 Integer overflow and signedness fixes (Bug#8873).
13456 A few related buffer overrun fixes, too.
13457
13458 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13459
13460 * dispextern.h (struct face.stipple):
13461 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13462 (x_bitmap_mask, x_allocate_bitmap_record)
13463 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13464 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13465 (x_create_bitmap_from_xpm_data):
13466 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13467 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13468 (.bitmaps_last):
13469 * xfaces.c (load_pixmap):
13470 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13471 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13472 (.bitmaps_last, struct x_output.icon_bitmap):
13473 Use ptrdiff_t, not int, for bitmap indexes.
13474 (x_allocate_bitmap_record): Check for size overflow.
13475 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13476
13477 Use ptrdiff_t, not int, for overlay counts.
13478 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13479 * editfns.c (overlays_around, get_pos_property):
13480 * textprop.c (get_char_property_and_overlay):
13481 * xdisp.c (next_overlay_change, note_mouse_highlight):
13482 * xfaces.c (face_at_buffer_position):
13483 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13484 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13485 (Fnext_overlay_change, Fprevious_overlay_change)
13486 (mouse_face_overlay_overlaps, Foverlays_in):
13487 Use ptrdiff_t, not int, for sizes.
13488 (overlays_at, overlays_in): Check for size-calculation overflow.
13489
13490 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13491
13492 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13493 (x_session_initialize): Do not assume string length fits in int.
13494
13495 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13496 This is unlikely, but can occur if DPI is outlandish.
13497
13498 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13499 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13500
13501 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13502 * xrdb.c (magic_file_p, search_magic_path):
13503 Omit last arg SUFFIX; it was always 0. All callers changed.
13504 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13505
13506 * xfont.c (xfont_match): Avoid need for strlen.
13507
13508 * xfns.c: Don't assume strlen fits in int.
13509 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13510
13511 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13512 not unsigned long, as we prefer signed integers. All callers changed.
13513 Detect integer overflow in repeat count.
13514 (message_dolog): Don't assume print length fits in 39 bytes.
13515 (display_mode_element): Don't assume strlen fits in int.
13516
13517 * termcap.c: Don't assume sizes fit in int and never overflow.
13518 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13519 (gobble_line): Check for size-calculation overflow.
13520
13521 * minibuf.c (Fread_buffer):
13522 * lread.c (intern, intern_c_string):
13523 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13524 Don't assume string length fits in int.
13525
13526 * keyboard.c (parse_tool_bar_item):
13527 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13528
13529 * font.c: Don't assume string length fits in int.
13530 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13531 Use ptrdiff_t, not int.
13532 (font_intern_prop): Don't assume string length fits in int.
13533 Don't assume integer property fits in fixnum.
13534 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13535
13536 * filelock.c: Fix some buffer overrun and integer overflow issues.
13537 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13538 Reformulate so as not to need the command string.
13539 Invoke gzip -cd rather than gunzip, as it's more portable.
13540 (lock_info_type, lock_file_1, lock_file):
13541 Don't assume pid_t and time_t fit in unsigned long.
13542 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13543 (current_lock_owner): Prefer signed type for sizes.
13544 Use memcpy, not strncpy, where memcpy is what is really wanted.
13545 Don't assume (via atoi) that time_t and pid_t fit in int.
13546 Check for time_t and/or pid_t out of range, e.g., via a network share.
13547 Don't alloca where an auto var works fine.
13548
13549 * fileio.c: Fix some integer overflow issues.
13550 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13551 Don't assume string length fits in int.
13552 (directory_file_name): Don't assume string length fits in long.
13553 (make_temp_name): Don't assume pid fits in int, or that its print
13554 length is less than 20.
13555
13556 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13557
13558 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13559
13560 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13561
13562 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13563 We prefer signed integers, even for size calculations.
13564
13565 * emacs.c: Don't assume string length fits in 'int'.
13566 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13567 (main): Don't invoke strlen when not needed.
13568
13569 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13570 (XD_DEBUG_MESSAGE): Don't waste a byte.
13571
13572 * callproc.c (getenv_internal_1, getenv_internal)
13573 (Fgetenv_internal):
13574 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13575
13576 * lread.c (invalid_syntax): Omit length argument.
13577 All uses changed. This doesn't fix a bug, but it simplifies the
13578 code away from its former Hollerith-constant appearance, and it's
13579 one less 'int' to worry about when looking at integer-overflow issues.
13580 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13581
13582 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13583 This didn't break anything, but it didn't help either.
13584 It's confusing to put a bogus integer in a place where the actual
13585 value does not matter.
13586 (LIST_END_P): Remove unused macro and its bogus comment.
13587 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13588
13589 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13590 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13591 implementation.
13592 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13593 We prefer signed types, and the value cannot exceed the EMACS_INT
13594 range anyway (because otherwise the length would not be representable).
13595 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13596 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13597 This avoids a GCC warning when WIDE_EMACS_INT.
13598
13599 * indent.c (sane_tab_width): New function.
13600 (current_column, scan_for_column, Findent_to, position_indentation)
13601 (compute_motion): Use it. This is just for clarity.
13602 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13603
13604 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13605
13606 * lisp.h (lint_assume): New macro.
13607 * composite.c (composition_gstring_put_cache):
13608 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13609
13610 * editfns.c, insdel.c:
13611 Omit unnecessary forward decls, to simplify future changes.
13612
13613 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13614
13615 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13616
13617 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13618 Use much-faster test for byte-length change.
13619 Don't assume string byte-length fits in 'int'.
13620 Check that character arg fits in 'int'.
13621 (mapcar1): Declare byte as byte, for clarity.
13622
13623 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13624
13625 * fns.c (concat): Catch string overflow earlier.
13626 Do not rely on integer wraparound.
13627
13628 * dispextern.h (struct it.overlay_strings_charpos)
13629 (struct it.selective): Now EMACS_INT, not int.
13630 * xdisp.c (forward_to_next_line_start)
13631 (back_to_previous_visible_line_start)
13632 (reseat_at_next_visible_line_start, next_element_from_buffer):
13633 Don't arbitrarily truncate the value of 'selective' to int.
13634
13635 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13636
13637 * composite.c: Don't truncate sizes to 'int'.
13638 (composition_gstring_p, composition_reseat_it)
13639 (composition_adjust_point): Use EMACS_INT, not int.
13640 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13641 not EMACS_UINT, for indexes.
13642
13643 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13644
13645 * buffer.c: Include <verify.h>.
13646 (struct sortvec.priority, struct sortstr.priority):
13647 Now EMACS_INT, not int.
13648 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13649 (struct sortstr.size, record_overlay_string)
13650 (struct sortstrlist.size, struct sortlist.used):
13651 Don't truncate size to int.
13652 (record_overlay_string): Check for size-calculation overflow.
13653 (init_buffer_once): Check at compile-time, not run-time.
13654
13655 2011-06-22 Jim Meyering <meyering@redhat.com>
13656
13657 Don't leak an XBM-image-sized buffer
13658 * image.c (xbm_load): Free the image buffer after using it.
13659
13660 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13661
13662 Port to Sun C.
13663 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13664 that Sun C diagnosed.
13665 * fns.c (secure_hash): Fix pointer signedness issue.
13666 * intervals.c (static_offset_intervals): New function.
13667 (offset_intervals): Use it.
13668
13669 2011-06-21 Leo Liu <sdl.web@gmail.com>
13670
13671 * deps.mk (fns.o):
13672 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13673 sha512.h.
13674
13675 * fns.c (secure_hash): Rename from crypto_hash_function and change
13676 the first arg to accept symbols.
13677 (Fsecure_hash): New primitive.
13678 (syms_of_fns): New symbols.
13679
13680 2011-06-20 Deniz Dogan <deniz@dogan.se>
13681
13682 * process.c (Fset_process_buffer): Clarify return value in
13683 docstring.
13684
13685 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
13686
13687 * dispnew.c (add_window_display_history): Use BVAR.
13688
13689 * xdisp.c (debug_method_add): Use BVAR.
13690 (check_window_end, dump_glyph_matrix, dump_glyph)
13691 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13692
13693 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13694 Likewise.
13695
13696 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13697 check till after the cache is created in init_frame_faces.
13698
13699 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13700
13701 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13702
13703 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13704
13705 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13706 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13707 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13708
13709 Improve buffer-overflow checking (Bug#8873).
13710 * fileio.c (Finsert_file_contents):
13711 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13712 Remove the old (too-loose) buffer overflow checks.
13713 They weren't needed, since make_gap checks for buffer overflow.
13714 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13715 The old code merely checked for Emacs fixnum overflow, and relied
13716 on undefined (wraparound) behavior. The new code avoids undefined
13717 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13718
13719 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13720 Tune. Don't use wider integers than needed. Don't use alloca.
13721 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13722
13723 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13724
13725 * insdel.c, lisp.h (buffer_overflow): New function.
13726 (insert_from_buffer_1, replace_range, replace_range_2):
13727 * insdel.c (make_gap_larger):
13728 * editfns.c (Finsert_char):
13729 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13730
13731 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13732
13733 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13734
13735 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13736
13737 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13738 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13739
13740 * fileio.c: Don't assume EMACS_INT fits in off_t.
13741 (emacs_lseek): New static function.
13742 (Finsert_file_contents, Fwrite_region): Use it.
13743 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13744
13745 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13746
13747 * fns.c: Don't overflow int when computing a list length.
13748 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13749 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13750 truncation on 64-bit hosts. Check for QUIT every
13751 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13752 faster and is responsive enough.
13753 (Flength): Report an error instead of overflowing an integer.
13754 (Fsafe_length): Return a float if the value is not representable
13755 as a fixnum. This shouldn't happen except in contrived situations.
13756 (Fnthcdr, Fsort): Don't assume list length fits in int.
13757 (Fcopy_sequence): Don't assume vector length fits in int.
13758
13759 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13760 (header_size, word_size): New constants.
13761 (allocate_vectorlike): Don't check size overflow here.
13762 (allocate_vector): Check it here instead, since this is the only
13763 caller of allocate_vectorlike that could cause overflow.
13764 Check that the new vector's length is representable as a fixnum.
13765
13766 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13767 The previous code was bogus. For example, next_almost_prime (32)
13768 returned 39, which is undesirable as it is a multiple of 3; and
13769 next_almost_prime (24) returned 25, which is a multiple of 5 so
13770 why was the code bothering to check for multiples of 7?
13771
13772 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13773
13774 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13775
13776 Variadic C functions now count arguments with ptrdiff_t.
13777 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13778 Back then I didn't know that the Emacs coding style prefers signed int.
13779 Also, in the meantime I found a few more instances where arguments
13780 were being counted with int, which may truncate counts on 64-bit
13781 machines, or EMACS_INT, which may be unnecessarily wide.
13782 * lisp.h (struct Lisp_Subr.function.aMANY)
13783 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13784 Arg counts are now ptrdiff_t, not size_t.
13785 All variadic functions and their callers changed accordingly.
13786 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13787 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13788 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13789 * callint.c (Fcall_interactively): Check arg count for overflow,
13790 to avoid potential buffer overrun. Use signed char, not 'int',
13791 for 'varies' array, so that we needn't bother to check its size
13792 calculation for overflow.
13793 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13794 * eval.c (apply_lambda):
13795 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13796 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13797 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13798
13799 * callint.c (Fcall_interactively): Don't use index var as event count.
13800
13801 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13802 * mem-limits.h (SIZE): Remove; no longer used.
13803
13804 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13805
13806 Remove unnecessary casts.
13807 * xterm.c (x_term_init):
13808 * xfns.c (x_set_border_pixel):
13809 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13810 These aren't needed now that we assume ANSI C.
13811
13812 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13813 It's more likely to cause problems (due to unsigned overflow)
13814 than to cure them.
13815
13816 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13817
13818 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13819
13820 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13821
13822 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13823
13824 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13825
13826 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13827
13828 GLYPH_CODE_FACE returns EMACS_INT, not int.
13829 * dispextern.h (merge_faces):
13830 * xfaces.c (merge_faces):
13831 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13832 Don't assume EMACS_INT fits in int.
13833
13834 * character.h (CHAR_VALID_P): Remove unused parameter.
13835 * fontset.c, lisp.h, xdisp.c: All uses changed.
13836
13837 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13838
13839 * fns.c (concat): Minor tuning based on overflow analysis.
13840 This doesn't fix any bugs. Use int to hold character, instead
13841 of constantly refetching from Emacs object. Use XFASTINT, not
13842 XINT, for value known to be a character. Don't bother comparing
13843 a single byte to 0400, as it's always less.
13844
13845 * floatfns.c (Fexpt):
13846 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13847
13848 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13849 for characters.
13850
13851 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13852
13853 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13854 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13855 incorrectly succeed when S was a string, because 4294967386 was
13856 truncated before it was used.
13857
13858 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13859 Otherwise, an out-of-range integer could cause undefined behavior
13860 on a 64-bit host.
13861
13862 * composite.c: Use int, not EMACS_INT, for characters.
13863 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13864 EMACS_INT, for values that are known to be in character range.
13865 This doesn't fix any bugs but is the usual style inside Emacs and
13866 may generate better code on 32-bit machines.
13867
13868 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13869 This is for reasons similar to the recent CHAR_STRING fix.
13870 * charset.c (Fencode_char): Check that character arg is actually
13871 a character. Pass an int to ENCODE_CHAR.
13872 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13873 wider than 'int', as a compile-time check to prevent future regressions
13874 in this area.
13875
13876 * character.c (char_string): Remove unnecessary casts.
13877
13878 Make sure a 64-bit char is never passed to CHAR_STRING.
13879 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13880 by silently ignoring the top 32 bits, allowing some values
13881 that were far too large to be valid characters.
13882 * character.h: Include <verify.h>.
13883 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13884 arguments are no wider than unsigned, as a compile-time check
13885 to prevent future regressions in this area.
13886 * data.c (Faset):
13887 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13888 (Fsubst_char_in_region):
13889 * fns.c (concat):
13890 * xdisp.c (decode_mode_spec_coding):
13891 Adjust to CHAR_STRING's new requirement.
13892 * editfns.c (Finsert_char, Fsubst_char_in_region):
13893 * fns.c (concat): Check that character args are actually
13894 characters. Without this test, these functions did the wrong
13895 thing with wildly out-of-range values on 64-bit hosts.
13896
13897 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13898 These casts should not be needed on 32-bit hosts, either.
13899 * keyboard.c (read_char):
13900 * lread.c (Fload): Remove casts to unsigned.
13901
13902 * lisp.h (UNSIGNED_CMP): New macro.
13903 This fixes comparison bugs on 64-bit hosts.
13904 (ASCII_CHAR_P): Use it.
13905 * casefiddle.c (casify_object):
13906 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13907 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13908 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13909 * dispextern.h (FACE_FROM_ID):
13910 * keyboard.c (read_char): Use UNSIGNED_CMP.
13911
13912 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13913 not to EMACS_INT, to avoid GCC warning.
13914
13915 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13916
13917 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13918 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13919 isn't needed on 32-bit machines.
13920
13921 * buffer.c (Fgenerate_new_buffer_name):
13922 Use EMACS_INT for count, not int.
13923 (advance_to_char_boundary): Return EMACS_INT, not int.
13924
13925 * data.c (Qcompiled_function): Now static.
13926
13927 * window.c (window_body_lines): Now static.
13928
13929 * image.c (gif_load): Rename local to avoid shadowing.
13930
13931 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13932 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13933 * alloc.c (make_save_value): Integer argument is now of type
13934 ptrdiff_t, not int.
13935 (mark_object): Use ptrdiff_t, not int.
13936 * lisp.h (pD): New macro.
13937 * print.c (print_object): Use it.
13938
13939 * alloc.c: Use EMACS_INT, not int, to count objects.
13940 (total_conses, total_markers, total_symbols, total_vector_size)
13941 (total_free_conses, total_free_markers, total_free_symbols)
13942 (total_free_floats, total_floats, total_free_intervals)
13943 (total_intervals, total_strings, total_free_strings):
13944 Now EMACS_INT, not int. All uses changed.
13945 (Fgarbage_collect): Compute overall total using a double, so that
13946 integer overflow is less likely to be a problem. Check for overflow
13947 when converting back to an integer.
13948 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13949 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13950 These were 'int' variables that could overflow on 64-bit hosts;
13951 they were never used, so remove them instead of repairing them.
13952 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13953 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13954 Previously, this ceilinged at INT_MAX, but that doesn't work on
13955 64-bit machines.
13956 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13957
13958 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13959 (allocate_vectorlike): Check for ptrdiff_t overflow.
13960 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13961 when a (possibly-narrower) signed value would do just as well.
13962 We prefer using signed arithmetic, to avoid comparison confusion.
13963
13964 * alloc.c: Catch some string size overflows that we were missing.
13965 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13966 for convenience in STRING_BYTES_MAX.
13967 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13968 The definition here is exact; the one in lisp.h was approximate.
13969 (allocate_string_data): Check for string overflow. This catches
13970 some instances we weren't catching before. Also, it catches
13971 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13972 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13973 and ptrdiff_t and EMACS_INT are both 64 bits.
13974
13975 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13976 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13977 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13978
13979 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13980
13981 * alloc.c (Fmake_string): Check for out-of-range init.
13982
13983 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13984
13985 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13986
13987 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13988
13989 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13990 xg_get_default_scrollbar_width.
13991
13992 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13993 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13994 (style_changed_cb): Call update_theme_scrollbar_width and call
13995 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13996 all frames (Bug#8505).
13997 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13998 Call gtk_window_set_resizable if HAVE_GTK3.
13999 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14000 and height if HAVE_GTK3 (Bug#8505).
14001 (scroll_bar_width_for_theme): New variable.
14002 (update_theme_scrollbar_width): New function.
14003 (xg_get_default_scrollbar_width): Move code to
14004 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14005 (xg_initialize): Call update_theme_scrollbar_width.
14006
14007 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14008
14009 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14010
14011 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14012
14013 * frame.c (make_frame): Call other_buffer_safely instead of
14014 other_buffer.
14015
14016 * window.c (temp_output_buffer_show): Call display_buffer with
14017 second argument Vtemp_buffer_show_specifiers and reset latter
14018 immediately after the call.
14019 (Vtemp_buffer_show_specifiers): New variable.
14020 (auto_window_vscroll_p, next_screen_context_lines)
14021 (Vscroll_preserve_screen_position): Remove leading asterisks from
14022 doc-strings.
14023
14024 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
14025
14026 Fix minor problems found by GCC 4.6.0 static checking.
14027 * buffer.c (Qclone_number): Remove for now, as it's unused.
14028 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14029 (record_buffer): Remove unused local.
14030 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14031 (set_frame_buffer_list): Remove; unused.
14032 * frame.h (other_visible_frames): Remove decl.
14033 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14034 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14035 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14036 if HAVE_GPM.
14037 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14038 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14039 Define only if HAVE_GPM.
14040 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14041 (update_hints_inhibit): Remove; never set. All uses removed.
14042 * widgetprv.h (emacsFrameClassRec): Remove decl.
14043 * window.c (delete_deletable_window): Now returns void, since it
14044 wasn't returning anything.
14045 (compare_window_configurations): Remove unused locals.
14046 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14047 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14048 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14049 the same widths as pointers. This follows up on the 2011-05-06 patch.
14050 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14051 * xterm.h: Likewise.
14052 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14053
14054 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
14055
14056 * makefile.w32-in: Update dependencies.
14057 (LISP_H): Add lib/intprops.h.
14058
14059 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14060
14061 * image.c (gif_load): Add animation frame delay to the metadata.
14062 (syms_of_image): Use DEFSYM. New symbol `delay'.
14063
14064 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14065
14066 * window.c (delete_deletable_window): Re-add.
14067 (Fset_window_configuration): Rewrite to handle dead buffers and
14068 consequently deletable windows.
14069 (window_tree, Fwindow_tree): Remove. Supply functionality in
14070 window.el.
14071 (compare_window_configurations): Simplify code.
14072
14073 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14074
14075 * image.c (imagemagick_load_image): Fix type mismatch.
14076 (Fimagemagick_types): Likewise.
14077
14078 * window.h (replace_buffer_in_windows): Declare.
14079
14080 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14081
14082 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14083 Qclone_number. Remove external declaration of Qdelete_window.
14084 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14085 code.
14086 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14087 Run Qbuffer_list_update_hook if allowed.
14088 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14089 buffer list implementation.
14090 (other_buffer_safely): New function.
14091 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14092 calls to replace_buffer_in_windows and
14093 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14094 if allowed.
14095 (record_buffer): Inhibit quitting and rewrite using quittable
14096 functions. Run Qbuffer_list_update_hook if allowed.
14097 (Frecord_buffer, Funrecord_buffer): New functions.
14098 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14099 Move switch-to-buffer to window.el.
14100 (bury-buffer): Move to window.el.
14101 (Vbuffer_list_update_hook): New variable.
14102
14103 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14104 section.
14105
14106 * window.h (resize_frame_windows): Move up in code.
14107 (Fwindow_frame): Remove EXFUN.
14108 (replace_buffer_in_all_windows): Remove prototype.
14109 (replace_buffer_in_windows_safely): Add prototype.
14110
14111 * window.c: Declare Qdelete_window static again. Move down
14112 declaration of select_count.
14113 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14114 (Fother_window): Move to window.el.
14115 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14116 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14117 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14118 window.el.
14119 (replace_buffer_in_windows): Implement by calling
14120 Qreplace_buffer_in_windows.
14121 (replace_buffer_in_all_windows): Remove with some functionality
14122 moved into replace_buffer_in_windows_safely.
14123 (replace_buffer_in_windows_safely): New function.
14124 (select_window_norecord, select_frame_norecord): Move in front
14125 of run_window_configuration_change_hook. Remove now obsolete
14126 declarations.
14127 (Fset_window_buffer): Rewrite doc-string.
14128 Call Qrecord_window_buffer.
14129 (keys_of_window): Move binding for other-window to window.el.
14130
14131 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14132
14133 * dispextern.h (struct image): Replace data member, whose int_val
14134 and ptr_val fields were not used by anything, with a single
14135 lisp_val object.
14136
14137 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14138 (gif_clear_image, gif_load, imagemagick_load_image)
14139 (gs_clear_image, gs_load): Callers changed.
14140
14141 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14142
14143 * buffer.h: Include <time.h>, for time_t.
14144 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14145
14146 Fix minor problems found by static checking.
14147
14148 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14149
14150 Make identifiers static if they are not used in other modules.
14151 * data.c (Qcompiled_function, Qframe, Qvector):
14152 * image.c (QimageMagick, Qsvg):
14153 * minibuf.c (Qmetadata):
14154 * window.c (resize_window_check, resize_root_window): Now static.
14155 * window.h (resize_window_check, resize_root_window): Remove decls.
14156
14157 * window.c (window_deletion_count, delete_deletable_window):
14158 Remove; unused.
14159 (window_body_lines): Now static.
14160 (Fdelete_other_windows_internal): Mark vars as initialized.
14161 Make sure 'resize_failed' is initialized.
14162 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14163 (resize_window_apply): Remove unused local.
14164 * window.h (delete_deletable_window): Remove decl.
14165
14166 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14167 (imagemagick_load_image): Fix pointer signedness problem by changing
14168 last arg from unsigned char * to char *. All uses changed.
14169 Also, fix a local for similar reasons.
14170 Remove unused locals. Remove locals to avoid shadowing.
14171 (fn_rsvg_handle_free): Remove; unused.
14172 (svg_load, svg_load_image): Fix pointer signedness problem.
14173 (imagemagick_load_image): Don't use garbage pointer image_wand.
14174
14175 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14176
14177 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
14178
14179 * image.c (gif_load): Fix omitted cast error introduced by
14180 2011-06-06 change.
14181
14182 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14183
14184 * window.h (resize_proportionally, orig_total_lines)
14185 (orig_top_line): Remove from window structure.
14186 (set_window_height, set_window_width, change_window_heights)
14187 (Fdelete_window): Remove prototypes.
14188 (resize_frame_windows): Remove duplicate declaration.
14189
14190 2011-06-10 Eli Zaretskii <eliz@gnu.org>
14191
14192 * window.h (resize_frame_windows, resize_window_check)
14193 (delete_deletable_window, resize_root_window)
14194 (resize_frame_windows): Declare prototypes.
14195
14196 * window.c (resize_window_apply): Make definition be "static" to
14197 match the prototype.
14198
14199 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14200
14201 * window.c: Remove declarations of Qwindow_size_fixed,
14202 window_min_size_1, window_min_size_2, window_min_size,
14203 size_window, window_fixed_size_p, enlarge_window, delete_window.
14204 Remove static from declaration of Qdelete_window, it's
14205 temporarily needed by Fbury_buffer.
14206 (replace_window): Don't assign orig_top_line and
14207 orig_total_lines.
14208 (Fdelete_window, delete_window): Remove. Window deletion is
14209 handled by window.el.
14210 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14211 Replace Fdelete_window calls with calls to Qdelete_window.
14212 (Fdelete_other_windows): Remove. Deleting other windows is
14213 handled by window.el.
14214 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14215 handled in window.el.
14216 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14217 Window minimum sizes are handled in window.el.
14218 (shrink_windows, size_window, set_window_height)
14219 (set_window_width, change_window_heights, window_height)
14220 (window_width, CURBEG, CURSIZE, enlarge_window)
14221 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14222 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14223 handled in window.el.
14224 (make_dummy_parent): Rename to make_parent_window and give it a
14225 second argument horflag.
14226 (make_window): Don't set resize_proportionally any more.
14227 (Fsplit_window): Remove. Windows are split in window.el.
14228 (save_restore_action, save_restore_orig_size)
14229 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14230 Resize mini windows in window.el.
14231 (grow_mini_window, shrink_mini_window): Implement by calling
14232 Qresize_root_window_vertically, resize_window_check and
14233 resize_window_apply.
14234 (saved_window, Fset_window_configuration, save_window_save):
14235 Do not handle orig_top_line, orig_total_lines, and
14236 resize_proportionally.
14237 (window_min_height, window_min_width): Move to window.el.
14238 (keys_of_window): Move bindings for delete-other-windows,
14239 split-window, delete-window and enlarge-window to window.el.
14240
14241 * buffer.c: Temporarily extern Qdelete_window.
14242 (Fbury_buffer): Temporarily call Qdelete_window instead of
14243 Fdelete_window (Fbury_buffer will move to window.el soon).
14244
14245 * frame.c (set_menu_bar_lines_1): Remove code handling
14246 orig_top_line and orig_total_lines.
14247
14248 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14249 set_window_height but set heights directly.
14250 (change_frame_size_1): Use resize_frame_windows.
14251
14252 * xdisp.c (init_xdisp): Don't use set_window_height but set
14253 heights directly.
14254
14255 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14256 Use resize_frame_windows instead of change_window_heights and run
14257 run_window_configuration_change_hook.
14258
14259 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14260 instead of change_window_heights and run
14261 run_window_configuration_change_hook.
14262
14263 2011-06-09 Martin Rudalics <rudalics@gmx.at>
14264
14265 * window.c (replace_window): Rename second argument REPLACEMENT to
14266 NEW. New third argument SETFLAG. Rewrite.
14267 (delete_window, make_dummy_parent): Call replace_window with
14268 third argument 1.
14269 (window_list_1): Move down in code.
14270 (run_window_configuration_change_hook): Move set_buffer part
14271 before select_frame_norecord part in order to unwind correctly.
14272 Rename count1 to count.
14273 (recombine_windows, delete_deletable_window, resize_root_window)
14274 (Fdelete_other_windows_internal)
14275 (Frun_window_configuration_change_hook, make_parent_window)
14276 (resize_window_check, resize_window_apply, Fresize_window_apply)
14277 (resize_frame_windows, Fsplit_window_internal)
14278 (Fdelete_window_internal, Fresize_mini_window_internal):
14279 New functions.
14280 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14281
14282 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14283
14284 * window.h (window): Add some new members to window structure -
14285 normal_lines, normal_cols, new_total, new_normal, clone_number,
14286 splits, nest, prev_buffers, next_buffers.
14287 (WINDOW_TOTAL_SIZE): Move here from window.c.
14288 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14289
14290 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14291 Remove.
14292 (make_dummy_parent): Set new members of windows structure.
14293 (make_window): Move down in code. Handle new members of window
14294 structure.
14295 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14296 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14297 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14298 (Fset_window_prev_buffers, Fwindow_next_buffers)
14299 (Fset_window_next_buffers, Fset_window_clone_number):
14300 New functions.
14301 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14302 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14303 Doc-string fixes.
14304 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14305 Argument WINDOW can be now internal window too.
14306 (Fwindow_use_time): Move up in code.
14307 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14308 Rewrite doc-string.
14309 (Fset_window_configuration, saved_window)
14310 (Fcurrent_window_configuration, save_window_save): Handle new
14311 members of window structure.
14312 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14313 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14314 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14315 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14316 Qget_mru_window, Qresize_root_window,
14317 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14318 Qauto_buffer_name; staticpro them.
14319
14320 2011-06-07 Martin Rudalics <rudalics@gmx.at>
14321
14322 * window.c (Fwindow_total_size, Fwindow_left_column)
14323 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14324 (Fwindow_list_1): New functions.
14325 (window_box_text_cols): Replace with window_body_cols.
14326 (Fwindow_width, Fscroll_left, Fscroll_right):
14327 Use window_body_cols instead of window_box_text_cols.
14328 (delete_window, Fset_window_configuration):
14329 Call delete_all_subwindows with window as argument.
14330 (delete_all_subwindows): Take a window as argument and not a
14331 structure. Rewrite.
14332 (window_loop): Remove handling of GET_LRU_WINDOW and
14333 GET_LARGEST_WINDOW.
14334 (Fget_lru_window, Fget_largest_window): Move to window.el.
14335
14336 * window.h: Extern window_body_cols instead of
14337 window_box_text_cols. delete_all_subwindows now takes a
14338 Lisp_Object as argument.
14339
14340 * indent.c (compute_motion, Fcompute_motion):
14341 Use window_body_cols instead of window_box_text_cols.
14342
14343 * frame.c (delete_frame): Call delete_all_subwindows with root
14344 window as argument.
14345
14346 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14347
14348 * fns.c (Fputhash): Document return value.
14349
14350 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
14351
14352 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14353
14354 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14355
14356 Cons<->int and similar integer overflow fixes (Bug#8794).
14357
14358 Check for overflow when converting integer to cons and back.
14359 * charset.c (Fdefine_charset_internal, Fdecode_char):
14360 Use cons_to_unsigned to catch overflow.
14361 (Fencode_char): Use INTEGER_TO_CONS.
14362 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14363 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14364 * data.c (long_to_cons, cons_to_long): Remove.
14365 (cons_to_unsigned, cons_to_signed): New functions.
14366 These signal an error for invalid or out-of-range values.
14367 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14368 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14369 * font.c (Ffont_variation_glyphs):
14370 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14371 * lisp.h: Include <intprops.h>.
14372 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14373 (cons_to_signed, cons_to_unsigned): New decls.
14374 (long_to_cons, cons_to_long): Remove decls.
14375 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14376 (Fprimitive_undo): Use CONS_TO_INTEGER.
14377 * xfns.c (Fx_window_property): Likewise.
14378 * xselect.c: Include <limits.h>.
14379 (x_own_selection, selection_data_to_lisp_data):
14380 Use INTEGER_TO_CONS.
14381 (x_handle_selection_request, x_handle_selection_clear)
14382 (x_get_foreign_selection, Fx_disown_selection_internal)
14383 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14384 (lisp_data_to_selection_data): Use cons_to_unsigned.
14385 (x_fill_property_data): Use cons_to_signed.
14386 Report values out of range.
14387
14388 Check for buffer and string overflow more precisely.
14389 * buffer.h (BUF_BYTES_MAX): New macro.
14390 * lisp.h (STRING_BYTES_MAX): New macro.
14391 * alloc.c (Fmake_string):
14392 * character.c (string_escape_byte8):
14393 * coding.c (coding_alloc_by_realloc):
14394 * doprnt.c (doprnt):
14395 * editfns.c (Fformat):
14396 * eval.c (verror):
14397 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14398 since they may not be the same number.
14399 * editfns.c (Finsert_char):
14400 * fileio.c (Finsert_file_contents):
14401 Likewise for BUF_BYTES_MAX.
14402
14403 * image.c: Use ptrdiff_t, not int, for sizes.
14404 (slurp_file): Switch from int to ptrdiff_t.
14405 All uses changed.
14406 (slurp_file): Check that file size fits in both size_t (for
14407 malloc) and ptrdiff_t (for sanity and safety).
14408
14409 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14410 if b->modtime has its maximal value.
14411
14412 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14413
14414 Don't assume time_t can fit into int.
14415 * buffer.h (struct buffer.modtime): Now time_t, not int.
14416 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14417 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14418
14419 Minor fixes for signed vs unsigned integers.
14420 * character.h (MAYBE_UNIFY_CHAR):
14421 * charset.c (maybe_unify_char):
14422 * keyboard.c (read_char, reorder_modifiers):
14423 XINT -> XFASTINT, since the integer must be nonnegative.
14424 * ftfont.c (ftfont_spec_pattern):
14425 * keymap.c (access_keymap, silly_event_symbol_error):
14426 XUINT -> XFASTINT, since the integer must be nonnegative.
14427 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14428 since it makes no difference and we prefer signed.
14429 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14430 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14431 nonnegative.
14432
14433 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14434
14435 * window.h (Fwindow_frame): Declare.
14436
14437 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14438
14439 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14440 (SPARE_MEMORY): Always define.
14441 (LARGE_REQUEST): Remove.
14442 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14443
14444 2011-06-06 Martin Rudalics <rudalics@gmx.at>
14445
14446 * lisp.h: Move EXFUNS for Fframe_root_window,
14447 Fframe_first_window and Fset_frame_selected_window to window.h.
14448
14449 * window.h: Move EXFUNS for Fframe_root_window,
14450 Fframe_first_window and Fset_frame_selected_window here from
14451 lisp.h.
14452
14453 * frame.c (Fwindow_frame, Fframe_first_window)
14454 (Fframe_root_window, Fframe_selected_window)
14455 (Fset_frame_selected_window): Move to window.c.
14456 (Factive_minibuffer_window): Move to minibuf.c.
14457 (Fother_visible_frames_p): New function.
14458
14459 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14460
14461 * window.c (decode_window, decode_any_window): Move up in code.
14462 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14463 (inhibit_frame_unsplittable): Remove unused variable.
14464 (Fwindow_buffer): Move up and rewrite doc-string.
14465 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14466 (Fwindow_prev): New functions.
14467 (Fwindow_frame): Move here from frame.c. Accept any window as
14468 argument.
14469 (Fframe_root_window, Fframe_first_window)
14470 (Fframe_selected_window): Move here from frame.c. Accept frame
14471 or arbitrary window as argument. Update doc-strings.
14472 (Fminibuffer_window): Move up in code.
14473 (Fwindow_minibuffer_p): Move up in code and simplify.
14474 (Fset_frame_selected_window): Move here from frame.c.
14475 Marginal rewrite.
14476 (Fselected_window, select_window, Fselect_window): Move up in
14477 code. Minor doc-string fixes.
14478
14479 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14480
14481 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14482 Do not assume that spare memory exists; that assumption is valid
14483 only if SYSTEM_MALLOC.
14484 (LARGE_REQUEST): New macro, so that the issue of large requests
14485 is separated from the issue of spare memory.
14486
14487 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14488
14489 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14490 format. (Bug#8806)
14491
14492 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14493
14494 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14495 before statements.
14496
14497 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14498
14499 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14500
14501 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14502
14503 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14504 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14505
14506 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
14507
14508 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14509
14510 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
14511
14512 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14513 (x_clipboard_manager_save): Add return value.
14514 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14515 New error handlers.
14516 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14517 Obey Vx_select_enable_clipboard_manager. Catch errors in
14518 x_clipboard_manager_save (Bug#8779).
14519 (Vx_select_enable_clipboard_manager): New variable.
14520 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14521
14522 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
14523
14524 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14525
14526 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14527
14528 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14529 in the current matrix if keep_current_p is non-zero.
14530
14531 2011-06-04 Eli Zaretskii <eliz@gnu.org>
14532
14533 * bidi.c (bidi_level_of_next_char): Fix last change.
14534
14535 2011-06-03 Eli Zaretskii <eliz@gnu.org>
14536
14537 Support bidi reordering of text covered by display properties.
14538
14539 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14540 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14541 (bidi_cache_search, bidi_cache_iterator_state)
14542 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14543 (bidi_level_of_next_char, bidi_move_to_visually_next):
14544 Support character positions inside a run of characters covered by a
14545 display string.
14546 (bidi_paragraph_init, bidi_resolve_explicit_1)
14547 (bidi_level_of_next_char): Call bidi_fetch_char and
14548 bidi_fetch_char_advance instead of FETCH_CHAR and
14549 FETCH_CHAR_ADVANCE.
14550 (bidi_init_it): Initialize new members.
14551 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14552 definitions.
14553 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14554 instead of using explicit *_CHAR codes.
14555 (bidi_resolve_explicit, bidi_resolve_weak):
14556 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14557 bidirectional text is supported only in multibyte buffers.
14558 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14559 it to initialize the frame_window_p member of struct bidi_it.
14560 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14561 (bidi_resolve_explicit, bidi_resolve_weak)
14562 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14563 bidi_it->nchars is non-positive.
14564 (bidi_level_of_next_char): Don't try to lookup the cache for the
14565 next/previous character if nothing is cached there yet, or if we
14566 were just reseat()'ed to a new position.
14567
14568 * xdisp.c (set_cursor_from_row): Set start and stop points
14569 according to the row's direction when priming the loop that looks
14570 for the glyph on which to display cursor.
14571 (single_display_spec_intangible_p): Function deleted.
14572 (display_prop_intangible_p): Reimplement to call
14573 handle_display_spec instead of single_display_spec_intangible_p.
14574 Accept 3 additional arguments needed by handle_display_spec.
14575 This fixes incorrect cursor motion across display property with complex
14576 values: lists, `(when COND...)' forms, etc.
14577 (single_display_spec_string_p): Support property values that are
14578 lists with the argument STRING its top-level element.
14579 (display_prop_string_p): Fix the condition for processing a
14580 property that is a list to be consistent with handle_display_spec.
14581 (handle_display_spec): New function, refactored from the
14582 last portion of handle_display_prop.
14583 (compute_display_string_pos): Accept additional argument
14584 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14585 value of a `display' property is a "replacing spec".
14586 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14587 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14588 the display property, but just return a value indicating whether
14589 the display property will replace the characters it covers.
14590 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14591 frame_window_p members of struct bidi_it.
14592 (compute_display_string_pos, compute_display_string_end):
14593 New functions.
14594 (push_it): Accept second argument POSITION, where pop_it should
14595 jump to continue iteration.
14596 (reseat_1): Initialize bidi_it.disp_pos.
14597
14598 * keyboard.c (adjust_point_for_property): Adjust the call to
14599 display_prop_intangible_p to its new signature.
14600
14601 * dispextern.h (struct bidi_it): New member frame_window_p.
14602 (bidi_init_it): Update prototypes.
14603 (display_prop_intangible_p): Update prototype.
14604 (compute_display_string_pos, compute_display_string_end):
14605 Declare prototypes.
14606 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14607 EMACS_INT.
14608
14609 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14610
14611 Malloc failure behavior now depends on size of allocation.
14612 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14613 * lisp.h: Change signatures accordingly.
14614 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14615 All callers changed. (Bug#8762)
14616
14617 * gnutls.c: Use Emacs's memory allocators.
14618 Without this change, the gnutls library would invoke malloc etc.
14619 directly, which causes problems on non-SYNC_INPUT hosts, and which
14620 runs afoul of improving memory_full behavior. (Bug#8761)
14621 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14622 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14623 xfree instead of the default malloc, realloc, free.
14624 (Fgnutls_boot): No need to check for memory allocation failure,
14625 since xmalloc does that for us.
14626
14627 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14628 * category.c (hash_get_category_set):
14629 * ccl.c (ccl_driver):
14630 * charset.c (Fdefine_charset_internal):
14631 * charset.h (struct charset.hash_index):
14632 * composite.c (get_composition_id, gstring_lookup_cache)
14633 (composition_gstring_put_cache):
14634 * composite.h (struct composition.hash_index):
14635 * dispextern.h (struct image.hash):
14636 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14637 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14638 (hashfn_equal, hashfn_user_defined, make_hash_table)
14639 (maybe_resize_hash_table, hash_lookup, hash_put)
14640 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14641 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14642 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14643 * image.c (make_image, search_image_cache, lookup_image)
14644 (xpm_put_color_table_h):
14645 * lisp.h (struct Lisp_Hash_Table):
14646 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14647 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14648 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14649 * alloc.c (allocate_vectorlike):
14650 Check for overflow in vector size calculations.
14651 * ccl.c (ccl_driver):
14652 Check for overflow when converting EMACS_INT to int.
14653 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14654 need to be updated by these changes.
14655 * fns.c (make_hash_table, maybe_resize_hash_table):
14656 Check for integer overflow with large hash tables.
14657 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14658 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14659 (SXHASH_REDUCE): New macro.
14660 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14661 Use it instead of discarding useful hash info with large hash values.
14662 (sxhash_float): New function.
14663 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14664 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14665 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14666 Rewrite to use FIXNUM_BITS, as this simplifies things.
14667 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14668 Adjust signatures to match updated version of code.
14669 (consing_since_gc): Now EMACS_INT, since a single hash table can
14670 use more than INT_MAX bytes.
14671
14672 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14673
14674 Make it possible to build with GCC-4.6+ -O2 -flto.
14675
14676 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14677
14678 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14679
14680 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14681 Call minibuffer-inactive-mode.
14682
14683 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
14684
14685 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14686 Update dependencies.
14687
14688 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14689
14690 * data.c (init_data): Remove code for UTS, this system is not
14691 supported anymore.
14692
14693 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14694
14695 Don't force ./temacs to start in terminal mode.
14696
14697 * frame.c (make_initial_frame): Initialize faces in all cases, not
14698 only when CANNOT_DUMP is defined.
14699 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14700
14701 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14702
14703 * dispnew.c (add_window_display_history): Use const for the string
14704 pointer. Remove declaration, not needed.
14705
14706 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14707
14708 Use 'inline', not 'INLINE'.
14709 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14710 * alloc.c, fontset.c (INLINE): Remove.
14711 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14712 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14713 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14714 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14715 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14716
14717 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14718
14719 Make it possible to run ./temacs.
14720
14721 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14722 syms_of_callproc does the same thing. Remove test for
14723 "initialized", do it in the caller.
14724 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14725
14726 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14727
14728 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14729 (read_minibuf): Use get_minibuffer.
14730 (syms_of_minibuf): Use DEFSYM.
14731 (Qmetadata): New var.
14732 * data.c (Qbuffer): Don't make it static.
14733 (syms_of_data): Use DEFSYM.
14734
14735 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14736
14737 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14738 (CCL_CODE_MIN): New macro.
14739
14740 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14741
14742 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14743
14744 * eval.c (Qdebug): Now static.
14745 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14746 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14747 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14748
14749 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14750
14751 * image.c: Various fixes to ImageMagick code comments.
14752 (Fimagemagick_types): Doc fix.
14753
14754 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14755
14756 Minor fixes prompted by GCC 4.6.0 warnings.
14757
14758 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14759
14760 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14761 (x_clipboard_manager_save_all): Move extern decl to ...
14762 * xterm.h: ... here, so that it can be checked for consistency.
14763
14764 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14765
14766 * xselect.c (x_clipboard_manager_save_frame)
14767 (x_clipboard_manager_save_all): New functions.
14768 (Fx_clipboard_manager_save): Lisp function deleted.
14769
14770 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14771 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14772
14773 * xterm.h: Update prototype.
14774
14775 2011-05-28 William Xu <william.xwl@gmail.com>
14776
14777 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14778 exiting (Bug#8239).
14779
14780 2011-05-28 Jim Meyering <meyering@redhat.com>
14781
14782 Avoid a sign-extension bug in crypto_hash_function.
14783 * fns.c (to_uchar): Define.
14784 (crypto_hash_function): Use it to convert some newly-signed
14785 variables to unsigned, to avoid sign-extension bugs. For example,
14786 without this change, (md5 "truc") would evaluate to
14787 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14788 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14789 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14790
14791 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14792
14793 Integer overflow fixes.
14794
14795 * dbusbind.c: Serial number integer overflow fixes.
14796 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14797 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14798 to hold a serial number that is too large for a fixnum.
14799 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14800 Check for serial numbers out of range. Decode any serial number
14801 that was so large that it became a float. (Bug#8722)
14802
14803 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14804 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14805 Use XFASTINT rather than XUINT when numbers are nonnegative.
14806 (xd_append_arg, Fdbus_method_return_internal):
14807 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14808 arguments, check that Lisp number is nonnegative, rather than
14809 silently wrapping negative numbers around. (Bug#8722)
14810 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14811 (Bug#8722)
14812
14813 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14814
14815 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14816
14817 ccl: Add integer overflow checks.
14818 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14819 (IN_INT_RANGE): New macros.
14820 (ccl_driver): Use them to check for integer overflow when
14821 decoding a CCL program. Many of the new checks are whether XINT (x)
14822 fits in int; it doesn't always, on 64-bit hosts. The new version
14823 doesn't catch all possible integer overflows, but it's an
14824 improvement. (Bug#8719)
14825
14826 * alloc.c (make_event_array): Use XINT, not XUINT.
14827 There's no need for unsigned here.
14828
14829 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14830 This follows up to the 2011-05-06 change that substituted uintptr_t
14831 for EMACS_INT. This case wasn't caught back then.
14832
14833 Rework Fformat to avoid integer overflow issues.
14834 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14835 now (part of C89). Include <verify.h>.
14836 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14837 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14838 (Fformat): Avoid the prepass trying to compute sizes; it was only
14839 approximate and thus did not catch overflow reliably. Instead, walk
14840 through the format just once, formatting and computing sizes as we go,
14841 checking for integer overflow at every step, and allocating a larger
14842 buffer as needed. Keep track separately whether the format is
14843 multibyte. Keep only the most-recently calculated precision, rather
14844 than them all. Record whether each argument has been converted to
14845 string. Use EMACS_INT, not int, for byte and char and arg counts.
14846 Support field widths and precisions larger than INT_MAX. Avoid
14847 sprintf's undefined behavior with conversion specifications such as %#d
14848 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14849 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14850 formatting out-of-range floating point numbers with int
14851 formats. (Bug#8668)
14852
14853 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14854
14855 * data.c: Avoid integer truncation in expressions involving floats.
14856 * data.c: Include <intprops.h>.
14857 (arith_driver): When there's an integer overflow in an expression
14858 involving floating point, convert the integers to floating point
14859 so that the resulting value does not suffer from catastrophic
14860 integer truncation. For example, on a 64-bit host (* 4
14861 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14862 Do not rely on undefined behavior after integer overflow.
14863
14864 merge count_size_as_multibyte, parse_str_to_multibyte
14865 * character.c, character.h (count_size_as_multibyte):
14866 Rename from parse_str_to_multibyte; all uses changed.
14867 Check for integer overflow.
14868 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14869 since it's now a duplicate of the other. This is more of
14870 a character than a buffer op, so better that it's in character.c.
14871 * fns.c, print.c: Adjust to above changes.
14872
14873 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14874
14875 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14876
14877 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14878
14879 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14880 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14881 (x_clipboard_manager_save): Now static.
14882 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14883
14884 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14885 (crypto_hash_function): Now static.
14886 Fix pointer signedness problems. Avoid unnecessary initializations.
14887
14888 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14889
14890 * termhooks.h (Vselection_alist): Make it terminal-local.
14891
14892 * terminal.c (create_terminal): Initialize it.
14893
14894 * xselect.c: Support for clipboard managers.
14895 (Vselection_alist): Move to termhooks.h as terminal-local var.
14896 (LOCAL_SELECTION): New macro.
14897 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14898 (symbol_to_x_atom): Remove gratuitous arg.
14899 (x_handle_selection_request, lisp_data_to_selection_data)
14900 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14901 (x_own_selection, x_get_local_selection, x_convert_selection):
14902 New arg, specifying work frame. Use terminal-local Vselection_alist.
14903 (some_frame_on_display): Delete unused function.
14904 (Fx_own_selection_internal, Fx_get_selection_internal)
14905 (Fx_disown_selection_internal, Fx_selection_owner_p)
14906 (Fx_selection_exists_p): New optional frame arg.
14907 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14908 (x_handle_selection_clear): Don't treat other terminals with the
14909 same keyboard specially. Use the terminal-local Vselection_alist.
14910 (x_clear_frame_selections): Use Frun_hook_with_args.
14911
14912 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14913
14914 * xterm.h: Add support for those atoms.
14915
14916 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14917
14918 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14919 (converted_selections, conversion_fail_tag): New global variables.
14920 (x_selection_request_lisp_error): Free the above.
14921 (x_get_local_selection): Remove unnecessary code.
14922 (x_reply_selection_request): Args changed; handle arbitrary array
14923 of converted selections stored in converted_selections.
14924 Separate the XChangeProperty and SelectionNotify steps.
14925 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14926 (x_convert_selection): New function.
14927 (x_handle_selection_event): Simplify.
14928 (x_get_foreign_selection): Don't ignore incoming requests while
14929 waiting for an answer; this will fail when we implement
14930 SAVE_TARGETS, and seems unnecessary anyway.
14931 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14932 (Vx_sent_selection_functions): Doc fix.
14933
14934 2011-05-26 Leo Liu <sdl.web@gmail.com>
14935
14936 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14937
14938 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14939
14940 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14941
14942 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14943 for fringe update if it has periodic bitmap.
14944 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14945 and fringe_bitmap_periodic_p.
14946
14947 * fringe.c (get_fringe_bitmap_data): New function.
14948 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14949 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14950 row. Mark glyph row for fringe update if periodicity changed.
14951
14952 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14953 for fringe update unless it has periodic bitmap.
14954
14955 2011-05-25 Kenichi Handa <handa@m17n.org>
14956
14957 * xdisp.c (get_next_display_element): Set correct it->face_id for
14958 a static composition.
14959
14960 2011-05-24 Leo Liu <sdl.web@gmail.com>
14961
14962 * deps.mk (fns.o):
14963 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14964
14965 * fns.c (crypto_hash_function, Fsha1): New function.
14966 (Fmd5): Use crypto_hash_function.
14967 (syms_of_fns): Add Ssha1.
14968
14969 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14970
14971 * gnutls.c: Remove unused macros.
14972 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14973 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14974 Remove macros that are defined and never used.
14975 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14976
14977 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14978
14979 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14980 (Fx_get_selection_internal): Minor cleanup.
14981 (Fx_own_selection_internal): Rename arguments for consistency with
14982 select.el.
14983
14984 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14985
14986 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14987
14988 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14989
14990 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14991
14992 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14993
14994 * dispnew.c (scrolling_window): Don't exclude the case that the
14995 last enabled row in the desired matrix touches the bottom boundary.
14996
14997 2011-05-21 Glenn Morris <rgm@gnu.org>
14998
14999 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15000 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15001 and add some more files.
15002
15003 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15004
15005 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15006 report_file_error introduced by the change from 2011-05-07.
15007
15008 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15009
15010 * systime.h (Time): Define only if emacs is defined.
15011 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15012 where the include path doesn't have X11/X.h by default. See
15013 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15014
15015 2011-05-20 Kenichi Handa <handa@m17n.org>
15016
15017 * composite.c (find_automatic_composition): Fix previous change.
15018
15019 2011-05-20 Glenn Morris <rgm@gnu.org>
15020
15021 * lisp.mk: New file, split from Makefile.in.
15022 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15023 (shortlisp): Remove.
15024 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15025
15026 2011-05-19 Glenn Morris <rgm@gnu.org>
15027
15028 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15029 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15030 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15031 (lisp): Set the order to that of loadup.el.
15032 (shortlisp): Make it a copy of $lisp.
15033 (SOME_MACHINE_LISP): Remove.
15034 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15035 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15036
15037 2011-05-18 Kenichi Handa <handa@m17n.org>
15038
15039 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15040 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15041 (find_automatic_composition): Mostly rewrite for efficiency.
15042
15043 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
15044
15045 * makefile.w32-in: Update dependencies.
15046
15047 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15048
15049 * menu.c: Include limits.h (fixes the MS-Windows build broken by
15050 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15051
15052 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
15053
15054 Fix some integer overflow issues, such as string length overflow.
15055
15056 * insdel.c (count_size_as_multibyte): Check for string overflow.
15057
15058 * character.c (lisp_string_width): Check for string overflow.
15059 Use EMACS_INT, not int, for string indexes and lengths; in
15060 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15061 the resulting string length overflows an EMACS_INT; instead,
15062 report a string overflow if no precision given. When checking for
15063 precision exhaustion, use a check that cannot possibly have
15064 integer overflow. (Bug#8675)
15065 * character.h (lisp_string_width): Adjust to new signature.
15066
15067 * alloc.c (string_overflow): New function.
15068 (Fmake_string): Use it. This doesn't change behavior, but saves
15069 a few bytes and will simplify future changes.
15070 * character.c (string_escape_byte8): Likewise.
15071 * lisp.h (string_overflow): New decl.
15072
15073 Fixups, following up to the user-interface timestamp change.
15074 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15075 for UI timestamps, instead of unsigned long.
15076 * msdos.c (mouse_get_pos): Likewise.
15077 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15078 * w32gui.h (Time): Define by including "systime.h" rather than by
15079 declaring it ourselves. (Bug#8664)
15080
15081 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15082 * image.c (clear_image_cache): Likewise.
15083
15084 * term.c (term_mouse_position): Don't assume time_t wraparound.
15085
15086 Be more systematic about user-interface timestamps.
15087 Before, the code sometimes used 'Time', sometimes 'unsigned long',
15088 and sometimes 'EMACS_UINT', to represent these timestamps.
15089 This change causes it to use 'Time' uniformly, as that's what X uses.
15090 This makes the code easier to follow, and makes it easier to catch
15091 integer overflow bugs such as Bug#8664.
15092 * frame.c (Fmouse_position, Fmouse_pixel_position):
15093 Use Time, not unsigned long, for user-interface timestamps.
15094 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15095 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15096 * keyboard.h (last_event_timestamp): Likewise.
15097 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15098 * menu.h (xmenu_show): Likewise.
15099 * term.c (term_mouse_position): Likewise.
15100 * termhooks.h (struct input_event.timestamp): Likewise.
15101 (struct terminal.mouse_position_hook): Likewise.
15102 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15103 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15104 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15105 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15106 what it was before.
15107 * menu.h, termhooks.h: Include "systime.h", for Time.
15108
15109 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15110 Don't assume that the difference between two unsigned long values
15111 can fit into an integer. At this point, we know button_down_time
15112 <= event->timestamp, so the difference must be nonnegative, so
15113 there's no need to cast the result if double-click-time is
15114 nonnegative, as it should be; check that it's nonnegative, just in
15115 case. This bug is triggered when events are more than 2**31 ms
15116 apart (about 25 days). (Bug#8664)
15117
15118 * xselect.c (last_event_timestamp): Remove duplicate decl.
15119 (x_own_selection): Remove needless cast to unsigned long.
15120
15121 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15122 that always fit in int. Use a sentinel instead of a counter, to
15123 avoid a temp and to allay GCC's concerns about possible int overflow.
15124 * frame.h (struct frame): Use int for menu_bar_items_used
15125 instead of EMACS_INT, since it always fits in int.
15126
15127 * menu.c (grow_menu_items): Check for int overflow.
15128
15129 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15130
15131 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15132 Before, the code was not consistent. These values cannot exceed
15133 2**31 - 1 so there's no need to make them unsigned.
15134 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15135 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15136 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15137 as modifiers.
15138 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15139
15140 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15141 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15142 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15143 presumably because the widths might not match.
15144
15145 * window.c (size_window): Avoid needless test at loop start.
15146
15147 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15148
15149 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15150
15151 2011-05-12 Drew Adams <drew.adams@oracle.com>
15152
15153 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15154
15155 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15156
15157 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15158 `width' to `bar_area_x' and `bar_area_width', respectively.
15159 (x_scroll_run): Take account of fringe background extension.
15160
15161 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15162 Rename local vars `left' and `width' to `bar_area_x' and
15163 `bar_area_width', respectively.
15164 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15165 background extension.
15166
15167 2011-05-10 Jim Meyering <meyering@redhat.com>
15168
15169 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15170
15171 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
15172
15173 * image.c (Finit_image_library): Return t for built-in image types,
15174 like pbm and xbm. (Bug#8640)
15175
15176 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15177
15178 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15179
15180 2011-05-07 Eli Zaretskii <eliz@gnu.org>
15181
15182 * w32console.c (Fset_screen_color): Doc fix.
15183 (Fget_screen_color): New function.
15184 (syms_of_ntterm): Defsubr it.
15185
15186 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15187 unlink the temporary file if Fcall_process didn't create it in the
15188 first place.
15189 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15190 child process will be redirected to a file specified with `:file'.
15191 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15192 cue to call_process_cleanup not to close that handle.
15193
15194 2011-05-07 Ben Key <bkey76@gmail.com>
15195
15196 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15197 one of two shell specific rules, either bootstrap-temacs-CMD or
15198 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15199 to the previous implementation of the bootstrap-temacs rule.
15200 The bootstrap-temacs-CMD rule is similar to the previous
15201 implementation of the bootstrap-temacs rule except that it
15202 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15203 variable.
15204
15205 These changes, along with some changes to nt/configure.bat,
15206 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15207 earlier fix to add support for --cflags and --ldflags options
15208 that include quotes so that it works whether make uses cmd or
15209 sh as the shell.
15210
15211 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
15212
15213 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15214 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15215 is a constant.
15216 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15217 a string. Handle both cases.
15218 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15219 (Fdbus_register_method): Use Qinvalid_function.
15220
15221 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15222
15223 * makefile.w32-in: Update dependencies.
15224 (LISP_H): Add inttypes.h and stdin.h.
15225 (PROCESS_H): Add unistd.h.
15226
15227 2011-05-06 Eli Zaretskii <eliz@gnu.org>
15228
15229 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15230 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15231
15232 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
15233
15234 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15235
15236 * term.c (vfatal): Remove stray call to va_end.
15237 It's not needed and the C Standard doesn't allow it here anyway.
15238
15239 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15240 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15241
15242 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15243 bytes.
15244
15245 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15246
15247 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15248
15249 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15250
15251 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15252
15253 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15254
15255 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15256 * charset.c (Fdefine_charset_internal): Don't initialize
15257 charset.code_space[15]. The value was garbage, on hosts with
15258 32-bit int (Bug#8600).
15259
15260 * lread.c (read_integer): Be more consistent with string-to-number.
15261 Use string_to_number to do the actual conversion; this avoids
15262 rounding errors and fixes some other screwups. Without this fix,
15263 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15264 (digit_to_number): Move earlier, for benefit of read_integer.
15265 Return -1 if the digit is out of range for the base, -2 if it is
15266 not a digit in any supported base. (Bug#8602)
15267
15268 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15269
15270 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15271 to match comment at start of function. This also removes a
15272 GCC warning about overflow in a 32+64-bit port.
15273
15274 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15275
15276 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15277 Reported by Stefan Monnier in
15278 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15279 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15280 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15281
15282 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15283 (EMACS_UINTPTR): Likewise, with uintptr_t.
15284
15285 * lisp.h: Prefer 64-bit EMACS_INT if available.
15286 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15287 on 32-bit hosts that have 64-bit int, so that they can access
15288 large files.
15289 However, temporarily disable this change unless the temporary
15290 symbol WIDE_EMACS_INT is defined.
15291
15292 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15293
15294 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15295 This removes an assumption that EMACS_INT and long are the same
15296 width as pointers. The assumption is true for Emacs porting targets
15297 now, but we want to make other targets possible.
15298 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15299 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15300 In the rest of the code, change types of integers that hold casted
15301 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15302 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15303 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15304 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15305 No need to cast type when ORing.
15306 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15307 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15308 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15309 assume EMACS_INT is the same width as char *.
15310 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15311 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15312 Remove no-longer-needed casts.
15313 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15314 (xg_tool_bar_help_callback, xg_make_tool_item):
15315 Use EMACS_INTPTR to hold an integer
15316 that will be cast to void *; this can avoid a GCC warning
15317 if EMACS_INT is not the same width as void *.
15318 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15319 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15320 (current_message_1, set_message_1):
15321 Use a local to convert to proper width without a cast.
15322 * xmenu.c (dialog_selection_callback): Likewise.
15323
15324 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15325 Also, don't assume VALBITS / RAND_BITS is less than 5,
15326 and don't rely on undefined behavior when shifting a 1 left into
15327 the sign bit.
15328 * lisp.h (get_random): Change signature to match.
15329
15330 * lread.c (hash_string): Use size_t, not int, for hash computation.
15331 Normally we prefer signed values; but hashing is special, because
15332 it's better to use unsigned division on hash table sizes so that
15333 the remainder is nonnegative. Also, size_t is the natural width
15334 for hashing into memory. The previous code used 'int', which doesn't
15335 retain enough info to hash well into very large tables.
15336 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15337
15338 * dbusbind.c: Don't possibly lose pointer info when converting.
15339 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15340 Use XPNTR rather than XHASH, so that the high-order bits of
15341 the pointer aren't lost when converting through void *.
15342
15343 * eval.c (Fautoload): Don't double-shift a pointer.
15344
15345 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15346
15347 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15348
15349 * gnutls.c (DEF_GNUTLS_FN):
15350 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15351
15352 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15353
15354 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15355 marker. (Bug#8610)
15356
15357 2011-05-05 Eli Zaretskii <eliz@gnu.org>
15358
15359 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15360 New version that can reserve upto 2GB of heap space.
15361
15362 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
15363
15364 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15365
15366 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15367
15368 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15369 `gnutls_certificate_set_x509_key_file'.
15370
15371 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
15372
15373 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15374 Update dependencies.
15375
15376 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15377
15378 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15379 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15380 Remove unused parameter `fildes'.
15381 * process.c (read_process_output, send_process): Don't pass it.
15382
15383 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15384
15385 Fix previous change: the library cache is defined in w32.c.
15386 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15387 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15388
15389 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15390
15391 Implement dynamic loading of GnuTLS on Windows.
15392
15393 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15394 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15395 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15396 Declare.
15397
15398 * gnutls.c (Qgnutls_dll): Define.
15399 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15400 (gnutls_*): Declare function pointers.
15401 (init_gnutls_functions): New function to initialize function pointers.
15402 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15403 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15404 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15405 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15406 (emacs_gnutls_write, emacs_gnutls_read)
15407 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15408 (Fgnutls_available_p): New function.
15409 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15410 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15411 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15412
15413 * image.c: Include w32.h.
15414 (Vimage_type_cache): Delete.
15415 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15416 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15417 (w32_delayed_load): Move to w32.c.
15418
15419 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15420
15421 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15422 (w32_delayed_load): Move from image.c. When loading a library, record
15423 its filename in the :loaded-from property of the library id.
15424 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15425 Initialize and staticpro them.
15426 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15427
15428 * process.c: Include lisp.h before w32.h, not after.
15429 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15430 instead of gnutls_record_check_pending.
15431
15432 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15433
15434 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15435
15436 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15437 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15438 as passed in.
15439
15440 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15441
15442 * xterm.c (x_set_frame_alpha): Do not set property on anything
15443 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15444
15445 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15446
15447 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15448
15449 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15450
15451 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15452 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15453 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15454 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15455 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15456 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15457 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15458 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15459 (Qgnutls_bootprop_callbacks_verify): Make static.
15460
15461 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15462
15463 * callproc.c: Indentation fixup.
15464
15465 * sysdep.c (wait_for_termination_1): Make static.
15466 (wait_for_termination, interruptible_wait_for_termination):
15467 Move after wait_for_termination_1.
15468
15469 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15470
15471 * sysdep.c (interruptible_wait_for_termination): New function
15472 which is like wait_for_termination, but allows keyboard
15473 interruptions.
15474
15475 * callproc.c (Fcall_process): Add (:file "file") as an option for
15476 the STDOUT buffer.
15477 (Fcall_process_region): Ditto.
15478
15479 2011-04-30 Eli Zaretskii <eliz@gnu.org>
15480
15481 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15482 rather than `XVECTOR (FOO)->size'.
15483
15484 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15485 inttypes.h, as a gnulib replacement is used if it not available in
15486 system headers.
15487
15488 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15489
15490 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15491 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15492 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15493
15494 * coding.c (coding_alloc_by_realloc): Error out if destination
15495 will grow beyond MOST_POSITIVE_FIXNUM.
15496 (decode_coding_emacs_mule): Abort if there isn't enough place in
15497 charbuf for the composition carryover bytes. Reserve an extra
15498 space for up to 2 characters produced in a loop.
15499 (decode_coding_iso_2022): Abort if there isn't enough place in
15500 charbuf for the composition carryover bytes.
15501
15502 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15503
15504 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15505 aborting when %lld or %lll format is passed.
15506 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15507 %llo or %llx format is passed. (Bug#8545)
15508
15509 * window.c (window_scroll_line_based): Use a marker instead of
15510 simple variables to record original value of point. (Bug#7952)
15511
15512 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15513 produced by %s or %c overflows available buffer space. (Bug#8545)
15514
15515 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15516
15517 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15518 (SIZE_MAX): Move defn after all includes, as they might #define it.
15519
15520 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15521
15522 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15523
15524 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15525
15526 * keyboard.c (Qdelayed_warnings_hook): Define.
15527 (command_loop_1): Run `delayed-warnings-hook'
15528 if Vdelayed_warnings_list is non-nil.
15529 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15530 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15531
15532 2011-04-28 Eli Zaretskii <eliz@gnu.org>
15533
15534 * doprnt.c (doprnt): Don't return value smaller than the buffer
15535 size if the message was truncated. (Bug#8545).
15536
15537 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15538
15539 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15540 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15541
15542 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15543
15544 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15545
15546 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
15547
15548 * makefile.w32-in: Update dependencies.
15549
15550 2011-04-27 Eli Zaretskii <eliz@gnu.org>
15551
15552 Improve `doprnt' and its usage. (Bug#8545)
15553 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15554 `format_end'. Remove support for %l as a conversion specifier.
15555 Don't use xrealloc. Improve diagnostics when the %l size modifier
15556 is used. Update the commentary.
15557
15558 * eval.c (verror): Simplify calculation of size_t.
15559
15560 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15561 messages.
15562
15563 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15564
15565 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15566 change.
15567
15568 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15569
15570 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15571 This makes this file independent of the recent pseudovector change.
15572
15573 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
15574
15575 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15576
15577 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15578 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15579 Remove unused local.
15580 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15581
15582 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
15583 GCC 4.6.0 optimizes based on type-based alias analysis.
15584 For example, if b is of type struct buffer * and v of type struct
15585 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15586 != &v->size, and therefore "v->size = 1; b->size = 2; return
15587 v->size;" must therefore return 1. This assumption is incorrect
15588 for Emacs, since it type-puns struct Lisp_Vector * with many other
15589 types. To fix this problem, this patch adds a new type struct
15590 vectorlike_header that documents the constraints on layout of vectors
15591 and pseudovectors, and helps optimizing compilers not get fooled
15592 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15593 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15594 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15595 the size member.
15596 (XSETPVECTYPE): Rewrite in terms of new macro.
15597 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15598 This is a bit clearer, and further avoids the possibility of
15599 undesirable aliasing.
15600 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15601 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15602 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15603 since Lisp_Subr is a special case (no "next" field).
15604 (ASIZE): Now uses header.size rather than size.
15605 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15606 to avoid the hassle of writing XVECTOR (foo)->header.size.
15607 (struct vectorlike_header): New type.
15608 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15609 object, to help avoid aliasing.
15610 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15611 (SUBRP): Likewise, since Lisp_Subr is a special case.
15612 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15613 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15614 (struct Lisp_Hash_Table): Combine first two members into a single
15615 struct vectorlike_header member. All uses of "size" and "next" members
15616 changed to be "header.size" and "header.next".
15617 * buffer.h (struct buffer): Likewise.
15618 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15619 * frame.h (struct frame): Likewise.
15620 * process.h (struct Lisp_Process): Likewise.
15621 * termhooks.h (struct terminal): Likewise.
15622 * window.c (struct save_window_data, struct saved_window): Likewise.
15623 * window.h (struct window): Likewise.
15624 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15625 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15626 * buffer.c (init_buffer_once): Likewise.
15627 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15628 special case.
15629 * process.c (Fformat_network_address): Use local var for size,
15630 for brevity.
15631
15632 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15633
15634 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15635 * data.c (atof): Remove decl; no longer used or needed.
15636 (digit_to_number): Move to lread.c.
15637 (Fstring_to_number): Use new string_to_number function, to be
15638 consistent with how the Lisp reader treats infinities and NaNs.
15639 Do not assume that floating-point numbers represent EMACS_INT
15640 without losing information; this is not true on most 64-bit hosts.
15641 Avoid double-rounding errors, by insisting on integers when
15642 parsing non-base-10 numbers, as the documentation specifies.
15643 * lisp.h (string_to_number): New decl, replacing ...
15644 (isfloat_string): Remove.
15645 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15646 (read1): Do not accept +. and -. as integers; this
15647 appears to have been a coding error. Similarly, do not accept
15648 strings like +-1e0 as floating point numbers. Do not report
15649 overflow for integer overflows unless the base is not 10 which
15650 means we have no simple and reliable way to continue.
15651 Break out the floating-point parsing into a new
15652 function string_to_number, so that Fstring_to_number parses
15653 floating point numbers consistently with the Lisp reader.
15654 (digit_to_number): Move here from data.c. Make it static inline.
15655 (E_CHAR, EXP_INT): Remove, replacing with ...
15656 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15657 (string_to_number): New function, replacing isfloat_string.
15658 This function checks for valid syntax and produces the resulting
15659 Lisp float number too. Rework it so that string-to-number
15660 no longer mishandles examples like "1.0e+". Use strtoumax,
15661 so that overflow for non-base-10 numbers is reported only when
15662 there's no portable and simple way to convert to floating point.
15663
15664 * textprop.c (set_text_properties_1): Rewrite for clarity,
15665 and to avoid GCC warning about integer overflow.
15666
15667 * intervals.h (struct interval): Use EMACS_INT for members
15668 where EMACS_UINT might cause problems. See
15669 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15670 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15671 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15672 All uses changed.
15673 (offset_intervals): Tell GCC not to worry about length overflow
15674 when negating a negative length.
15675
15676 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15677 (overrun_check_free): Likewise.
15678
15679 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15680 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15681 word size.
15682
15683 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15684 (gnutls_make_error): Rename local to avoid shadowing.
15685 (gnutls_emacs_global_deinit): ifdef out; not used.
15686 (Fgnutls_boot): Use const for pointer to readonly storage.
15687 Comment out unused local. Fix pointer signedness problems.
15688
15689 * lread.c (openp): Don't stuff size_t into an 'int'.
15690 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15691 about possible signed overflow.
15692
15693 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15694 (GDK_KEY_g): Don't define if already defined.
15695 (xg_prepare_tooltip): Avoid pointer signedness problem.
15696 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15697
15698 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15699 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15700
15701 * xfns.c (Fx_window_property): Simplify a bit,
15702 to make a bit faster and to avoid GCC 4.6.0 warning.
15703 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15704
15705 * fns.c (internal_equal): Don't assume size_t fits in int.
15706
15707 * alloc.c (compact_small_strings): Tighten assertion a little.
15708
15709 Replace pEd with more-general pI, and fix some printf arg casts.
15710 * lisp.h (pI): New macro, generalizing old pEd macro to other
15711 conversion specifiers. For example, use "...%"pI"d..." rather
15712 than "...%"pEd"...".
15713 (pEd): Remove. All uses replaced with similar uses of pI.
15714 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15715 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15716 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15717 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15718 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15719 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15720 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15721 64-bit hosts.
15722 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15723 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15724 * print.c (safe_debug_print, print_object): Likewise.
15725 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15726 to int.
15727 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15728 avoiding the 0 flag, which is not portable.
15729 * process.c (Fmake_network_process): Use pI to avoid cast.
15730 * region-cache.c (pp_cache): Likewise.
15731 * xdisp.c (decode_mode_spec): Likewise.
15732 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15733 behavior on 64-bit hosts with printf arg.
15734 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15735 (x_stop_queuing_selection_requests): Likewise.
15736 (x_get_window_property): Don't truncate byte count to an 'int'
15737 when tracing.
15738
15739 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15740 here, since it parses constructs like leading '-' and spaces,
15741 which are not wanted; and it overflows with large numbers.
15742 Instead, simply match F[0-9]+, which is what is wanted anyway.
15743
15744 * alloc.c: Remove unportable assumptions about struct layout.
15745 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15746 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15747 (allocate_vectorlike, make_pure_vector): Use the new macros,
15748 plus offsetof, to remove unportable assumptions about struct layout.
15749 These assumptions hold on all porting targets that I know of, but
15750 they are not guaranteed, they're easy to remove, and removing them
15751 makes further changes easier.
15752
15753 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15754 This doesn't fix a bug but makes the code clearer.
15755 (string_overrun_cookie): Now const. Use initializers that
15756 don't formally overflow signed char, to avoid warnings.
15757 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15758 can cause Emacs to crash when string overrun checking is enabled.
15759 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15760 multiple of sizeof (EMACS_INT); it need not be, if
15761 alignof(EMACS_INT) < sizeof (EMACS_INT).
15762 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15763
15764 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
15765
15766 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15767
15768 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15769
15770 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15771 supposed to be handshaking. (Bug#8556)
15772 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15773
15774 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15775
15776 * lisp.h (Qdebug): List symbol.
15777 * eval.c (Qdebug): Restore global linkage.
15778 * keyboard.c (debug-on-event): New variable.
15779 (handle_user_signal): Break into debugger when debug-on-event
15780 matches the current signal symbol.
15781
15782 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15783
15784 * alloc.c (check_sblock, check_string_bytes)
15785 (check_string_free_list): Convert to standard C.
15786
15787 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15788
15789 * w32.c (emacs_gnutls_push): Fix typo.
15790
15791 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15792
15793 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15794 "cast to pointer from integer of different size".
15795
15796 Improve doprnt and its use in verror. (Bug#8545)
15797 * doprnt.c (doprnt): Document the set of format control sequences
15798 supported by the function. Use SAFE_ALLOCA instead of always
15799 using `alloca'.
15800
15801 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15802 is one byte too soon. Don't use xrealloc; instead xfree and
15803 xmalloc anew.
15804
15805 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15806
15807 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15808 callbacks stage.
15809
15810 * gnutls.c: Renamed global_initialized to
15811 gnutls_global_initialized. Added internals for the
15812 :verify-hostname-error, :verify-error, and :verify-flags
15813 parameters of `gnutls-boot' and documented those parameters in the
15814 docstring. Start callback support.
15815 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15816 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15817 on error. Return error code.
15818 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15819 (emacs_gnutls_read): Likewise.
15820 (Fgnutls_boot): Return handshake error code.
15821 (emacs_gnutls_handle_error): New function.
15822 (wsaerror_to_errno): Likewise.
15823
15824 * w32.h (emacs_gnutls_pull): Add prototype.
15825 (emacs_gnutls_push): Likewise.
15826
15827 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15828 (emacs_gnutls_push): Likewise.
15829
15830 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15831
15832 * process.c (wait_reading_process_output): Check if GnuTLS
15833 buffered some data internally if no FDs are set for TLS
15834 connections.
15835
15836 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15837 (LIBS): Link to USER_LIBS.
15838 ($(BLD)/gnutls.$(0)): New target.
15839
15840 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15841
15842 * xdisp.c (handle_single_display_spec): Rename the
15843 display_replaced_before_p argument into display_replaced_p, to
15844 make it consistent with the commentary. Fix typos in the
15845 commentary.
15846
15847 * textprop.c (syms_of_textprop): Remove dead code.
15848 (copy_text_properties): Delete obsolete commentary about an
15849 interface that was deleted long ago. Fix typos in the description
15850 of arguments.
15851
15852 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15853 to changes in oldXMenu/XMenu.h from 2011-04-16.
15854 <menu_help_message, prev_menu_help_message>: Constify.
15855 (IT_menu_make_room): menu->help_text is now `const char **';
15856 adjust.
15857
15858 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15859 to changes in oldXMenu/XMenu.h from 2011-04-16.
15860 (struct XMenu): Declare `help_text' `const char **'.
15861
15862 * xfaces.c <Qunspecified>: Make extern again.
15863
15864 * syntax.c: Include sys/types.h before including regex.h, as
15865 required by POSIX.
15866
15867 * doc.c (get_doc_string): Improve the format passed to `error'.
15868
15869 * doprnt.c (doprnt): Improve commentary.
15870
15871 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15872
15873 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15874 them with etags.
15875
15876 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15877 changes in globals.h immediately force recompilation.
15878 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15879 $(CURDIR)/s/ms-w32.h.
15880 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15881
15882 * character.c (Fchar_direction): Function deleted.
15883 (syms_of_character): Don't defsubr it.
15884 <char-direction-table>: Deleted.
15885
15886 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15887
15888 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15889 * doprnt.c: Include limits.h.
15890 (SIZE_MAX): New macro.
15891 (doprnt): Return a size_t value. 2nd arg is now size_t.
15892 Many local variables are now size_t instead of int or unsigned.
15893 Improve overflow protection. Support `l' modifier for integer
15894 conversions. Support %l conversion. Don't assume an EMACS_INT
15895 argument for integer conversions and for %c.
15896
15897 * lisp.h (doprnt): Restore prototype.
15898
15899 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15900 $(SRC)/character.h.
15901
15902 * Makefile.in (base_obj): Add back doprnt.o.
15903
15904 * deps.mk (doprnt.o): Add back prerequisites.
15905 (callint.o): Depend on character.h.
15906
15907 * eval.c (internal_lisp_condition_case): Include the handler
15908 representation in the error message.
15909 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15910 when breaking from the loop.
15911
15912 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15913
15914 * callint.c (Fcall_interactively): When displaying error message
15915 about invalid control letter, pass the character's codepoint, not
15916 a pointer to its multibyte form. Improve display of the character
15917 in octal and display also its hex code.
15918
15919 * character.c (char_string): Use %x to display the (unsigned)
15920 codepoint of an invalid character, to avoid displaying a bogus
15921 negative value.
15922
15923 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15924 `error', not SYMBOL_NAME itself.
15925
15926 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15927 character arguments to `error'.
15928
15929 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15930 to `error' in error message about FINAL_CHAR argument. Make sure
15931 FINAL_CHAR is a character, and use %c when it is passed as
15932 argument to `error'.
15933
15934 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15935
15936 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15937
15938 * w32.c: Include <time.h>.
15939 (sys_localtime): New function.
15940
15941 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15942
15943 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15944
15945 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15946
15947 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15948
15949 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15950 zombies (Bug#8467).
15951
15952 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15953
15954 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15955 gl_state.e_property when gl_state.object is Qt.
15956
15957 * insdel.c (make_gap_larger): Remove limitation of buffer size
15958 to <= INT_MAX.
15959
15960 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15961
15962 * xdisp.c (lookup_glyphless_char_display)
15963 (produce_glyphless_glyph): Handle cons cell entry in
15964 glyphless-char-display.
15965 (Vglyphless_char_display): Document it.
15966
15967 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15968 glyphless-char-display.
15969
15970 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15971
15972 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15973
15974 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15975
15976 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15977 definition for no-X builds.
15978
15979 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15980
15981 Static checks with GCC 4.6.0 and non-default toolkits.
15982
15983 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15984
15985 * process.c (keyboard_bit_set): Define only if SIGIO.
15986 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15987 (send_process): Repair possible setjmp clobbering.
15988
15989 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15990
15991 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15992
15993 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15994
15995 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15996 Define only if needed.
15997
15998 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15999 by pacifying GCC about it. Maybe it's time to retire it?
16000 * xfaces.c (USG, __TIMEVAL__): Likewise.
16001
16002 * dispextern.h (struct redisplay_interface): Rename param
16003 to avoid shadowing.
16004 * termhooks.h (struct terminal): Likewise.
16005 * xterm.c (xembed_send_message): Likewise.
16006
16007 * insdel.c (make_gap_smaller): Define only if
16008 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16009
16010 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16011 it.
16012
16013 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16014 so that we aren't warned about unused symbols.
16015
16016 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16017
16018 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16019
16020 * xfns.c (x_real_positions): Mark locals as initialized.
16021
16022 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16023
16024 * xterm.c: Fix problems found by static analysis with other toolkits.
16025 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16026 (x_dispatch_event): Declare static if USE_GTK, and
16027 define if USE_GTK || USE_X_TOOLKIT.
16028 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16029 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16030 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16031 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16032
16033 * xmenu.c (menu_help_callback): Pointer type fixes.
16034 Use const pointers when pointing at readonly data. Avoid pointer
16035 signedness clashes.
16036 (FALSE): Remove unused macro.
16037 (update_frame_menubar): Remove unused decl.
16038
16039 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16040
16041 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16042 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16043 (single_menu_item): Rename local to avoid shadowing.
16044
16045 * keyboard.c (make_lispy_event): Remove unused local var.
16046
16047 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16048 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16049
16050 * bitmaps: Change bitmaps from unsigned char back to the X11
16051 compatible char. Avoid the old compiler warnings about
16052 out-of-range initializers by using, for example, '\xab' rather
16053 than 0xab.
16054
16055 * xgselect.c (xgselect_initialize): Check vs interface
16056 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16057
16058 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16059
16060 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16061 to read-only memory.
16062
16063 * fns.c (vector): Remove; this old hack is no longer needed.
16064
16065 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16066 Remove unused var.
16067 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16068
16069 * xrdb.c (x_load_resources): Omit unused local.
16070
16071 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16072 (x_window): Rename locals to avoid shadowing.
16073 (USG): Use the kludged USG macro, to pacify gcc.
16074
16075 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16076 (x_term_init): Remove local to avoid shadowing.
16077
16078 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16079
16080 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16081 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16082
16083 2011-04-16 Eli Zaretskii <eliz@gnu.org>
16084
16085 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16086
16087 Fix regex.c, syntax.c and friends for buffers > 2GB.
16088 * syntax.h (struct gl_state_s): Declare character position members
16089 EMACS_INT.
16090
16091 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16092
16093 * textprop.c (verify_interval_modification, interval_of):
16094 Declare arguments EMACS_INT.
16095
16096 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16097 EMACS_INT.
16098
16099 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16100
16101 * indent.c (Fvertical_motion): Local variable it_start is now
16102 EMACS_INT.
16103
16104 * regex.c (re_match, re_match_2, re_match_2_internal)
16105 (bcmp_translate, regcomp, regexec, print_double_string)
16106 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16107 (re_compile_pattern, re_exec): Declare arguments and local
16108 variables `size_t' and `ssize_t' and return values `regoff_t', as
16109 appropriate.
16110 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16111 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16112 <compile_stack_type>: `size' and `avail' are now `size_t'.
16113
16114 * regex.h <regoff_t>: Use ssize_t, not int.
16115 (re_search, re_search_2, re_match, re_match_2): Arguments that
16116 specify buffer/string position and length are now ssize_t and
16117 size_t. Return type is regoff_t.
16118
16119 2011-04-16 Ben Key <bkey76@gmail.com>
16120
16121 * nsfont.m: Fixed bugs in ns_get_family and
16122 ns_descriptor_to_entity that were caused by using free to
16123 deallocate memory blocks that were allocated by xmalloc (via
16124 xstrdup). This caused Emacs to crash when compiled with
16125 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16126 --enable-checking=xmallocoverrun). xfree is now used to
16127 deallocate these memory blocks.
16128
16129 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
16130
16131 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16132
16133 emacs_write: Accept and return EMACS_INT for sizes.
16134 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16135 et seq.
16136 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16137 Accept and return EMACS_INT.
16138 (emacs_gnutls_write): Return the number of bytes written on
16139 partial writes.
16140 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16141 (emacs_read, emacs_write): Remove check for negative size, as the
16142 Emacs source code has been audited now.
16143 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16144 (emacs_read, emacs_write): Use it.
16145 * process.c (send_process): Adjust to the new signatures of
16146 emacs_write and emacs_gnutls_write. Do not attempt to store
16147 a byte offset into an 'int'; it might overflow.
16148 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16149
16150 * sound.c: Don't assume sizes fit in 'int'.
16151 (struct sound_device.period_size, alsa_period_size):
16152 Return EMACS_INT, not int.
16153 (struct sound_device.write, vox_write, alsa_write):
16154 Accept EMACS_INT, not int.
16155 (wav_play, au_play): Use EMACS_INT to store sizes and to
16156 record read return values.
16157
16158 2011-04-15 Ben Key <bkey76@gmail.com>
16159
16160 * keyboard.c (Qundefined): Don't declare static since it is used
16161 in nsfns.m.
16162 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16163 static since they are used in nsfont.m.
16164
16165 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16166
16167 * process.c (Qprocessp): Don't declare static.
16168 * lisp.h (Qprocessp): Declare again.
16169
16170 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
16171
16172 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16173
16174 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16175
16176 Improve C-level modularity by making more things 'static'.
16177
16178 Don't publish debugger-only interfaces to other modules.
16179 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16180 (verify_bytepos, count_markers): Move decls to the only modules
16181 that need them.
16182 * region-cache.h (pp_cache): Likewise.
16183 * window.h (check_all_windows): Likewise.
16184 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16185
16186 * sysdep.c (croak): Now static, if
16187 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16188 * syssignal.h (croak): Declare only if not static.
16189
16190 * alloc.c (refill_memory_reserve): Now static if
16191 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16192 * lisp.h (refill_memory_reserve): Declare only if not static.
16193
16194 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16195 Define only if USE_LUCID.
16196
16197 * xrdb.c (x_customization_string, x_rm_string): Now static.
16198
16199 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16200 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16201
16202 * xdisp.c (draw_row_with_mouse_face): Now static.
16203 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16204
16205 * window.h (check_all_windows): Mark externally visible.
16206
16207 * window.c (window_deletion_count): Now static.
16208
16209 * undo.c: Make symbols static if they're not exported.
16210 (last_undo_buffer, last_boundary_position, pending_boundary):
16211 Now static.
16212
16213 * textprop.c (interval_insert_behind_hooks): Now static.
16214 (interval_insert_in_front_hooks): Likewise.
16215
16216 * term.c: Make symbols static if they're not exported.
16217 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16218 (max_frame_lines, tty_set_terminal_modes):
16219 (tty_reset_terminal_modes, tty_turn_off_highlight):
16220 (get_tty_terminal): Now static.
16221 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16222 * termhooks.h (term_mouse_moveto): Do not declare if
16223 HAVE_WINDOW_SYSTEM.
16224 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16225 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16226
16227 * sysdep.c: Make symbols static if they're not exported.
16228 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16229 Now static.
16230 (sigprocmask_set, full_mask): Remove; unused.
16231 (wait_debugging): Mark as visible.
16232 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16233 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16234
16235 * syntax.c (syntax_temp): Define only if !__GNUC__.
16236
16237 * sound.c (current_sound_device, current_sound): Now static.
16238
16239 * search.c (searchbufs, searchbuf_head): Now static.
16240
16241 * scroll.c (scroll_cost): Remove; unused.
16242 * dispextern.h (scroll_cost): Remove decl.
16243
16244 * region-cache.h (pp_cache): Mark as externally visible.
16245
16246 * process.c: Make symbols static if they're not exported.
16247 (process_tick, update_tick, create_process, chan_process):
16248 (Vprocess_alist, proc_buffered_char, datagram_access):
16249 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16250 (deactivate_process): Mark defn as static, as well as decl.
16251 * lisp.h (create_process): Remove decl.
16252 * process.h (chan_process, Vprocess_alist): Remove decls.
16253
16254 * print.c: Make symbols static if they're not exported.
16255 (print_depth, new_backquote_output, being_printed, print_buffer):
16256 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16257 (print_interval, print_number_index, initial_stderr_stream):
16258 Now static.
16259 * lisp.h (Fprinc): Remove decl.
16260 (debug_output_compilation_hack): Mark as externally visible.
16261
16262 * sysdep.c (croak): Move decl from here to syssignal.h.
16263 * syssignal.h (croak): Put it here, so the API can be checked when
16264 'croak' is called from dissociate_if_controlling_tty.
16265
16266 * minibuf.c: Make symbols static if they're not exported.
16267 (minibuf_save_list, choose_minibuf_frame): Now static.
16268 * lisp.h (choose_minibuf_frame): Remove decl.
16269
16270 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16271
16272 * lread.c: Make symbols static if they're not exported.
16273 (read_objects, initial_obarray, oblookup_last_bucket_number):
16274 Now static.
16275 (make_symbol): Remove; unused.
16276 * lisp.h (initial_obarray, make_symbol): Remove decls.
16277
16278 * keyboard.c: Make symbols static if they're not exported.
16279 (single_kboard, recent_keys_index, total_keys, recent_keys):
16280 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16281 (this_single_command_key_start, echoing, last_auto_save):
16282 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16283 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16284 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16285 (Vlispy_mouse_stem, double_click_count):
16286 Now static.
16287 (force_auto_save_soon): Define only if SIGDANGER.
16288 (ignore_mouse_drag_p): Now static if
16289 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16290 (print_help): Remove; unused.
16291 (stop_character, last_timer_event): Mark as externally visible.
16292 * keyboard.h (ignore_mouse_drag_p): Declare only if
16293 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16294 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16295 * lisp.h (echoing): Remove decl.
16296 (force_auto_save_soon): Declare only if SIGDANGER.
16297 * xdisp.c (redisplay_window): Simplify code, to make it more
16298 obvious that ignore_mouse_drag_p is not accessed if !defined
16299 USE_GTK && !defined HAVE_NS.
16300
16301 * intervals.c: Make symbols static if they're not exported.
16302 (merge_properties_sticky, merge_interval_right, delete_interval):
16303 Now static.
16304 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16305
16306 * insdel.c: Make symbols static if they're not exported.
16307 However, leave prepare_to_modify_buffer alone. It's never
16308 called from outside this function, but that appears to be a bug.
16309 (combine_after_change_list, combine_after_change_buffer):
16310 (adjust_after_replace, signal_before_change): Now static.
16311 (adjust_after_replace_noundo): Remove; unused.
16312 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16313 (signal_before_change): Remove decls.
16314
16315 * indent.c (val_compute_motion, val_vmotion): Now static.
16316
16317 * image.c: Make symbols static if they're not exported.
16318 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16319 if USE_GTK.
16320 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16321 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16322
16323 * fringe.c (standard_bitmaps): Now static.
16324 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16325
16326 * frame.c: Make symbols static if they're not exported.
16327 (x_report_frame_params, make_terminal_frame): Now static.
16328 (get_frame_param): Now static, unless HAVE_NS.
16329 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16330 (x_get_resource_string): Remove; not used.
16331 * frame.h (make_terminal_frame, x_report_frame_params):
16332 (x_get_resource_string); Remove decls.
16333 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16334 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16335
16336 * font.c, fontset.c: Make symbols static if they're not exported.
16337 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16338 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16339 * font.c (font_close_object): Now static.
16340 * font.h (font_close_object): Remove.
16341 * fontset.c (FONTSET_OBJLIST): Remove.
16342 (free_realized_fontset) #if-0 the body, which does nothing.
16343 (face_suitable_for_char_p): #if-0, as it's never called.
16344 * fontset.h (face_suitable_for_char_p): Remove decl.
16345 * xfaces.c (face_at_string_position):
16346 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16347 since 0 is always ASCII.
16348
16349 * fns.c (weak_hash_tables): Now static.
16350
16351 * fileio.c: Make symbols static if they're not exported.
16352 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16353 (Vwrite_region_annotation_buffers): Now static.
16354
16355 * eval.c: Make symbols static if they're not exported.
16356 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16357 * lisp.h (backtrace_list): Remove decl.
16358
16359 * emacs.c: Make symbols static if they're not exported.
16360 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16361 (fatal_error_code, fatal_error_signal_hook, standard_args):
16362 Now static.
16363 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16364 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16365 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16366 * lisp.h (fatal_error_signal_hook): Remove decl.
16367 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16368
16369 * editfns.c: Move a (normally-unused) function to its only use.
16370 * editfns.c, lisp.h (get_operating_system_release): Remove.
16371 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16372 worth the hassle of breaking this out.
16373
16374 * xterm.c: Make symbols static if they're not exported.
16375 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16376 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16377 (x_destroy_window, x_delete_display):
16378 Now static.
16379 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16380 (x_mouse_leave): Remove; unused.
16381 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16382 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16383 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16384 Remove decls.
16385 (x_mouse_leave): Declare only if WINDOWSNT.
16386 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16387 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16388 USE_X_TOOLKIT.
16389
16390 * ftxfont.c: Make symbols static if they're not exported.
16391 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16392 HAVE_FREETYPE.
16393 * font.h (ftxfont_driver): Likewise.
16394
16395 * xfns.c: Make symbols static if they're not exported.
16396 (x_last_font_name, x_display_info_for_name):
16397 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16398 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16399 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16400 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16401 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16402 (last_show_tip_args): Now static.
16403 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16404 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16405 (x_screen_planes): Remove; unused.
16406 * dispextern.h (x_screen_planes): Remove decl.
16407
16408 * dispnew.c: Make symbols static if they're not exported.
16409 * dispextern.h (redraw_garbaged_frames, scrolling):
16410 (increment_row_positions): Remove.
16411 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16412 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16413 Now static.
16414 (redraw_garbaged_frames): Remove; unused.
16415
16416 * xfaces.c: Make symbols static if they're not exported.
16417 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16418 Remove decls.
16419 * xterm.h (defined_color): Remove decls.
16420 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16421 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16422 (menu_face_changed_default, defined_color, free_realized_face):
16423 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16424 (ascii_face_of_lisp_face): Remove; unused.
16425
16426 * xdisp.c: Make symbols static if they're not exported.
16427 * dispextern.h (scratch_glyph_row, window_box_edges):
16428 (glyph_to_pixel_coords, set_cursor_from_row):
16429 (get_next_display_element, set_iterator_to_next):
16430 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16431 (show_mouse_face): Remove decls
16432 * frame.h (message_buf_print): Likewise.
16433 * lisp.h (pop_message, set_message, check_point_in_composition):
16434 Likewise.
16435 * xterm.h (set_vertical_scroll_bar): Likewise.
16436 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16437 (message_buf_print, scratch_glyph_row, displayed_buffer):
16438 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16439 (get_next_display_element, show_mouse_face, window_box_edges):
16440 (frame_to_window_pixel_xy, check_point_in_composition):
16441 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16442 (glyph_to_pixel_coords): Remove; unused.
16443
16444 * dired.c (file_name_completion): Now static.
16445
16446 * dbusbind.c (xd_in_read_queued_messages): Now static.
16447
16448 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16449 * data.c (circular_list_error): Remove.
16450
16451 * commands.h (last_point_position, last_point_position_buffer):
16452 (last_point_position_window): Remove decls.
16453 * keyboard.c: Make these variables static.
16454
16455 * coding.h (coding, code_convert_region, encode_coding_gap):
16456 Remove decls.
16457 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16458 (iso_code_class, detect_coding, code_convert_region): Now static.
16459 (encode_coding_gap): Remove; unused.
16460
16461 * chartab.c (chartab_chars, chartab_bits): Now static.
16462
16463 * charset.h (charset_iso_8859_1): Remove decl.
16464 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16465 Now static.
16466
16467 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16468 * ccl.c (Vccl_program_table): Now static.
16469 (check_ccl_update): Remove; unused.
16470
16471 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16472 * category.h: ... from here.
16473 * category.c (check_category_table, set_category_set): Now static.
16474
16475 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16476 * lisp.h: Remove these decls.
16477
16478 * buffer.c (buffer_count): Remove unused var.
16479
16480 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16481 so that it's not optimized away.
16482 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16483 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16484 exported only to the debugger.
16485
16486 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16487 * atimer.h (run_all_atimers): Remove; not exported.
16488
16489 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16490 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16491 was inaccessible from Lisp.
16492 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16493 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16494
16495 alloc.c: Import and export fewer symbols, and remove unused items.
16496 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16497 is defined.
16498 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16499 it's not optimized away by whole-program optimization.
16500 (message_enable_multibyte, free_misc): Remove.
16501 (catchlist, handlerlist, mark_backtrace):
16502 Declare only if BYTE_MARK_STACK.
16503 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16504 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16505 (message_enable_multibyte): Remove decl.
16506 (free_misc, interval_free_list, float_block, float_block_index):
16507 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16508 (cons_free_list, last_marked_index):
16509 Now static.
16510 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16511 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16512 (mark_backtrace): Define only if BYTE_MARK_STACK.
16513 * xdisp.c (message_enable_multibyte): Now static.
16514
16515 Declare Lisp_Object Q* variables to be 'static' if not exported.
16516 This makes it easier for human readers (and static analyzers)
16517 to see whether these variables are used from other modules.
16518 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16519 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16520 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16521 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16522 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16523 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16524 * xmenu.c, xselect.c:
16525 Declare Q* vars static if they are not used in other modules.
16526 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16527 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16528 Remove decls of unexported vars.
16529 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16530
16531 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16532
16533 Make Emacs functions such as Fatom 'static' by default.
16534 This makes it easier for human readers (and static analyzers)
16535 to see whether these functions can be called from other modules.
16536 DEFUN now defines a static function. To make the function external
16537 so that it can be used in other C modules, use the new macro DEFUE.
16538 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16539 (Finit_image_library):
16540 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16541 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16542 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16543 Remove decls, since these functions are now static.
16544 (Funintern, Fget_internal_run_time): New decls, since these functions
16545 were already external.
16546
16547 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16548 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16549 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16550 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16551 * keyboard.c, keymap.c, lread.c:
16552 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16553 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16554 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16555 Mark functions with DEFUE instead of DEFUN,
16556 if they are used in other modules.
16557 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16558 decls for now-static functions.
16559 * buffer.h (Fdelete_overlay): Remove decl.
16560 * callproc.c (Fgetenv_internal): Mark as internal.
16561 * composite.c (Fremove_list_of_text_properties): Remove decl.
16562 (Fcomposition_get_gstring): New forward static decl.
16563 * composite.h (Fcomposite_get_gstring): Remove decl.
16564 * dired.c (Ffile_attributes): New forward static decl.
16565 * doc.c (Fdocumntation_property): New forward static decl.
16566 * eval.c (Ffetch_bytecode): New forward static decl.
16567 (Funintern): Remove extern decl; now in .h file where it belongs.
16568 * fileio.c (Fmake_symbolic_link): New forward static decl.
16569 * image.c (Finit_image_library): New forward static decl.
16570 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16571 * intervals.h (Fprevious_property_change):
16572 (Fremove_list_of_text_properties): Remove decls.
16573 * keyboard.c (Fthis_command_keys): Remove decl.
16574 (Fcommand_execute): New forward static decl.
16575 * keymap.c (Flookup_key): New forward static decl.
16576 (Fcopy_keymap): Now static.
16577 * keymap.h (Flookup_key): Remove decl.
16578 * process.c (Fget_process): New forward static decl.
16579 (Fprocess_datagram_address): Mark as internal.
16580 * syntax.c (Fsyntax_table_p): New forward static decl.
16581 (skip_chars): Remove duplicate decl.
16582 * textprop.c (Fprevious_property_change): New forward static decl.
16583 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16584 Now internal.
16585 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16586 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16587
16588 * editfns.c (Fformat): Remove unreachable code.
16589
16590 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16591
16592 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16593 change. (Bug#8496)
16594
16595 2011-04-13 Eli Zaretskii <eliz@gnu.org>
16596
16597 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16598 when at ZV. (Bug#8487)
16599
16600 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16601
16602 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16603 (Bug#8437)
16604 * keyboard.c (parse_tool_bar_item): Likewise.
16605 * sound.c (sound_cleanup, alsa_close): Likewise.
16606 * termcap.c (tgetent): Likewise.
16607 * xfns.c (x_default_font_parameter): Likewise.
16608 * xsettings.c (read_and_apply_settings): Likewise.
16609
16610 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16611 (overrun_check_free): Protoize.
16612
16613 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16614
16615 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16616 since callers should never pass a negative size.
16617 Change the signature to match that of plain 'read' and 'write'; see
16618 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16619 * lisp.h: Update prototypes of emacs_write and emacs_read.
16620
16621 2011-04-11 Eli Zaretskii <eliz@gnu.org>
16622
16623 * xdisp.c (redisplay_window): Don't try to determine the character
16624 position of the scroll margin if the window start point w->startp
16625 is outside the buffer's accessible region. (Bug#8468)
16626
16627 2011-04-10 Eli Zaretskii <eliz@gnu.org>
16628
16629 Fix write-region and its subroutines for buffers > 2GB.
16630 * fileio.c (a_write, e_write): Modify declaration of arguments and
16631 local variables to support buffers larger than 2GB.
16632 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16633
16634 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16635 argument, local variables, and return value.
16636
16637 * lisp.h: Update prototypes of emacs_write and emacs_read.
16638
16639 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16640
16641 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16642
16643 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16644
16645 Fix more problems found by GCC 4.6.0's static checks.
16646
16647 * xdisp.c (vmessage): Use a better test for character truncation.
16648
16649 * charset.c (load_charset_map): <, not <=, for optimization,
16650 and to avoid potential problems with integer overflow.
16651 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16652 * casetab.c (set_identity, shuffle): Likewise.
16653 * editfns.c (Fformat): Likewise.
16654 * syntax.c (skip_chars): Likewise.
16655
16656 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16657 This also lets GCC 4.6.0 generate slightly better loop code.
16658
16659 * callint.c (Fcall_interactively): <, not <=, for optimization.
16660 (Fcall_interactively): Count the number of arguments produced,
16661 not the number of arguments given. This is simpler and lets GCC
16662 4.6.0 generate slightly better code.
16663
16664 * ftfont.c: Distingish more carefully between FcChar8 and char.
16665 The previous code passed unsigned char * to a functions like
16666 strlen and xstrcasecmp that expect char *, which does not
16667 conform to the C standard.
16668 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16669 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16670 char * when the C standard requires it.
16671
16672 * keyboard.c (read_char): Remove unused var.
16673
16674 * eval.c: Port to Windows vsnprintf (Bug#8435).
16675 Include <limits.h>.
16676 (SIZE_MAX): Define if the headers do not.
16677 (verror): Do not give up if vsnprintf returns a negative count.
16678 Instead, grow the buffer. This ports to Windows vsnprintf, which
16679 does not conform to C99. Problem reported by Eli Zaretskii.
16680 Also, simplify the allocation scheme, by avoiding the need for
16681 calling realloc, and removing the ALLOCATED variable.
16682
16683 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16684
16685 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16686 But keep the doprint source code for now, as we might revamp it
16687 and use it again (Bug#8435).
16688 * lisp.h (doprnt): Remove.
16689 * Makefile.in (base_obj): Remove doprnt.o.
16690 * deps.mk (doprnt.o): Remove.
16691
16692 error: Print 32- and 64-bit integers portably (Bug#8435).
16693 Without this change, on typical 64-bit hosts error ("...%d...", N)
16694 was used to print both 32- and 64-bit integers N, which relied on
16695 undefined behavior.
16696 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16697 * lisp.h (error, verror): Mark as printf-like functions.
16698 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16699 Report overflow in size calculations when allocating printf buffer.
16700 Do not truncate output string at its first null byte.
16701 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16702 Truncate the output at a character boundary, since vsnprintf does not
16703 do that.
16704 * charset.c (check_iso_charset_parameter): Convert internal
16705 character to string before calling 'error', since %c now has the
16706 printf meaning.
16707 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16708 overflow when computing char to be passed to 'error'. Do not
16709 pass Lisp_Object to 'error'; pass the integer instead.
16710 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16711 formatted with plain %d.
16712
16713 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16714
16715 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16716
16717 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16718
16719 * xterm.c (x_catch_errors): Remove duplicate declaration.
16720
16721 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16722
16723 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16724
16725 2011-04-10 Jim Meyering <meyering@redhat.com>
16726
16727 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16728 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16729 return ssize_t not "int", and use size_t as the buffer length.
16730 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16731 * gnutls.h: Update declarations.
16732 * process.c (read_process_output): Use ssize_t, to match.
16733 (send_process): Likewise.
16734
16735 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16736
16737 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16738
16739 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16740
16741 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16742 Use unsigned char, to match FcChar8 type definition.
16743
16744 * xterm.c (handle_one_xevent):
16745 * xmenu.c (create_and_show_popup_menu):
16746 * xselect.c (x_decline_selection_request)
16747 (x_reply_selection_request): Avoid type-punned deref of X events.
16748
16749 2011-04-09 Eli Zaretskii <eliz@gnu.org>
16750
16751 Fix some uses of `int' instead of EMACS_INT.
16752 * search.c (string_match_1, fast_string_match)
16753 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16754 (scan_buffer, find_next_newline_no_quit)
16755 (find_before_next_newline, search_command, Freplace_match)
16756 (Fmatch_data): Make some `int' variables be EMACS_INT.
16757
16758 * xdisp.c (display_count_lines): 3rd argument and return value now
16759 EMACS_INT. All callers changed.
16760 (pint2hrstr): Last argument is now EMACS_INT.
16761
16762 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16763 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16764 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16765 (decode_coding_utf_16, decode_coding_emacs_mule)
16766 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16767 (decode_coding_ccl, decode_coding_charset)
16768 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16769 (decode_coding_iso_2022, decode_coding_emacs_mule)
16770 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16771 <char_offset, last_offset>: Declare EMACS_INT.
16772 (encode_coding_utf_8, encode_coding_utf_16)
16773 (encode_coding_emacs_mule, encode_invocation_designation)
16774 (encode_designation_at_bol, encode_coding_iso_2022)
16775 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16776 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16777 Declare EMACS_INT.
16778 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16779 (encode_invocation_designation): Last argument P_NCHARS is now
16780 EMACS_INT.
16781 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16782 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16783
16784 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16785 All users changed.
16786
16787 * ccl.c (Fccl_execute_on_string): Declare some variables
16788 EMACS_INT.
16789
16790 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16791
16792 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16793
16794 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16795
16796 * process.c (Fformat_network_address): Doc fix.
16797
16798 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16799
16800 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16801
16802 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16803
16804 * keyboard.c (read_char): Call Lisp function help-form-show,
16805 instead of using internal_with_output_to_temp_buffer.
16806 (Qhelp_form_show): New var.
16807 (syms_of_keyboard): Use DEFSYM macro.
16808
16809 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16810
16811 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16812
16813 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16814
16815 * process.c (Flist_processes): Remove to Lisp.
16816 (list_processes_1): Delete.
16817
16818 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16819
16820 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16821
16822 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16823
16824 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16825
16826 Fix more problems found by GCC 4.6.0's static checks.
16827
16828 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16829
16830 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16831
16832 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16833
16834 * xdisp.c (vmessage): Mark as a printf-like function.
16835
16836 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16837
16838 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16839
16840 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16841 printf-like functions.
16842 (tiff_load): Add casts to remove these marks before passing them
16843 to system-supplied API.
16844
16845 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16846
16847 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16848 This avoids several warnings with gcc -Wstrict-overflow.
16849 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16850 directly, rather than having caller test rule sign. This avoids
16851 some unnecessary tests.
16852 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16853 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16854 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16855
16856 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16857 (xfont_open): Avoid unnecessary tests.
16858
16859 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16860
16861 * composite.h, composite.c (composition_gstring_put_cache):
16862 Use EMACS_INT, not int, for length.
16863
16864 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16865 breaking out part of COMPOSITION_DECODE_RULE.
16866 (COMPOSITION_DECODE_RULE): Use it.
16867 * composite.c (get_composition_id): Remove unused local vars,
16868 by using the new macro.
16869
16870 * textprop.c (set_text_properties_1): Change while to do-while,
16871 since the condition is always true at first.
16872
16873 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16874 (interval_deletion_adjustment): Return unsigned value.
16875 All uses changed.
16876
16877 * process.c (list_processes_1, create_pty, read_process_output):
16878 (exec_sentinel): Remove vars that were set but not used.
16879 (create_pty): Remove unnecessary "volatile"s.
16880 (Fnetwork_interface_info): Avoid possibility of int overflow.
16881 (read_process_output): Do adaptive read buffering even if carryover.
16882 (read_process_output): Simplify nbytes computation if buffered.
16883
16884 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16885
16886 * syntax.c (scan_words): Remove var that was set but not used.
16887 (update_syntax_table): Use unsigned instead of int.
16888
16889 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16890 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16891 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16892
16893 * print.c (print_error_message): Avoid int overflow.
16894
16895 * font.c (font_list_entities): Redo for clarity,
16896 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16897
16898 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16899 (font_score): Avoid potential overflow in diff calculation.
16900
16901 * fns.c (substring_both): Remove var that is set but not used.
16902 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16903
16904 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16905
16906 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16907 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16908 can always succeed if overflow has undefined behavior.
16909
16910 * search.c (boyer_moore, wordify): Remove vars set but not used.
16911 (wordify): Omit three unnecessary tests.
16912
16913 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16914 All callers changed. This avoids the need for an unused var.
16915
16916 * casefiddle.c (casify_region): Remove var that is set but not used.
16917
16918 * dired.c (file_name_completion): Remove var that is set but not used.
16919
16920 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16921
16922 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16923 (Finsert_file_contents): Remove unnecessary code checking fd.
16924
16925 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16926 Check for integer overflow on size calculations.
16927
16928 * buffer.c (Fprevious_overlay_change): Remove var that is set
16929 but not used.
16930
16931 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16932 Remove vars that are set but not used.
16933 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16934 (timer_check_2): Mark vars as initialized.
16935
16936 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16937
16938 * image.c (lookup_image): Remove var that is set but not used.
16939 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16940
16941 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16942 that are set but not used.
16943
16944 * xfns.c (make_invisible_cursor): Don't return garbage
16945 if XCreateBitmapFromData fails (Bug#8410).
16946
16947 * xselect.c (x_get_local_selection, x_handle_property_notify):
16948 Remove vars that are set but not used.
16949
16950 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16951 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16952
16953 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16954 Remove var that is set but not used.
16955 (scroll_bar_windows_size): Now size_t, not int.
16956 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16957 Check for overflow.
16958
16959 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16960 (map_tty_color) [!defined MSDOS]: Likewise.
16961
16962 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16963
16964 * coding.c: Remove vars that are set but not used.
16965 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16966 All callers changed.
16967 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16968 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16969 (decode_coding_charset): Remove vars that are set but not used.
16970
16971 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16972 that is set but not used.
16973
16974 * print.c (print_object): Remove var that is set but not used.
16975
16976 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16977 The gnulib version avoids calling malloc in the usual case,
16978 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16979 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16980 * filelock.c (current_lock_owner): Likewise.
16981 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16982 * sysdep.c: Include allocator.h, careadlinkat.h.
16983 (emacs_no_realloc_allocator): New static constant.
16984 (emacs_readlink): New function.
16985 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16986 ../lib/careadlinkat.h.
16987
16988 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16989
16990 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16991 first non-nil return value).
16992
16993 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16994
16995 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16996 if not defined (Bug#8403).
16997
16998 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16999
17000 * xdisp.c (display_count_lines): Remove parameter `start',
17001 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17002 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17003 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17004 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17005 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17006 and thereabouts. All callers changed.
17007 (get_per_char_metric): Remove parameter `f', unused since
17008 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17009
17010 2011-04-02 Jim Meyering <meyering@redhat.com>
17011
17012 do not dereference NULL upon failed strdup
17013 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17014 (ns_get_family): Likewise.
17015
17016 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17017
17018 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17019
17020 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17021
17022 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17023 later (Bug#8403).
17024
17025 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17026
17027 Add lexical binding.
17028
17029 * window.c (Ftemp_output_buffer_show): New fun.
17030 (Fsave_window_excursion):
17031 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17032
17033 * lread.c (lisp_file_lexically_bound_p): New function.
17034 (Fload): Bind Qlexical_binding.
17035 (readevalloop): Remove `evalfun' arg.
17036 Bind Qinternal_interpreter_environment.
17037 (Feval_buffer): Bind Qlexical_binding.
17038 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17039 Mark as dynamic.
17040 (syms_of_lread): Declare `lexical-binding'.
17041
17042 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17043
17044 * keyboard.c (eval_dyn): New fun.
17045 (menu_item_eval_property): Use it.
17046
17047 * image.c (parse_image_spec): Use Ffunctionp.
17048
17049 * fns.c (concat, mapcar1): Accept byte-code-functions.
17050
17051 * eval.c (Fsetq): Handle lexical vars.
17052 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17053 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17054 (FletX, Flet): Obey lexical binding.
17055 (Fcommandp): Handle closures.
17056 (Feval): New `lexical' arg.
17057 (eval_sub): New function extracted from Feval. Use it almost
17058 everywhere where Feval was used. Look up vars in lexical env.
17059 Handle closures.
17060 (Ffunctionp): Move from subr.el.
17061 (Ffuncall): Handle closures.
17062 (apply_lambda): Remove `eval_flags'.
17063 (funcall_lambda): Handle closures and new byte-code-functions.
17064 (Fspecial_variable_p): New function.
17065 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17066 but without exporting it to Lisp.
17067
17068 * doc.c (Fdocumentation, store_function_docstring):
17069 * data.c (Finteractive_form): Handle closures.
17070
17071 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17072 interactive spec.
17073
17074 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17075 New byte-codes.
17076 (exec_byte_code): New function extracted from Fbyte_code to handle new
17077 calling convention for byte-code-functions. Add new byte-codes.
17078
17079 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17080
17081 * alloc.c (Fmake_symbol): Init new `declared_special' field.
17082
17083 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17084
17085 * xdisp.c (redisplay_internal): Fix prototype.
17086
17087 2011-03-31 Eli Zaretskii <eliz@gnu.org>
17088
17089 * xdisp.c (SCROLL_LIMIT): New macro.
17090 (try_scrolling): Use it when setting scroll_limit.
17091 Limit scrolling to 100 screen lines.
17092 (redisplay_window): Even when falling back on "recentering",
17093 position point in the window according to scroll-conservatively,
17094 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17095
17096 (try_scrolling): When point is above the window, allow searching
17097 as far as scroll_max, or one screenful, to compute vertical
17098 distance from PT to the scroll margin position. This prevents
17099 try_scrolling from unnecessarily failing when
17100 scroll-conservatively is set to a value slightly larger than the
17101 window height. Clean up the case of PT below the margin at bottom
17102 of window: scroll_max can no longer be INT_MAX. When aggressive
17103 scrolling is in use, don't let point enter the opposite scroll
17104 margin as result of the scroll.
17105 (syms_of_xdisp) <scroll-conservatively>: Document the
17106 threshold of 100 lines for never-recentering scrolling.
17107
17108 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17109
17110 * dispextern.h (move_it_by_lines):
17111 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17112 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17113 (message_log_check_duplicate): Remove parameters `prev_bol' and
17114 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17115 (redisplay_internal): Remove parameter `preserve_echo_area',
17116 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17117
17118 * indent.c (Fvertical_motion):
17119 * window.c (window_scroll_pixel_based, Frecenter):
17120 Don't pass `need_y_p' to `move_it_by_lines'.
17121
17122 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17123
17124 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17125 steal a few bits to be more compact.
17126 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17127 Remove unneeded casts.
17128
17129 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17130
17131 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17132
17133 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17134 binding" message (bug#7967).
17135
17136 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17137
17138 Fix more problems found by GCC 4.6.0's static checks.
17139
17140 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17141 Remove unused local var.
17142
17143 * editfns.c (Fmessage_box): Remove unused local var.
17144
17145 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17146 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17147 Omit unused local vars.
17148 * window.c (shrink_windows): Omit unused local var.
17149 * menu.c (digest_single_submenu): Omit unused local var.
17150 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17151 Omit unused local var.
17152
17153 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17154 Don't assume string length fits in int.
17155 (keyremap_step, read_key_sequence): Use size_t for sizes.
17156 (read_key_sequence): Don't check last_real_key_start redundantly.
17157
17158 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17159 instead of alloca (Bug#8344).
17160
17161 * eval.c (Fbacktrace): Don't assume nargs fits in int.
17162 (Fbacktrace_frame): Don't assume nframes fits in int.
17163
17164 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17165
17166 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17167 concerns.
17168
17169 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17170
17171 * cm.c (calccost): Turn while-do into do-while, for clarity.
17172
17173 * keyboard.c (syms_of_keyboard): Use the same style as later
17174 in this function when indexing through an array. This also
17175 works around GCC bug 48267.
17176
17177 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17178
17179 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17180
17181 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17182 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17183
17184 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17185 This avoids undefined behavior on integer overflow, and is a bit
17186 more convenient anyway since it is compared to a size_t variable.
17187
17188 Variadic C functions now count arguments with size_t, not int.
17189 This avoids an unnecessary limitation on 64-bit machines, which
17190 caused (substring ...) to crash on large vectors (Bug#8344).
17191 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17192 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
17193 All variadic functions and their callers changed accordingly.
17194 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17195 * data.c (arith_driver, float_arith_driver): Likewise.
17196 * editfns.c (general_insert_function): Likewise.
17197 * eval.c (struct backtrace.nargs, interactive_p)
17198 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17199 (funcall_lambda, mark_backtrace): Likewise.
17200 * fns.c (concat): Likewise.
17201 * frame.c (x_set_frame_parameters): Likewise.
17202 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17203 0 if not found, not -1. All callers changed.
17204
17205 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17206 (stack_copy_size): Now size_t, not int.
17207 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17208
17209 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17210
17211 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17212 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17213 All callers changed.
17214
17215 * lisp.h (multibyte_char_to_unibyte):
17216 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17217 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17218 * character.h (CHAR_TO_BYTE8):
17219 * cmds.c (internal_self_insert):
17220 * editfns.c (general_insert_function):
17221 * keymap.c (push_key_description):
17222 * search.c (Freplace_match):
17223 * xdisp.c (message_dolog, set_message_1): All callers changed.
17224
17225 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17226
17227 * keyboard.c (safe_run_hook_funcall): New function.
17228 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17229 don't set the hook to nil, but remove the offending function instead.
17230 (Qcommand_hook_internal): Remove, unused.
17231 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17232 Vcommand_hook_internal.
17233
17234 * eval.c (enum run_hooks_condition): Remove.
17235 (funcall_nil, funcall_not): New functions.
17236 (run_hook_with_args): Call each function through a `funcall' argument.
17237 Remove `cond' argument, now redundant.
17238 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17239 (Frun_hook_with_args_until_failure): Adjust accordingly.
17240 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17241
17242 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17243
17244 * dispextern.h (string_buffer_position): Remove declaration.
17245
17246 * print.c (strout): Remove parameter `multibyte', unused since
17247 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17248
17249 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17250 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17251 All callers changed.
17252
17253 * w32.c (_wsa_errlist): Use braces for struct initializers.
17254
17255 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17256 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17257 All callers changed.
17258 (string_buffer_position): Likewise. Also, make static (it's never
17259 used outside xdisp.c).
17260 (cursor_row_p): Remove parameter `w', unused since
17261 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17262 (decode_mode_spec): Remove parameter `precision', introduced during
17263 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17264 All callers changed.
17265
17266 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17267
17268 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17269
17270 2011-03-27 Anders Lindgren <andlind@gmail.com>
17271
17272 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17273 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17274 (ns_update_auto_hide_menu_bar): New functions.
17275 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17276 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17277 ns_constrain_all_frames.
17278 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17279 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17280
17281 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17282
17283 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17284
17285 2011-03-27 Glenn Morris <rgm@gnu.org>
17286
17287 * syssignal.h: Replace RETSIGTYPE with void.
17288 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17289 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17290 Replace SIGTYPE with void everywhere.
17291 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17292 * s/template.h (SIGTYPE): Remove commented out definition.
17293
17294 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17295
17296 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17297 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17298
17299 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17300
17301 * w32.c (read_unc_volume): Use parameter `henum', instead of
17302 global variable `wget_enum_handle'.
17303
17304 * keymap.c (describe_vector): Remove parameters `indices' and
17305 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17306 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17307
17308 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17309
17310 * keyboard.c (timer_check): Remove parameter `do_it_now',
17311 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17312 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17313 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17314
17315 * keyboard.c (read_char):
17316 * w32menu.c (w32_menu_display_help):
17317 * xmenu.c (show_help_event, menu_help_callback):
17318 Adjust calls to `show_help_echo'.
17319
17320 * gtkutil.c (xg_maybe_add_timer):
17321 * keyboard.c (readable_events):
17322 * process.c (wait_reading_process_output):
17323 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17324
17325 * insdel.c (adjust_markers_gap_motion):
17326 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17327 (gap_left, gap_right): Don't call it.
17328
17329 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17330
17331 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17332 incurred during fontification.
17333
17334 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17335
17336 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17337 (DEFVAR_PER_BUFFER): Don't pass it.
17338
17339 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17340 (scrolling_window): Don't pass it.
17341
17342 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17343
17344 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17345
17346 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17347 and `suffix'.
17348 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17349 of variables specific to SELinux and computation of `encoded_absname'.
17350
17351 * image.c (XPutPixel): Remove unused variable `height'.
17352
17353 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17354
17355 * unexw32.c (get_section_info): Remove unused variable `section'.
17356
17357 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17358 (system_process_attributes): Remove unused variable `sess'.
17359 (sys_read): Remove unused variable `err'.
17360
17361 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17362 (w32_wnd_proc): Remove unused variable `isdead'.
17363 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17364 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17365 (x_create_tip_frame): Remove unused variable `tem'.
17366
17367 * w32inevt.c (w32_console_read_socket):
17368 Remove unused variable `no_events'.
17369
17370 * w32term.c (x_draw_composite_glyph_string_foreground):
17371 Remove unused variable `width'.
17372
17373 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17374
17375 * w32term.c (x_set_glyph_string_clipping):
17376 Don't pass uninitialized region to CombineRgn.
17377
17378 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17379
17380 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17381 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17382 (Fx_close_connection): Remove unused variable `i'.
17383
17384 * w32font.c (w32font_draw): Return number of glyphs.
17385 (w32font_open_internal): Remove unused variable `i'.
17386 (w32font_driver): Add missing initializer.
17387
17388 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17389 (fill_in_menu): Remove unused variable `items_added'.
17390
17391 * w32term.c (last_mouse_press_frame): Remove static global variable.
17392 (w32_clip_to_row): Remove unused variable `f'.
17393 (x_delete_terminal): Remove unused variable `i'.
17394
17395 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17396 (NOTHING): Remove unused static global variable.
17397 (uniscribe_check_otf): Remove unused variable `table'.
17398 (uniscribe_font_driver): Add missing initializers.
17399
17400 2011-03-23 Julien Danjou <julien@danjou.info>
17401
17402 * term.c (Fsuspend_tty, Fresume_tty):
17403 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17404 * window.c (temp_output_buffer_show):
17405 * insdel.c (signal_before_change):
17406 * frame.c (Fhandle_switch_frame):
17407 * fileio.c (Fdo_auto_save):
17408 * emacs.c (Fkill_emacs):
17409 * editfns.c (save_excursion_restore):
17410 * cmds.c (internal_self_insert):
17411 * callint.c (Fcall_interactively):
17412 * buffer.c (Fkill_all_local_variables):
17413 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17414 Use Frun_hooks.
17415 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17416 unconditionally since it does the check itself.
17417
17418 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17419
17420 Fix more problems found by GCC 4.5.2's static checks.
17421
17422 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17423 the first time through the loop, since we know p0 < p1 then.
17424 This also avoids a gcc -Wstrict-overflow warning.
17425
17426 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17427 leading to a memory leak, possible in functions like
17428 load_charset_map_from_file that can allocate an unbounded number
17429 of objects (Bug#8318).
17430
17431 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17432 that could (at least in theory) be that large.
17433
17434 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17435 This is less likely to overflow, and avoids undefined behavior if
17436 overflow does occur. All callers changed. Use strtoul to scan
17437 for the unsigned long integer.
17438 (pint2hrstr): Simplify and tune code slightly.
17439 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17440
17441 * scroll.c (do_scrolling): Work around GCC bug 48228.
17442 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17443
17444 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17445 This also avoids a warning with gcc -Wstrict-overflow.
17446 (validate_x_resource_name): Simplify count usage.
17447 This also avoids a warning with gcc -Wstrict-overflow.
17448
17449 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17450 fail (Bug#8306).
17451
17452 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17453
17454 * process.c (Fmake_network_process): Use socklen_t, not int,
17455 where POSIX says socklen_t is required in portable programs.
17456 This fixes a porting bug on hosts like 64-bit HP-UX, where
17457 socklen_t is wider than int (Bug#8277).
17458 (Fmake_network_process, server_accept_connection):
17459 (wait_reading_process_output, read_process_output):
17460 Likewise.
17461
17462 * process.c: Rename or move locals to avoid shadowing.
17463 (list_processes_1, Fmake_network_process):
17464 (read_process_output_error_handler, exec_sentinel_error_handler):
17465 Rename or move locals.
17466 (Fmake_network_process): Define label "retry_connect" only if needed.
17467 (Fnetwork_interface_info): Fix pointer signedness.
17468 (process_send_signal): Add cast to avoid pointer signedness problem.
17469 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17470 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17471
17472 Make tparam.h and terminfo.c consistent.
17473 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17474 Include tparam.h instead, since it declares them.
17475 * cm.h (PC): Remove extern decl; tparam.h now does this.
17476 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17477 * terminfo.c: Include tparam.h, to check interfaces.
17478 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17479 (tparam): Adjust signature to match interface in tparam.h;
17480 this removes some undefined behavior. Check that outstring and len
17481 are zero, which they always are with Emacs.
17482 * tparam.h (PC, BC, UP): New extern decls.
17483
17484 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17485 (xftfont_open): Rename locals to avoid shadowing.
17486
17487 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17488 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17489 (OTF_TAG_SYM): Omit macro if not needed.
17490 (ftfont_list): Remove unused local.
17491 (get_adstyle_property, ftfont_pattern_entity):
17492 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17493 Rename locals to avoid shadowing.
17494
17495 * xfont.c (xfont_list_family): Mark var as initialized.
17496
17497 * xml.c (make_dom): Now static.
17498
17499 * composite.c (composition_compute_stop_pos): Rename local to
17500 avoid shadowing.
17501 (composition_reseat_it): Remove unused locals.
17502 (find_automatic_composition, composition_adjust_point): Likewise.
17503 (composition_update_it): Mark var as initialized.
17504 (find_automatic_composition): Mark vars as initialized,
17505 with a FIXME (Bug#8290).
17506
17507 character.h: Rename locals to avoid shadowing.
17508 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17509 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17510 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17511 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17512 to avoid shadowing.
17513
17514 * textprop.c (property_change_between_p): Remove; unused.
17515
17516 * intervals.c (interval_start_pos): Now static.
17517
17518 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17519
17520 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17521 Rename locals to avoid shadowing.
17522
17523 * sound.c (wav_play, au_play, Fplay_sound_internal):
17524 Fix pointer signedness.
17525 (alsa_choose_format): Remove unused local var.
17526 (wav_play): Initialize a variable to 0, to prevent undefined
17527 behavior (Bug#8278).
17528
17529 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17530
17531 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17532
17533 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17534 clobbering (Bug#8298).
17535 * sysdep.c (sys_subshell): Likewise.
17536 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17537
17538 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17539 This should get cleaned up, so that child_setup has the
17540 same signature on all platforms.
17541
17542 * callproc.c (call_process_cleanup): Now static.
17543 (relocate_fd): Rename locals to avoid shadowing.
17544
17545 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
17546
17547 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17548 not to be necessary, and produces flickering.
17549
17550 2011-03-20 Glenn Morris <rgm@gnu.org>
17551
17552 * config.in: Remove file.
17553
17554 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
17555
17556 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17557 are now in src/globals.h.
17558 (syms_of_minibuf): Remove spurious & from previous change.
17559
17560 2011-03-20 Leo Liu <sdl.web@gmail.com>
17561
17562 * minibuf.c (completing-read-function): New variable.
17563 (completing-read-default): Rename from completing-read.
17564 (completing-read): Call completing-read-function.
17565
17566 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17567
17568 * xfaces.c (Fx_load_color_file):
17569 Read color file from absolute filename (bug#8250).
17570
17571 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17572
17573 * makefile.w32-in: Update dependencies.
17574
17575 2011-03-17 Eli Zaretskii <eliz@gnu.org>
17576
17577 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17578
17579 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17580
17581 Fix more problems found by GCC 4.5.2's static checks.
17582
17583 * process.c (make_serial_process_unwind, send_process_trap):
17584 (sigchld_handler): Now static.
17585
17586 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17587 That way, the code declares only the vars that it needs.
17588 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17589 * s/cygwin.h (PTY_ITERATION): Likewise.
17590 * s/darwin.h (PTY_ITERATION): Likewise.
17591 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17592
17593 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17594 * process.c (allocate_pty): Don't declare stb unless it's needed.
17595
17596 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17597 (CONSTANTLIM): Remove; unused.
17598 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17599 Define only if needed.
17600
17601 * unexelf.c (unexec): Name an expression,
17602 to avoid gcc -Wbad-function-cast warning.
17603 Use a different way to cause a compilation error if anyone uses
17604 n rather than nn, a way that does not involve shadowing.
17605 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17606
17607 * deps.mk (unexalpha.o): Remove; unused.
17608
17609 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17610 * unexec.h: New file.
17611 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17612 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17613 Depend on unexec.h.
17614 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17615 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17616 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17617 Change as necessary to match prototype in unexec.h.
17618
17619 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17620 shadowing.
17621 (back_comment, skip_chars): Mark vars as initialized.
17622
17623 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17624 Rename locals to avoid shadowing.
17625
17626 * lread.c (read1): Rewrite so as not to use empty "else".
17627 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17628
17629 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17630
17631 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17632 warning when compiling print.c.
17633
17634 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17635 instead of using an uninitialized var.
17636 (font_sort_entities): Mark var as initialized.
17637
17638 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17639
17640 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17641 pointers to constants.
17642 (font_parse_fcname): Remove unused vars.
17643 (font_delete_unmatched): Now static.
17644 (font_get_spec): Remove; unused.
17645 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17646 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17647 Rename or move locals to avoid shadowing.
17648
17649 * fns.c (require_nesting_list, require_unwind): Now static.
17650 (Ffillarray): Rename locals to avoid shadowing.
17651
17652 * floatfns.c (domain_error2): Define only if needed.
17653 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17654
17655 * alloc.c (mark_backtrace): Move decl from here ...
17656 * lisp.h: ... to here, so that it can be checked.
17657
17658 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17659 (Fdefvar): Rewrite so as not to use empty "else".
17660 (lisp_indirect_variable): Name an expression,
17661 to avoid gcc -Wbad-function-cast warning.
17662 (Fdefvar): Rename locals to avoid shadowing.
17663
17664 * callint.c (quotify_arg, quotify_args): Now static.
17665 (Fcall_interactively): Rename locals to avoid shadowing.
17666 Use const pointer when appropriate.
17667
17668 * lisp.h (get_system_name, get_operating_system_release):
17669 Move decls here, to check interfaces.
17670 * process.c (get_operating_system_release): Move decl to lisp.h.
17671 * xrdb.c (get_system_name): Likewise.
17672 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17673 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17674 some of which prompt warnings from gcc -Wbad-function-cast.
17675 (Fformat_time_string, Fencode_time, Finsert_char):
17676 (Ftranslate_region_internal, Fformat):
17677 Rename or remove local vars to avoid shadowing.
17678 (Ftranslate_region_internal): Mark var as initialized.
17679
17680 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17681 avoid shadowing.
17682
17683 * lisp.h (eassert): Check that the argument compiles, even if
17684 ENABLE_CHECKING is not defined.
17685
17686 * data.c (Findirect_variable): Name an expression, to avoid
17687 gcc -Wbad-function-cast warning.
17688 (default_value, arithcompare, arith_driver, arith_error): Now static.
17689 (store_symval_forwarding): Rename local to avoid shadowing.
17690 (Fmake_variable_buffer_local, Fmake_local_variable):
17691 Mark variables as initialized.
17692 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17693
17694 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17695 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17696 Rename locals to avoid shadowing.
17697 (mark_stack): Move local variables into the #ifdef region where
17698 they're used.
17699 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17700 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17701 needed otherwise.
17702 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17703 (GC_STRING_CHARS): Remove; not used.
17704 (Fmemory_limit): Cast sbrk's returned value to char *.
17705
17706 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17707 avoids undefined behavior in theory.
17708
17709 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17710
17711 Use functions, not macros, for up- and down-casing (Bug#8254).
17712 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17713 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17714 to use the following functions instead of these macros.
17715 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17716 EMACS_INT, since callers assume the returned value fits in int.
17717 (upcase1): Likewise, for UPCASE_TABLE.
17718 (uppercasep, lowercasep, upcase): New static inline functions.
17719 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17720 the race-condition problem in the old DOWNCASE.
17721
17722 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17723 Rename locals to avoid shadowing.
17724 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17725 (regex_compile, re_search_2, re_match_2_internal):
17726 Remove unused local vars.
17727 (FREE_VAR): Rewrite so as not to use empty "else",
17728 which gcc can warn about.
17729 (regex_compile, re_match_2_internal): Mark locals as initialized.
17730 (RETALLOC_IF): Define only if needed.
17731 (WORDCHAR_P): Likewise. This one is never needed, but is used
17732 only in a comment talking about a compiler bug, so put inside
17733 the #if 0 of that comment.
17734 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17735 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17736 Remove; unused.
17737
17738 * search.c (boyer_moore): Rename locals to avoid shadowing.
17739 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17740 (PREV_CHAR_BOUNDARY): Likewise.
17741
17742 * search.c (simple_search): Remove unused var.
17743
17744 * dired.c (compile_pattern): Move decl from here ...
17745 * lisp.h: ... to here, so that it can be checked.
17746 (struct re_registers): New forward decl.
17747
17748 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17749
17750 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17751 All uses changed.
17752 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17753 Rename locals to avoid shadowing.
17754 (Fvertical_motion): Mark locals as initialized.
17755
17756 * casefiddle.c (casify_object, casify_region): Now static.
17757 (casify_region): Mark local as initialized.
17758
17759 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17760
17761 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17762 New macros, so that the caller can use some names other than
17763 gcpro1, gcpro2, etc.
17764 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17765 of the new macros.
17766 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17767 argument, for consistency with GCPRO2_VAR, etc: it is now the
17768 prefix of the variable, not the variable itself. All uses
17769 changed.
17770 * dired.c (directory_files_internal, file_name_completion):
17771 Rename locals to avoid shadowing.
17772
17773 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17774 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17775 dired.c's scmp function, had undefined behavior.
17776 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17777 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17778 * buffer.h: ... to here, because these macros use current_buffer,
17779 and the new implementation with inline functions needs to have
17780 current_buffer in scope now, rather than later when the macros
17781 are used.
17782 (downcase, upcase1): New static inline functions.
17783 (DOWNCASE, UPCASE1): Reimplement using these functions.
17784 This avoids undefined behavior in expressions like
17785 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17786 from race conditions in accessing the global variables
17787 case_temp1 and case_temp2.
17788 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17789 * lisp.h (case_temp1, case_temp2): Remove their decls.
17790 * character.h (ASCII_CHAR_P): Move from here ...
17791 * lisp.h: ... to here, so that the inline functions mentioned
17792 above can use them.
17793
17794 * dired.c (directory_files_internal_unwind): Now static.
17795
17796 * fileio.c (file_name_as_directory, directory_file_name):
17797 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17798 Now static.
17799 (file_name_as_directory): Use const pointers when appropriate.
17800 (Fexpand_file_name): Likewise. In particular, newdir might
17801 point at constant storage, so make it a const pointer.
17802 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17803 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17804 signedness issues.
17805 (Fset_file_times, Finsert_file_contents, auto_save_error):
17806 Rename locals to avoid shadowing.
17807
17808 * minibuf.c (choose_minibuf_frame_1): Now static.
17809 (Ftry_completion, Fall_completions): Rename or remove locals
17810 to avoid shadowing.
17811
17812 * marker.c (bytepos_to_charpos): Remove; unused.
17813
17814 * lisp.h (verify_bytepos, count_markers): New decls,
17815 so that gcc does not warn that these functions aren't declared.
17816
17817 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17818 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17819 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17820 (copy_text): Remove unused local var.
17821
17822 * filelock.c (within_one_second): Now static.
17823 (lock_file_1): Rename local to avoid shadowing.
17824
17825 * buffer.c (fix_overlays_before): Mark locals as initialized.
17826 (fix_start_end_in_overlays): Likewise. This function should be
17827 simplified by using pointers-to-pointers, but that's a different
17828 matter.
17829 (switch_to_buffer_1): Now static.
17830 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17831 (report_overlay_modification): Rename locals to avoid shadowing.
17832
17833 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17834 Fix pointer signedness issue.
17835 (sys_subshell): Mark local as volatile if checking for lint,
17836 to suppress a gcc -Wclobbered warning that does not seem to be right.
17837 (MAXPATHLEN): Define only if needed.
17838
17839 * process.c (serial_open, serial_configure): Move decls from here ...
17840 * systty.h: ... to here, so that they can be checked.
17841
17842 * fns.c (get_random, seed_random): Move extern decls from here ...
17843 * lisp.h: ... to here, so that they can be checked.
17844
17845 * sysdep.c (reset_io): Now static.
17846 (wait_for_termination_signal): Remove; unused.
17847
17848 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17849 (copy_keymap_item, append_key, push_text_char_description):
17850 Now static.
17851 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17852 (DENSE_TABLE_SIZE): Remove; unused.
17853 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17854 (describe_map_tree):
17855 Rename locals to avoid shadowing.
17856
17857 * keyboard.c: Declare functions static if they are not used elsewhere.
17858 (echo_char, echo_dash, cmd_error, top_level_2):
17859 (poll_for_input, handle_async_input): Now static.
17860 (read_char, kbd_buffer_get_event, make_lispy_position):
17861 (make_lispy_event, make_lispy_movement, apply_modifiers):
17862 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17863 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17864 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17865 (read_key_sequence, read_char): Mark locals as initialized.
17866 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17867
17868 * keyboard.h (make_ctrl_char): New decl.
17869 (mark_kboards): Move decl here ...
17870 * alloc.c (mark_kboards): ... from here.
17871
17872 * lisp.h (force_auto_save_soon): New decl.
17873
17874 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17875 (DEFINE_DUMMY_FUNCTION): New macro.
17876 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17877 Use it.
17878 (main): Add casts to avoid warnings
17879 if GCC considers string literals to be constants.
17880
17881 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17882
17883 * dbusbind.c: Pointer signedness fixes.
17884 (xd_signature, xd_append_arg, xd_initialize):
17885 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17886 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17887 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17888 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17889
17890 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17891 if GCC considers string literals to be constants.
17892 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17893
17894 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17895
17896 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17897 (print_preprocess, print_object): New macro to fix last change.
17898
17899 * print.c (print_preprocess): Don't forget font objects.
17900
17901 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17902
17903 * emacs.c (USAGE3): Doc fixes.
17904
17905 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17906
17907 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17908 structure.
17909
17910 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17911
17912 * lisp.h (VWindow_system, Qfile_name_history):
17913 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17914 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17915 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17916
17917 * w32select.c: Don't #include "keyboard.h".
17918 (run_protected): Add extern declaration for waiting_for_input.
17919
17920 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17921 * w32console.c (detect_input_pending, read_input_pending)
17922 (encode_terminal_code):
17923 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17924 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17925 (w32_system_caret_y, Qfile_name_history):
17926 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17927 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17928 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17929 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17930 * w32proc.c (Qlocal, report_file_error):
17931 * w32term.c (Vwindow_system, updating_frame):
17932 * w32uniscribe.c (initialized, uniscribe_font_driver):
17933 Remove unneeded extern declarations.
17934
17935 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17936
17937 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17938
17939 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17940
17941 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17942 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17943 These macros can no longer be used for assignment.
17944
17945 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17946 Assign struct members directly, instead of using BUF_BEGV etc.
17947 (record_buffer_markers, fetch_buffer_markers): New functions for
17948 recording and fetching special buffer markers.
17949 (set_buffer_internal_1, set_buffer_temp): Use them.
17950
17951 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17952
17953 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17954
17955 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17956 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17957
17958 * xdisp.c (hscroll_window_tree):
17959 (reconsider_clip_changes): Use PT instead of BUF_PT.
17960
17961 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17962
17963 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17964 $(EMACS_ROOT)/lib/intprops.h.
17965
17966 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17967
17968 Fix more problems found by GCC 4.5.2's static checks.
17969
17970 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17971 to unsigned char * to avoid compiler diagnostic.
17972 (xg_free_frame_widgets): Make it clear that a local variable is
17973 needed only if USE_GTK_TOOLTIP.
17974 (gdk_window_get_screen): Make it clear that this macro is needed
17975 only if USE_GTK_TOOLTIP.
17976 (int_gtk_range_get_value): New function, which avoids a diagnostic
17977 from gcc -Wbad-function-cast.
17978 (xg_set_toolkit_scroll_bar_thumb): Use it.
17979 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17980 diagnostic from gcc -Wbad-function-cast.
17981 (get_utf8_string, xg_get_file_with_chooser):
17982 Rename locals to avoid shadowing.
17983 (create_dialog): Move locals to avoid shadowing.
17984
17985 * xgselect.c (xg_select): Remove unused var.
17986
17987 * image.c (four_corners_best): Mark locals as initialized.
17988 (gif_load): Initialize transparent_p to zero (Bug#8238).
17989 Mark another local as initialized.
17990 (my_png_error, my_error_exit): Mark with NO_RETURN.
17991
17992 * image.c (clear_image_cache): Now static.
17993 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17994 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17995 (x_edge_detection): Remove unnecessary cast that
17996 gcc -Wbad-function-cast diagnoses.
17997 (gif_load): Fix pointer signedness.
17998 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17999 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18000
18001 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18002
18003 Improve quality of tests for time stamp overflow.
18004 For example, without this patch (encode-time 0 0 0 1 1
18005 1152921504606846976) returns the obviously-bogus value (-948597
18006 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18007 reports time overflow. See
18008 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18009 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18010 * editfns.c: Include limits.h and intprops.h.
18011 (TIME_T_MIN, TIME_T_MAX): New macros.
18012 (time_overflow): Move earlier, to before first use.
18013 (hi_time, lo_time): New functions, for an accurate test for
18014 out-of-range times.
18015 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18016 (Fget_internal_run_time): Don't assume time_t fits in int.
18017 (make_time): Use list2 instead of Fcons twice.
18018 (Fdecode_time): More accurate test for out-of-range times.
18019 (check_tm_member): New function.
18020 (Fencode_time): Use it, to test for out-of-range times.
18021 (lisp_time_argument): Don't rely on undefined left-shift and
18022 right-shift behavior when checking for time stamp overflow.
18023
18024 * editfns.c (time_overflow): New function, refactoring common code.
18025 (Fformat_time_string, Fdecode_time, Fencode_time):
18026 (Fcurrent_time_string): Use it.
18027
18028 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18029 * dired.c (make_time): Move to ...
18030 * editfns.c (make_time): ... here.
18031 * systime.h: Note the move.
18032
18033 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18034
18035 * fringe.c (update_window_fringes): Remove unused variables.
18036
18037 * unexmacosx.c (copy_data_segment): Also copy __got section.
18038 (Bug#8223)
18039
18040 2011-03-12 Eli Zaretskii <eliz@gnu.org>
18041
18042 * termcap.c [MSDOS]: Include "msdos.h".
18043 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18044 Constify `char *' arguments and their references according to
18045 prototypes in tparam.h.
18046
18047 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18048
18049 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18050 Adapt all references accordingly.
18051
18052 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18053
18054 2011-03-11 Tom Tromey <tromey@redhat.com>
18055
18056 * buffer.c (syms_of_buffer): Remove obsolete comment.
18057
18058 2011-03-11 Eli Zaretskii <eliz@gnu.org>
18059
18060 * termhooks.h (encode_terminal_code): Declare prototype.
18061
18062 * msdos.c (encode_terminal_code): Don't declare prototype.
18063
18064 * term.c (encode_terminal_code): Now external again, used by
18065 w32console.c and msdos.c.
18066
18067 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18068 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18069
18070 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
18071
18072 Fix some minor problems found by GCC 4.5.2's static checks.
18073
18074 * fringe.c (update_window_fringes): Mark locals as initialized
18075 (Bug#8227).
18076 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18077
18078 * alloc.c (mark_fringe_data): Move decl from here ...
18079 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18080 to check its interface.
18081 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18082
18083 * fontset.c (free_realized_fontset): Now static.
18084 (Fset_fontset_font): Rename local to avoid shadowing.
18085 (fontset_font): Mark local as initialized.
18086 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18087
18088 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18089
18090 * xselect.c (x_disown_buffer_selections): Remove; not used.
18091 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18092 (x_own_selection, Fx_disown_selection_internal): Rename locals
18093 to avoid shadowing.
18094 (x_handle_dnd_message): Remove local to avoid shadowing.
18095
18096 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18097 so that the caller can use some name other than gcpro1.
18098 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18099 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18100 (Fx_backspace_delete_keys_p):
18101 Use them to avoid shadowing, and rename vars to avoid shadowing.
18102 (x_decode_color, x_set_name, x_window): Now static.
18103 (Fx_create_frame): Add braces to silence GCC warning.
18104 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18105 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18106 Remove unused locals.
18107 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18108 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18109 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18110 macros.
18111
18112 * xterm.h (x_mouse_leave): New decl.
18113
18114 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18115 Remove unused functions.
18116 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18117 (x_calc_absolute_position): Now static.
18118 (XTread_socket): Don't define label "out" unless it's used.
18119 Don't declare local "event" unless it's used.
18120 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18121 unless they are used.
18122 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18123 (x_fatal_error_signal): Remove; not used.
18124 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18125 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18126 (x_error_catcher, x_connection_closed, x_error_handler):
18127 (x_error_quitter, xembed_send_message, x_iconify_frame):
18128 (my_log_handler): Rename locals to avoid shadowing.
18129 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18130 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18131
18132 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18133 Rename or move locals to avoid shadowing.
18134 (tty_defined_color, merge_face_heights): Now static.
18135 (free_realized_faces_for_fontset): Remove; not used.
18136 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18137 does not deduce is never used uninitialized.
18138 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18139 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18140
18141 * terminal.c (store_terminal_param): Now static.
18142
18143 * xmenu.c (menu_highlight_callback): Now static.
18144 (set_frame_menubar): Remove unused local.
18145 (xmenu_show): Rename parameter to avoid shadowing.
18146 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18147 since they might point to immutable storage.
18148 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18149 since it's unused otherwise.
18150
18151 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18152 Add a FIXME, since the code still doesn't look right. (Bug#8215)
18153 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18154 avoids a gcc -Wuninitialized diagnostic.
18155 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18156 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18157 does not deduce are never used uninitialized.
18158
18159 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18160
18161 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18162 * window.c (window_loop, size_window):
18163 (run_window_configuration_change_hook, enlarge_window): Likewise.
18164
18165 * window.c (display_buffer): Now static.
18166 (size_window): Mark variables that gcc -Wuninitialized
18167 does not deduce are never used uninitialized.
18168 * window.h (check_all_windows): New decl, to forestall
18169 gcc -Wmissing-prototypes diagnostic.
18170 * dispextern.h (bidi_dump_cached_states): Likewise.
18171
18172 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18173 shadowing.
18174 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18175 Include <limits.h>.
18176 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18177 and to avoid gcc -Wuninitialized warning.
18178 (load_charset_map): Mark variables that gcc -Wuninitialized
18179 does not deduce are never used uninitialized.
18180 (load_charset): Abort instead of using uninitialized var (Bug#8229).
18181
18182 * coding.c (coding_set_source, coding_set_destination):
18183 Use "else { /* comment */ }" rather than "else /* comment */;"
18184 for clarity, and to avoid gcc -Wempty-body warning.
18185 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18186 a block, when the outer 'i' will do.
18187 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18188 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18189 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18190 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18191 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18192 Rename locals to avoid shadowing.
18193 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
18194 * coding.c (emacs_mule_char, encode_invocation_designation):
18195 Now static, since they're not used elsewhere.
18196 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
18197 (decode_coding_object, encode_coding_object, detect_coding_system):
18198 (decode_coding_emacs_mule): Mark variables that gcc
18199 -Wuninitialized does not deduce are never used uninitialized.
18200 (detect_coding_iso_2022): Initialize a local variable that might
18201 be used uninitialized. Leave a FIXME because it's not clear that
18202 this initialization is needed. (Bug#8211)
18203 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18204 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18205 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18206 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18207 Remove unused macros.
18208
18209 * category.c (hash_get_category_set): Remove unused local var.
18210 (copy_category_table): Now static, since it's not used elsewhere.
18211 * character.c (string_count_byte8): Likewise.
18212
18213 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18214 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18215
18216 * chartab.c (copy_sub_char_table): Now static, since it's not used
18217 elsewhere.
18218 (sub_char_table_ref_and_range, char_table_ref_and_range):
18219 Rename locals to avoid shadowing.
18220 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
18221
18222 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18223 (BIDI_BOB): Remove unused macro.
18224
18225 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18226 deduce are never used uninitialized.
18227 * term.c (encode_terminal_code): Likewise.
18228
18229 * term.c (encode_terminal_code): Now static. Remove unused local.
18230
18231 * tparam.h: New file.
18232 * term.c, tparam.h: Include it.
18233 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18234 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18235 Move these decls to tparam.h, and make them agree with what
18236 is actually in tparam.c. The previous trick of using incompatible
18237 decls in different modules does not conform to the C standard.
18238 All callers of tparam changed to use tparam's actual API.
18239 * tparam.c (tparam1, tparam, tgoto):
18240 Use const pointers where appropriate.
18241
18242 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18243 * cm.h (struct cm): Likewise.
18244 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18245 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18246 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18247 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18248 (turn_on_face, init_tty): Likewise.
18249 * termchar.h (struct tty_display_info): Likewise.
18250
18251 * term.c (term_mouse_position): Rename local to avoid shadowing.
18252
18253 * alloc.c (mark_ttys): Move decl from here ...
18254 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18255
18256 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18257
18258 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18259
18260 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
18261
18262 * search.c (compile_pattern_1): Remove argument regp, unused since
18263 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18264 (compile_pattern): Don't pass it.
18265
18266 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18267
18268 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18269 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18270 for ! HAVE_GTK3.
18271 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18272
18273 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18274
18275 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18276 gdk_window_get_screen, gdk_window_get_geometry,
18277 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18278 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18279 (xg_get_pixbuf_from_pixmap): New function.
18280 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18281 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18282 Call xg_get_pixbuf_from_pixmap instead of
18283 gdk_pixbuf_get_from_drawable.
18284 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18285 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18286 (xg_check_special_colors): Use GtkStyleContext and its functions
18287 for HAVE_GTK3.
18288 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18289 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18290 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18291 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18292 Call gtk_widget_get_preferred_size.
18293 (xg_frame_resized): gdk_window_get_geometry only takes 5
18294 parameters.
18295 (xg_win_to_widget, xg_event_is_for_menubar):
18296 Call gdk_x11_window_lookup_for_display.
18297 (xg_set_widget_bg): New function.
18298 (delete_cb): New function.
18299 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18300 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18301 (xg_set_background_color): Call xg_set_widget_bg.
18302 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18303 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18304 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18305 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18306 if ! HAVE_GTK3.
18307 (update_frame_tool_bar): Call gtk_widget_hide.
18308 (xg_initialize): Use GDK_KEY_g.
18309
18310 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18311 if ! HAVE_GTK3
18312 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18313
18314 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18315 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18316 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18317
18318 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18319
18320 * w32xfns.c (select_palette): Check success of RealizePalette against
18321 GDI_ERROR, not zero.
18322
18323 See ChangeLog.11 for earlier changes.
18324
18325 ;; Local Variables:
18326 ;; coding: utf-8
18327 ;; End:
18328
18329 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18330
18331 This file is part of GNU Emacs.
18332
18333 GNU Emacs is free software: you can redistribute it and/or modify
18334 it under the terms of the GNU General Public License as published by
18335 the Free Software Foundation, either version 3 of the License, or
18336 (at your option) any later version.
18337
18338 GNU Emacs is distributed in the hope that it will be useful,
18339 but WITHOUT ANY WARRANTY; without even the implied warranty of
18340 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18341 GNU General Public License for more details.
18342
18343 You should have received a copy of the GNU General Public License
18344 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.