Merge from emacs-24; up to 2012-05-08T14:11:47Z!monnier@iro.umontreal.ca
[bpt/emacs.git] / src / ChangeLog
1 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
2
3 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
4
5 2012-10-04 Eli Zaretskii <eliz@gnu.org>
6
7 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
8 see whether CreateFile failed.
9
10 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
11
12 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
13 to avoid similar races.
14 * keyboard.c (pending_signals): Now bool, not int.
15
16 Port timers to OpenBSD, plus check for timer failures.
17 OpenBSD problem reported by Han Boetes.
18 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
19 and/or setitimer.
20 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
21 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
22 like OpenBSD, which has timer_settime but does not declare it.
23 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
24 whether to use itimerspec-related primitives. All uses of
25 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
26
27 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
28
29 * profiler.c (handle_profiler_signal): Fix a malloc race
30 that caused Emacs to hang on Fedora 17 when profiling Lisp.
31
32 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
33
34 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
35
36 2012-10-02 Eli Zaretskii <eliz@gnu.org>
37
38 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
39 consistent with the change in return value of 'safe_strsignal'.
40
41 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
42
43 Prefer plain 'static' to 'static inline' (Bug#12541).
44 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
45 (bidi_set_sor_type, bidi_push_embedding_level)
46 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
47 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
48 (bidi_cache_search, bidi_cache_ensure_space)
49 (bidi_cache_iterator_state, bidi_cache_find)
50 (bidi_peek_at_next_level, bidi_set_paragraph_end)
51 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
52 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
53 Now 'static', not 'static inline'.
54
55 Count overruns when profiling; change units to ns.
56 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
57 Give extra weight to samples after overruns, to attempt to count
58 the time more accurately.
59 (setup_cpu_timer): Change sampling interval units from ms to ns, since
60 the underlying primitives nominally do ns.
61 (Fprofiler_cpu_start): Document the change. Mention that
62 the sampling intervals are only approximate.
63
64 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
65
66 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
67
68 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
69 case for the special 0 coding-system.
70
71 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
72 (Fmake_overlay): Remove redundant tests.
73 (fix_start_end_in_overlays): Remove redundant recentering.
74
75 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
76
77 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
78 Update dependencies.
79
80 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
81
82 Fix a malloc race condition involving strsignal.
83 A signal can arrive in the middle of a malloc, and Emacs's signal
84 handler can invoke strsignal, which can invoke malloc, which is
85 not portable. This race condition bug makes Emacs hang on GNU/Linux.
86 Fix it by altering the signal handler so that it does not invoke
87 strsignal.
88 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
89 * process.c (status_message): Use const pointer, in case strsignal
90 is #defined to safe_strsignal.
91 * sysdep.c (sys_siglist, init_signals): Always define and
92 initialize a substitute sys_siglist if the system does not define
93 one, even if HAVE_STRSIGNAL.
94 (safe_strsignal): Rename from strsignal. Always define,
95 using sys_siglist. Return a const pointer.
96 * syssignal.h (safe_strsignal): New decl.
97 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
98
99 2012-10-01 Eli Zaretskii <eliz@gnu.org>
100
101 * w32proc.c (timer_loop): Fix code that waits for timer
102 expiration, to avoid high CPU usage.
103
104 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
105
106 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
107 (sweep_weak_table): Remove redundant prototypes.
108
109 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
110
111 * emacs.c: Move the inclusion of TERM_HEADER after including
112 windows.h on WINDOWSNT. This avoids compilation problems with
113 MSVC.
114
115 2012-10-01 Eli Zaretskii <eliz@gnu.org>
116
117 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
118 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
119 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
120 as the previous version used 'void *'.
121
122 * ralloc.c (ROUNDUP): Fix last change.
123 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
124 'size_t'.
125
126 * w32proc.c <disable_itimers>: New static flag.
127 (init_timers): Initialize it to zero, after creating the critical
128 sections used by the timer threads.
129 (term_timers): Set to 1 before deleting the critical sections.
130 (getitimer, setitimer): If disable_itimers is non-zero, return an
131 error indication without doing anything. Reported by Fabrice
132 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
133 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
134 return results.
135 [!HAVE_SETITIMER]: Behave as the previous version that didn't
136 support timers.
137
138 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
139 term_ntproc after all the other bookkeeping, to get timers working
140 as long as possible.
141
142 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
143
144 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
145 Suggested by Juri Linkov in
146 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
147
148 Prefer plain 'static' to 'static inline' (Bug#12541).
149 With static functions, modern compilers inline pretty well by
150 themselves; advice from programmers often hurts as much as it helps.
151 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
152 this change shrinks the text size of the Emacs executable by 1.1%
153 without affecting CPU significantly in my benchmark.
154 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
155 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
156 (mark_maybe_object, mark_maybe_pointer, bounded_number):
157 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
158 (bset_auto_fill_function, bset_auto_save_file_format)
159 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
160 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
161 (bset_cache_long_line_scans, bset_case_fold_search)
162 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
163 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
164 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
165 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
166 (bset_header_line_format, bset_indicate_buffer_boundaries)
167 (bset_indicate_empty_lines, bset_invisibility_spec)
168 (bset_left_fringe_width, bset_major_mode, bset_mark)
169 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
170 (bset_name, bset_overwrite_mode, bset_pt_marker)
171 (bset_right_fringe_width, bset_save_length)
172 (bset_scroll_bar_width, bset_scroll_down_aggressively)
173 (bset_scroll_up_aggressively, bset_selective_display)
174 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
175 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
176 (set_buffer_overlays_after):
177 * category.c (bset_category_table):
178 * charset.c (read_hex):
179 * coding.c (produce_composition, produce_charset)
180 (handle_composition_annotation, handle_charset_annotation)
181 (char_encodable_p):
182 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
183 (assign_row, set_frame_matrix_frame, make_current)
184 (add_row_entry):
185 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
186 * fns.c (maybe_resize_hash_table):
187 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
188 * gmalloc.c (register_heapinfo):
189 * image.c (lookup_image_type):
190 * intervals.c (set_interval_object, set_interval_left)
191 (set_interval_right, copy_interval_parent, rotate_right)
192 (rotate_left, balance_possible_root_interval):
193 * keyboard.c (kset_echo_string, kset_kbd_queue)
194 (kset_keyboard_translate_table, kset_last_prefix_arg)
195 (kset_last_repeatable_command, kset_local_function_key_map)
196 (kset_overriding_terminal_local_map, kset_real_last_command)
197 (kset_system_key_syms, clear_event, set_prop):
198 * lread.c (digit_to_number):
199 * marker.c (attach_marker, live_buffer, set_marker_internal):
200 * nsterm.m (ns_compute_glyph_string_overhangs):
201 * process.c (pset_buffer, pset_command)
202 (pset_decode_coding_system, pset_decoding_buf)
203 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
204 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
205 (pset_status, pset_tty_name, pset_type, pset_write_queue):
206 * syntax.c (bset_syntax_table, dec_bytepos):
207 * terminal.c (tset_param_alist):
208 * textprop.c (interval_has_some_properties)
209 (interval_has_some_properties_list):
210 * window.c (wset_combination_limit, wset_dedicated)
211 (wset_display_table, wset_hchild, wset_left_fringe_width)
212 (wset_left_margin_cols, wset_new_normal, wset_new_total)
213 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
214 (wset_right_fringe_width, wset_right_margin_cols)
215 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
216 (wset_vertical_scroll_bar_type, wset_window_parameters):
217 * xdisp.c (wset_base_line_number, wset_base_line_pos)
218 (wset_column_number_displayed, wset_region_showing)
219 (window_box_edges, run_window_scroll_functions)
220 (append_glyph_string_lists, prepend_glyph_string_lists)
221 (append_glyph_string, set_glyph_string_background_width)
222 (append_glyph, append_composite_glyph)
223 (take_vertical_position_into_account):
224 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
225 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
226 (lface_hash, lface_same_font_attributes_p, lookup_face):
227 * xml.c (libxml2_loaded_p):
228 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
229 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
230 Now 'static', not 'static inline'.
231
232 * bidi.c: Tune.
233 (bidi_copy_it): Do the whole copy with a single memcpy.
234 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
235
236 Revert the FOLLOW-SYMLINKS change for file-attributes.
237 Doing it right would require several changes to Tramp, and there's
238 not enough time to get that tested before the freeze today.
239 * dired.c (directory_files_internal, Ffile_attributes):
240 Undo last change.
241
242 * frame.c (x_report_frame_params): Port better to wider ints.
243 Do not assume that EMACS_UINT is the same width as uprintmax_t,
244 or that pointers can be printed in 15 decimal digits.
245 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
246
247 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
248
249 Support x64 build on MS-Windows.
250 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
251 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
252 compatibility with x64.
253 (x_get_focus_frame): Add prototype.
254
255 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
256 defining an XRectangle structure.
257
258 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
259 arithmetics for compatibility with x64.
260
261 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
262 compatibility with x64.
263
264 * w32heap.h: Adjust prototypes and declarations.
265
266 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
267 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
268 DWORD, long, and unsigned long, for compatibility with x64.
269 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
270 (sbrk): Argument is now of type ptrdiff_t.
271
272 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
273 less than 0x0500.
274 (w32_msg_pump): Use WPARAM type for 'result'.
275
276 * w32.c (init_environment, get_emacs_configuration): Support AMD64
277 architecture.
278 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
279 compatibility with x64.
280
281 * vm-limit.c (lim_data): Now size_t.
282 (check_memory_limits): Adjust prototypes of real_morecore and
283 __morecore to receive argument of type ptrdiff_t. Use size_t for
284 five_percent and data_size.
285
286 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
287 variables, for compatibility with x64.
288 (rva_to_section, offset_to_section, relocate_offset)
289 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
290 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
291 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
292 for compatibility with x64.
293
294 * sysdep.c (STDERR_FILENO): Define if not already defined.
295
296 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
297 (__morecore): Argument type is now ptrdiff_t.
298 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
299 (relinquish): Use ptrdiff_t type for 'excess'.
300 (r_alloc_sbrk): Argument type is now ptrdiff_t.
301
302 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
303 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
304 instead of a literal number.
305
306 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
307 (min): Define only if not already defined.
308
309 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
310 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
311 hosts.
312
313 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
314 'bitmaps' is a pointer.
315
316 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
317
318 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
319
320 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
321
322 file-attributes has a new optional arg FOLLOW-SYMLINKS.
323 * dired.c (directory_files_internal, Ffile_attributes):
324 New arg follow_symlinks. All uses changed.
325
326 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
327
328 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
329
330 2012-09-30 Eli Zaretskii <eliz@gnu.org>
331
332 Support atimers and CPU profiler via profile.c on MS-Windows.
333 * w32proc.c (sig_mask, crit_sig): New static variables.
334 (sys_signal): Support SIGALRM and SIGPROF.
335 (sigemptyset, sigaddset, sigfillset, sigprocmask)
336 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
337 sigfillset, and sigprocmask are no longer no-ops.
338 (sigismember): New function.
339 (struct itimer_data): New definition.
340 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
341 (crit_prof): New static variables.
342 (MAX_SINGLE_SLEEP): New definition.
343 (timer_loop, stop_timer_thread, term_timers, init_timers)
344 (start_timer_thread, getitimer, setitimer): New functions.
345 (alarm): No longer a no-op, calls setitimer.
346
347 * w32.c (term_ntproc): Call term_timers.
348 (init_ntproc): Make sure all signals are unblocked at startup, to
349 erase any traces of dumping. Call init_timers.
350
351 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
352 Windows-specific code to display the hourglass mouse pointer is no
353 longer used.
354 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
355 to hourglass timer expiration.
356 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
357 Remove, no longer used.
358 (w32_note_current_window, show_hourglass, hide_hourglass):
359 New functions, in support of hourglass cursor display similar to other
360 window systems.
361 (syms_of_w32fns): Don't initialize hourglass_timer.
362
363 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
364 WINDOWSNT as well.
365 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
366
367 * w32.h (init_timers, term_timers): Add prototypes.
368
369 2012-09-30 Kenichi Handa <handa@gnu.org>
370
371 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
372 to the buffer relocation which may be caused by ccl_driver.
373
374 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
375
376 * xfns.c (Fx_file_dialog): Update comment.
377
378 * w32fns.c (Fx_file_dialog): Update comment.
379
380 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
381 Initialize panel name field if OSX >= 10.6.
382
383 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
384
385 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
386
387 * nsterm.m (NEW_STYLE_FS): New define.
388 (ns_fullscreen_hook, windowWillEnterFullScreen)
389 (windowDidEnterFullScreen, windowWillExitFullScreen)
390 (windowDidExitFullScreen, toggleFullScreen, handleFS)
391 (setFSValue): New functions.
392 (EmacsFSWindow): New implementation.
393 (canBecomeKeyWindow): New function for EmacsFSWindow.
394 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
395 (dealloc): Release nonfs_window if in fullscreen.
396 (updateFrameSize:): Call windowDidMove to update top/left.
397 (windowWillResize:toSize:): Check if frame is still maximized.
398 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
399 next_maximized, maximized_width, maximized_height and nonfs_window.
400 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
401 tbar_height.
402 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
403 fullscreen. Set maximized_width/height. Act on next_maximized.
404
405 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
406 (EmacsView): Add variables for fullscreen.
407 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
408 (EmacsFSWindow): New interface for fullscreen.
409
410 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
411
412 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
413
414 2012-09-30 Chong Yidong <cyd@gnu.org>
415
416 * fns.c (Frandom): Doc fix.
417
418 2012-09-30 Martin Rudalics <rudalics@gmx.at>
419
420 * window.c (Vwindow_combination_limit): New default value.
421 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
422
423 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
424
425 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
426 Suggested by Eli Zaretskii in
427 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
428
429 2012-09-30 Eli Zaretskii <eliz@gnu.org>
430
431 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
432 HAVE_TIMER_SETTIME is defined.
433
434 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
435
436 Profiler improvements: more-accurate timers, overflow checks.
437 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
438 signal.h, setjmp.h. Include systime.h instead.
439 (saturated_add): New function.
440 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
441 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
442 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
443 New static vars.
444 (enum profiler_cpu_running): New enum.
445 (profiler_cpu_running): Now of that enum type, not bool.
446 All uses changed to store the new value.
447 (handle_profiler_signal): Rename from sigprof_handler_1,
448 for consistency with other handlers. Do not check whether
449 cpu_log is a hash-table if garbage collecting, since it
450 doesn't matter in that case.
451 (deliver_profiler_signal): Rename from sigprof_handler,
452 for consistency with other handlers.
453 (setup_cpu_timer): New function, with much of what used to be in
454 Fprofiler_cpu_start. Check for out-of-range argument.
455 Prefer timer_settime if available, and prefer
456 thread cputime clocks, then process cputime clocks, then
457 monotonic clocks, to the old realtime clock. Use make_timeval
458 to round more-correctly when falling back to setitimer.
459 (Fprofiler_cpu_start): Use it.
460 (Fprofiler_cpu_stop): Prefer timer_settime if available.
461 Don't assume that passing NULL as the 2nd argument of setitimer
462 is the same as passing a pointer to all-zero storage.
463 Ignore SIGPROF afterwards.
464 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
465 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
466 non-fatal signal handlers. Ignore SIGPROF on startup.
467 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
468 in profiler.c, since sysdep.c now uses it.
469
470 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
471 Suggested by Eli Zaretskii in
472 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
473
474 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
475
476 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
477
478 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
479
480 * lisp.h (struct backtrace): Remove indirection for `function' field.
481 * xdisp.c (redisplay_internal):
482 * profiler.c (record_backtrace, sigprof_handler_1):
483 * alloc.c (Fgarbage_collect):
484 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
485 (Fbacktrace_frame): Adjust accordingly.
486
487 2012-09-28 Glenn Morris <rgm@gnu.org>
488
489 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
490 (Frun_hook_with_args_until_failure): Doc fixes.
491
492 2012-09-28 Eli Zaretskii <eliz@gnu.org>
493
494 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
495 Qautomatic_redisplay and change the symbol name. All users changed.
496
497 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
498
499 * profiler.c (sigprof_handler): Fix race condition.
500
501 2012-09-28 Glenn Morris <rgm@gnu.org>
502
503 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
504
505 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
506
507 Check more robustly for timer_settime.
508 * Makefile.in (LIB_TIMER_TIME): New macro.
509 (LIBES): Add it.
510 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
511 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
512 call timer_settime.
513
514 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
515
516 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
517
518 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
519
520 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
521
522 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
523
524 * character.h (MAYBE_UNIFY_CHAR): Remove.
525 * charset.c, charset.h (maybe_unify_char): Now static.
526 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
527 Since this stuff is now private to charset.c, there's no need for
528 a public macro and no need to inline by hand.
529
530 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
531 Stefan Monnier <monnier@iro.umontreal.ca>
532 Juanma Barranquero <lekktu@gmail.com>
533
534 * profiler.c: New file.
535 * Makefile.in (base_obj): Add profiler.o.
536 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
537 ($(BLD)/profiler.$(O)): New target.
538 * emacs.c (main): Call syms_of_profiler.
539 * alloc.c (Qautomatic_gc): New constant.
540 (MALLOC_PROBE): New macro.
541 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
542 (total_bytes_of_live_objects): New function.
543 (Fgarbage_collect): Use it. Record itself in backtrace_list.
544 Call malloc_probe for the memory profiler.
545 (syms_of_alloc): Define Qautomatic_gc.
546 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
547 race condition.
548 (struct backtrace): Move definition...
549 * lisp.h (struct backtrace): ..here.
550 (Qautomatic_gc, profiler_memory_running): Declare vars.
551 (malloc_probe, syms_of_profiler): Declare functions.
552 * xdisp.c (Qautomatic_redisplay): New constant.
553 (redisplay_internal): Record itself in backtrace_list.
554 (syms_of_xdisp): Define Qautomatic_redisplay.
555
556 2012-09-25 Eli Zaretskii <eliz@gnu.org>
557 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
558
559 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
560
561 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
562
563 Prefer POSIX timers if available.
564 They avoid a race if the timer is too close to the current time.
565 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
566 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
567 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
568
569 2012-09-25 Eli Zaretskii <eliz@gnu.org>
570
571 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
572 CHAR_STRING_ADVANCE.
573 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
574 STRING_CHAR_ADVANCE.
575
576 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
577
578 Move Vlibrary_cache to emacs.c and reset before dumping.
579
580 * lisp.h (reset_image_types): Declare.
581 [WINDOWSNT] (Vlibrary_cache): Declare.
582
583 * image.c (reset_image_types): New function.
584
585 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
586 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
587 (Fdump_emacs): Reset Vlibrary_cache and image_types.
588
589 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
590 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
591
592 * w32.h (Vlibrary_cache): Do not declare.
593
594 2012-09-25 Eli Zaretskii <eliz@gnu.org>
595
596 * w32proc.c (sys_signal): Handle all signals defined by the
597 MS-Windows runtime, not just SIGCHLD. Actually install the signal
598 handlers for signals supported by Windows. Don't override
599 term_ntproc as the handler for SIGABRT.
600 (sigaction): Rewrite to call sys_signal instead of duplicating its
601 code.
602 (sys_kill): Improve commentary.
603
604 * w32.c (term_ntproc): Accept (and ignore) one argument, for
605 consistency with a signature of a signal handler. All callers
606 changed.
607 (init_ntproc): Accept an argument DUMPING. If dumping, don't
608 install term_ntproc as a signal handler for SIGABRT, as that
609 should be done by the dumped Emacs.
610
611 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
612
613 * w32select.c (term_w32select): Protect against repeated
614 invocation by setting clipboard_owner to NULL after calling
615 DestroyWindow.
616
617 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
618 and term_ntproc to their modified signatures.
619
620 * character.c (char_string, string_char): Remove calls to
621 MAYBE_UNIFY_CHAR. See the discussion starting at
622 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
623 for the details.
624
625 2012-09-25 Chong Yidong <cyd@gnu.org>
626
627 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
628
629 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
630
631 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
632 when encountering an unknown bytecode.
633
634 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
635
636 image.c, indent.c: Use bool for booleans.
637 * dispextern.h (struct image_type): Members valid_p, load, init
638 now return bool, not int. All uses changed.
639 * image.c: Omit unnecessary static decls.
640 (x_create_bitmap_mask, x_build_heuristic_mask):
641 Return void, not int, since callers don't care about the return value.
642 (x_create_bitmap_mask, define_image_type, valid_image_p)
643 (struct image_keyword, parse_image_spec, image_spec_value)
644 (check_image_size, image_background)
645 (image_background_transparent, x_clear_image_1)
646 (postprocess_image, lookup_image, x_check_image_size)
647 (x_create_x_image_and_pixmap, xbm_image_p)
648 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
649 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
650 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
651 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
652 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
653 (png_image_p, init_png_functions, png_load_body, png_load)
654 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
655 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
656 (init_gif_functions, gif_load, imagemagick_image_p)
657 (imagemagick_load_image, imagemagick_load, svg_image_p)
658 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
659 (gs_load):
660 * nsimage.m (ns_load_image):
661 * nsterm.m (ns_defined_color):
662 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
663 * xfns.c (x_defined_color):
664 * xterm.c (x_alloc_lighter_color_for_widget)
665 (x_alloc_nearest_color_1, x_alloc_nearest_color)
666 (x_alloc_lighter_color):
667 * indent.c (disptab_matches_widthtab, current_column)
668 (scan_for_column, string_display_width, indented_beyond_p)
669 (compute_motion, vmotion, Fvertical_motion):
670 Use bool for booleans.
671
672 2012-09-24 Chong Yidong <cyd@gnu.org>
673
674 * chartab.c (Fset_char_table_default): Obsolete function removed.
675
676 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
677
678 Move pid_t related decls out of lisp.h.
679 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
680 (interruptible_wait_for_termination):
681 Move these decls from lisp.h to syswait.h, since they use pid_t.
682 Needed on FreeBSD; see Herbert J. Skuhra in
683 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
684 * callproc.c: Include syswait.h.
685
686 gnutls.c, gtkutil.c: Use bool for boolean.
687 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
688 (emacs_gnutls_handle_error):
689 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
690 (xg_hide_tooltip, xg_create_frame_widgets)
691 (create_dialog, xg_uses_old_file_dialog)
692 (xg_get_file_with_chooser, xg_get_file_with_selection)
693 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
694 (xg_item_label_same_p, xg_update_menubar)
695 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
696 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
697 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
698 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
699 (update_frame_tool_bar, free_frame_tool_bar):
700 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
701 * nsmenu.m (ns_update_menubar):
702 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
703 * xfns.c (Fx_show_tip) [USE_GTK]:
704 Use bool for boolean.
705 * gtkutil.c (xg_update_frame_menubar):
706 * xmenu.c (update_frame_menubar):
707 Return void, not int, since caller ignores return value.
708 * gtkutil.c (xg_change_toolbar_position):
709 Return void, not 1.
710
711 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
712
713 * makefile.w32-in (BLOCKINPUT_H): Remove.
714 (SYSSIGNAL_H): New macro.
715 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
716 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
717 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
718 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
719 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
720 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
721 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
722 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
723 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
724 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
725 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
726 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
727 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
728 ($(BLD)/w32xfns.$(O)): Update dependencies.
729
730 2012-09-23 Eli Zaretskii <eliz@gnu.org>
731
732 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
733 fatal_error_backtrace.
734
735 * w32proc.c (sys_kill): Undo last change: don't do anything when
736 invoked to deliver SIGABRT to our own process. This is now
737 handled by emacs_raise.
738
739 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
740
741 * w32term.c (w32_read_socket): Remove leftover reference to
742 interrupt_input_pending.
743
744 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
745
746 Do not use SA_NODEFER.
747 Problem reported by Dani Moncayo in
748 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
749 * alloc.c (die):
750 * sysdep.c (emacs_abort): Do not reset signal handler.
751 * emacs.c (terminate_due_to_signal): Reset signal handler here.
752 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
753 wanted even on POSIXish hosts, and it doesn't work on Windows.
754
755 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
756
757 * xterm.c (x_term_init): Call fixup_locale before and after calling
758 gtk_init (Bug#12392).
759
760 2012-09-23 Chong Yidong <cyd@gnu.org>
761
762 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
763 Vdynamic_library_alist.
764
765 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
766 (Fgnutls_available_p): Caller changed.
767
768 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
769 (Flibxml_parse_xml_region): Likewise.
770
771 * dispextern.h (struct image_type): Remove arg from init function.
772
773 * image.c (Finit_image_library, lookup_image_type)
774 (define_image_type): Remove now-unneeded second arg.
775 (init_xpm_functions, init_png_functions, init_jpeg_functions)
776 (init_tiff_functions, init_gif_functions, init_svg_functions):
777 Arglist and w32_delayed_load calling convention changed.
778 (gs_type): Remove init_gs_functions; there is no such function.
779 (valid_image_p, make_image): Fix caller to lookup_image_type.
780
781 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
782
783 Simplify and avoid signal-handling races (Bug#12471).
784 * alloc.c (die):
785 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
786 Avoid recursive loop if there's a fatal error in the function itself.
787 * atimer.c (pending_atimers):
788 * blockinput.h: Don't include "atimer.h"; no longer needed.
789 (interrupt_input_pending): Remove. All uses removed.
790 pending_signals now counts both atimers and ordinary interrupts.
791 This is less racy than having three separate pending-signal flags.
792 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
793 (input_blocked_p):
794 Rename from their upper-case counterparts BLOCK_INPUT,
795 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
796 INPUT_BLOCKED_P, and turn into functions. All uses changed.
797 This makes it easier to access volatile variables more accurately.
798 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
799 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
800 that's more reliable if the code is buggy and sets
801 interrupt_input_blocked to a negative value. All uses changed.
802 * atimer.c (deliver_alarm_signal):
803 Remove. No need to deliver this to the parent; any thread can
804 handle this signal now. All uses replaced by underlying handler.
805 * atimer.c (turn_on_atimers):
806 * dispnew.c (handle_window_change_signal):
807 * emacs.c (handle_danger_signal):
808 * keyboard.c (kbd_buffer_get_event):
809 Don't reestablish signal handler; not needed with sigaction.
810 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
811 (UNBLOCK_INPUT_TO):
812 Rework to avoid unnecessary accesses to volatile variables.
813 (UNBLOCK_INPUT_TO): Now a function.
814 (totally_unblock_input, unblock_input): New decls.
815 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
816 (init_data): Remove. Necessary stuff now done in init_signal.
817 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
818 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
819 (fatal_error_code): Remove; no longer needed.
820 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
821 it doesn't always backtrace. All uses changed. No need to reset
822 signal to default, since sigaction and/or die does that for us now.
823 Use emacs_raise (FOO), not kill (getpid (), FOO).
824 (main): Check more-accurately whether we're dumping.
825 Move fatal-error setup to sysdep.c
826 * floatfns.c: Do not include "syssignal.h"; no longer needed.
827 * gtkutil.c (xg_get_file_name, xg_get_font):
828 Remove no-longer-needed signal-mask manipulation.
829 * keyboard.c, process.c (POLL_FOR_INPUT):
830 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
831 * keyboard.c (read_avail_input): Remove.
832 All uses replaced by gobble_input.
833 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
834 (kbd_buffer_store_event_hold, gobble_input):
835 (record_asynch_buffer_change) [USABLE_SIGIO]:
836 (store_user_signal_events):
837 No need to mess with signal mask.
838 (gobble_input): If blocking input and there are terminals, simply
839 set pending_signals to 1 and return. All hooks changed to not
840 worry about whether input is blocked.
841 (process_pending_signals): Clear pending_signals before processing
842 them, in case a signal comes in while we're processing.
843 By convention callers now test pending_signals before calling us.
844 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
845 New functions, to support changes to blockinput.h.
846 (handle_input_available_signal): Now extern.
847 (reinvoke_input_signal): Remove. All uses replaced by
848 handle_async_input.
849 (quit_count): Now volatile, since a signal handler uses it.
850 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
851 All callers changed. Block SIGINT only if not already blocked.
852 Clear sigmask reliably, even if Fsignal returns, which it can.
853 Omit unnecessary accesses to volatile var.
854 (quit_throw_to_read_char): No need to restore sigmask.
855 * keyboard.c (gobble_input, handle_user_signal):
856 * process.c (wait_reading_process_output):
857 Call signal-handling code rather than killing ourselves.
858 * lisp.h: Include <float.h>, for...
859 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
860 (pending_signals): Now volatile.
861 (syms_of_data): Now const if IEEE floating point.
862 (handle_input_available_signal) [USABLE_SIGIO]:
863 (terminate_due_to_signal, record_child_status_change): New decls.
864 * process.c (create_process): Avoid disaster if memory is exhausted
865 while we're processing a vfork, by tightening the critical section
866 around the vfork.
867 (send_process_frame, process_sent_to, handle_pipe_signal)
868 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
869 ignores SIGPIPE.
870 (send_process): No need for setjmp/longjmp any more, since the
871 SIGPIPE stuff is now gone. Instead, report an error if errno
872 is EPIPE.
873 (record_child_status_change): Now extern. PID and W are now args.
874 Return void, not bool. All callers changed.
875 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
876 Remove. All uses removed. This bug should be fixed now in a
877 different way.
878 (wait_for_termination_1): Use waitpid rather than sigsuspend,
879 and record the child status change directly. This avoids the
880 need to futz with the signal mask.
881 (process_fatal_action): Move here from emacs.c.
882 (emacs_sigaction_flags): New function, containing
883 much of what used to be in emacs_sigaction_init.
884 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
885 caught by emacs, to make races less likely.
886 (deliver_process_signal): Rename from handle_on_main_thread.
887 All uses changed.
888 (BACKTRACE_LIMIT_MAX): Now at top level.
889 (thread_backtrace_buffer, threadback_backtrace_pointers):
890 New static vars.
891 (deliver_thread_signal, deliver_fatal_thread_signal):
892 New functions, for more-accurate delivery of thread-specific signals.
893 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
894 (deliver_arith_signal): Handle in this thread, not
895 in the main thread, since it's triggered by this thread.
896 (maybe_fatal_sig): New function.
897 (init_signals): New arg DUMPING so that we can be more accurate
898 about whether we're dumping. Caller changed.
899 Treat thread-specific signals differently from process-general signals.
900 Block all signals while handling fatal error; that's safer.
901 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
902 on IEEE hosts.
903 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
904 Ignore SIGPIPE unless batch.
905 (emacs_backtrace): Output backtrace for the appropriate thread,
906 which is not necessarily the main thread.
907 * syssignal.h: Include <stdbool.h>.
908 (emacs_raise): New macro.
909 * xterm.c (x_connection_signal): Remove; no longer needed
910 now that we use sigaction.
911 (x_connection_closed): No need to mess with sigmask now.
912 (x_initialize): No need to reset SIGPIPE handler here, since
913 init_signals does this for us now.
914
915 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
916
917 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
918 background rect may be larger (Bug#12245).
919
920 2012-09-23 Chong Yidong <cyd@gnu.org>
921
922 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
923
924 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
925
926 * .gdbinit: Just stop at fatal_error_backtrace.
927 See Stefan Monnier's request in
928 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
929 Remove no-longer-used query of system type.
930
931 2012-09-22 Chong Yidong <cyd@gnu.org>
932
933 * search.c (Freplace_match): Doc fix (Bug#12325).
934
935 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
936
937 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
938 (Fline_end_position): Doc fix.
939
940 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
941
942 2012-09-22 Chong Yidong <cyd@gnu.org>
943
944 * dispextern.h (struct image_type): Add new slot, storing a type
945 initialization function.
946
947 * image.c (define_image_type): Call the image initializer function
948 if it is defined. Arguments and return value changed.
949 (valid_image_p, make_image): Callers changed.
950 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
951 (gif_type, imagemagick_type, svg_type, gs_type):
952 Add initialization functions.
953 (Finit_image_library): Call lookup_image_type.
954 (CHECK_LIB_AVAILABLE): Macro deleted.
955 (lookup_image_type): Call define_image_type here, rather than via
956 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
957 (syms_of_image): Move define_image_type calls for xbm_type and
958 pbm_type to lookup_image_type.
959
960 2012-09-22 Eli Zaretskii <eliz@gnu.org>
961
962 * keyboard.c (timer_check_2): Move calculation of 'timers' and
963 'idle_timers' from here ...
964 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
965 lists, to avoid infloops when the timer does something stupid,
966 like reinvoke itself with the same or smaller time-out.
967 (Bug#12447)
968
969 2012-09-22 Martin Rudalics <rudalics@gmx.at>
970
971 * window.c (Fsplit_window_internal): Handle only Qt value of
972 Vwindow_combination_limit separately.
973 (Qtemp_buffer_resize): New symbol.
974 (Vwindow_combination_limit): New default value.
975 Rewrite doc-string.
976
977 2012-09-22 Eli Zaretskii <eliz@gnu.org>
978
979 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
980 the new overlay string. (Bug#10159)
981
982 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
983
984 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
985 or that fprintf is async-signal-safe. POSIX doesn't require
986 either assumption.
987
988 2012-09-22 Chong Yidong <cyd@gnu.org>
989
990 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
991 (Bug#8207).
992
993 2012-09-22 Kenichi Handa <handa@gnu.org>
994
995 * composite.c (composition_reseat_it): Handle the case that a
996 grapheme cluster is not covered by a single font (Bug#12352).
997
998 2012-09-21 Chong Yidong <cyd@gnu.org>
999
1000 * image.c (define_image_type): Avoid adding duplicate types to
1001 image_types (Bug#12463). Suggested by Jörg Walter.
1002
1003 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1004
1005 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1006 (print_load_command_name): Add case LC_DATA_IN_CODE.
1007 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1008
1009 2012-09-21 Glenn Morris <rgm@gnu.org>
1010
1011 * eval.c (Frun_hook_with_args_until_success)
1012 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1013
1014 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1015
1016 * fileio.c (Ffile_selinux_context): Only call freecon when
1017 lgetfilecon succeeded.
1018 (Fset_file_selinux_context): Likewise. (Bug#12444)
1019
1020 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1021
1022 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1023 reordering, locate the cursor by calling set_cursor_from_row; if
1024 that fails, clear the desired glyph matrix before returning a
1025 failure indication to the caller. Fixes leaving garbled display
1026 when fast scrolling with a down-key. (Bug#12403)
1027 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1028 scrolling through multibyte text.
1029
1030 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1031
1032 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1033 calling mark_vectorlike since that's the one that marks the window.
1034 (mark_discard_killed_buffers): Mark the final cdr.
1035 * window.h (struct window): Move prev/next_buffers to the
1036 non-standard fields.
1037 * window.c (make_window): Initialize prev/next_buffers manually.
1038
1039 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1040
1041 Omit unused arg EXPECTED from socket hooks.
1042 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1043 * nsterm.m (ns_term_init):
1044 * termhooks.h (struct terminal.read_socket_hook):
1045 * w32inevt.c (w32_console_read_socket):
1046 * w32term.c (w32_read_socket):
1047 * xterm.c (XTread_socket):
1048 Omit unused arg EXPECTED. All callers changed.
1049 (store_user_signal_events): Return void, not int, since callers no
1050 longer care about the return value. All uses changed.
1051
1052 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
1053
1054 * w32gui.h (XParseGeometry): Do not declare.
1055
1056 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1057
1058 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1059 Ignore 'expected'. See Eli Zaretskii in
1060 <http://bugs.gnu.org/12471#8> (last line).
1061
1062 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1063 (XParseGeometry): Now static. Substitute extremal values for
1064 values that are out of range.
1065
1066 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1067
1068 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1069
1070 * nsfns.m (XParseGeometry): Remove.
1071 (Fx_create_frame): Call x_set_offset to correctly interpret
1072 top_pos in geometry.
1073
1074 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1075 (Fx_parse_geometry): If there is a space in string, call
1076 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1077
1078 2012-09-17 Eli Zaretskii <eliz@gnu.org>
1079
1080 * search.c (scan_buffer): Use character positions in calls to
1081 region_cache_forward and region_cache_backward, not byte
1082 positions. (Bug#12196)
1083
1084 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1085 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1086
1087 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1088 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1089 emacs_blocked_malloc, now deleted.
1090
1091 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1092
1093 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1094 The workaround was for improving performance on Solaris 2.4, but
1095 is getting in the way now. Emacs will still work if someone is
1096 still running Solaris 2.4 in a museum somewhere; Sun dropped
1097 support for Solaris 2.4 in 2003.
1098 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1099 * process.c (create_process) [HAVE_WORKING_VFORK]:
1100 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1101 since Emacs no longer uses vfork on that platform.
1102
1103 2012-09-17 Glenn Morris <rgm@gnu.org>
1104
1105 * emacs.c: Use COPYRIGHT.
1106
1107 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1108
1109 Remove configure's --without-sync-input option (Bug#12450).
1110 When auditing signal-handling in preparation for cleaning it up,
1111 I found that SYNC_INPUT has race conditions and would be a real
1112 pain to fix. Since it's an undocumented and deprecated
1113 configure-time option, now seems like a good time to remove it.
1114 Also see <http://bugs.gnu.org/11080#16>.
1115 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1116 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1117 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1118 (malloc_hysteresis):
1119 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1120 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1121 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1122 (dont_register_blocks, bytes_used_when_reconsidered)
1123 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1124 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1125 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1126 Remove. All uses removed.
1127 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1128 implementation, one that depends on whether the new macro
1129 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1130 is defined.
1131 * atimer.c (run_timers, handle_alarm_signal):
1132 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1133 (handle_async_input, process_pending_signals)
1134 (handle_input_available_signal, init_keyboard):
1135 * nsterm.m (ns_read_socket):
1136 * process.c (wait_reading_process_output):
1137 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1138 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1139 (emacs_write):
1140 * xterm.c (XTread_socket):
1141 Assume SYNC_INPUT.
1142 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1143 * eval.c (handling_signal): Remove. All uses removed.
1144 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1145 All uses replaced with the SYNC_INPUT version.
1146 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1147 Remove decls.
1148 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1149 Now static.
1150
1151 * font.c (Ffont_shape_gstring): Remove unused local.
1152
1153 2012-09-16 Glenn Morris <rgm@gnu.org>
1154
1155 * Makefile.in (clean): No longer run nextstep's clean.
1156
1157 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1158 (ns_frag): Remove.
1159 (ns-app): Move here from ns.mk, and simplify.
1160 (clean): Simplify nextstep entry.
1161 * ns.mk: Remove file.
1162
1163 2012-09-17 Kenichi Handa <handa@gnu.org>
1164
1165 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1166 not covert the last few charactes.
1167
1168 2012-09-16 Kenichi Handa <handa@gnu.org>
1169
1170 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1171 here, but just check the validity of glyphs in the glyph-string.
1172
1173 2012-09-16 Martin Rudalics <rudalics@gmx.at>
1174
1175 * window.c (Fwindow_parameter, Fset_window_parameter):
1176 Accept any window as argument (Bug#12452).
1177
1178 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1179
1180 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1181 to ns_term_init to avoid memory leak.
1182
1183 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1184 explicit retain/release.
1185 (ns_term_init): Only allow one display. Initialize outerpool and
1186 ns_*_types.
1187
1188 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1189
1190 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1191 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1192 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1193 the Microsoft problem in a different way, by altering ../nt/config.nt.
1194
1195 2012-09-15 Eli Zaretskii <eliz@gnu.org>
1196
1197 * w32xfns.c:
1198 * w32uniscribe.c:
1199 * w32term.c:
1200 * w32select.c:
1201 * w32reg.c:
1202 * w32proc.c:
1203 * w32menu.c:
1204 * w32inevt.c:
1205 * w32heap.c:
1206 * w32font.c:
1207 * w32fns.c:
1208 * w32console.c:
1209 * w32.c:
1210 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1211 by lisp.h. This completes removal of setjmp.h inclusion
1212 erroneously announced in the previous commit. (Bug#12446)
1213
1214 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1215 more accurate.
1216
1217 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1218 not defined as a macro. The latter happens on MS-Windows.
1219 (Bug#12446)
1220
1221 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1222
1223 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1224 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1225 Some instances of '#include <setjmp.h>' removed, if the
1226 only reason for the instance was because "lisp.h" was included.
1227 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1228 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1229 and _longjmp with the new symbols. Emacs already uses _setjmp if
1230 available, so this change affects only POSIXish hosts that have
1231 sigsetjmp but not _setjmp, such as some versions of Solaris and
1232 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1233 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1234 (png_load_body) [HAVE_PNG]:
1235 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1236 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1237 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1238 since PNG requires jmp_buf. This is the only exception to the
1239 general rule that we now use sys_setjmp and sys_longjmp.
1240 This exception is OK since this code does not change the signal
1241 mask or longjmp out of a signal handler.
1242
1243 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1244
1245 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1246 Include "syssignal.h", for 'main_thread'.
1247
1248 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1249
1250 Avoid out-of-range marker position (Bug#12426).
1251 * insdel.c (replace_range, replace_range_2):
1252 Adjust markers before overlays, as suggested by comments.
1253 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1254 Remove redundant check before calling offset_intervals.
1255
1256 2012-09-14 Martin Rudalics <rudalics@gmx.at>
1257
1258 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1259 current buffer (Bug#12387).
1260
1261 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
1262
1263 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1264
1265 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1266
1267 Use a more backwards-compatible timer format (Bug#12430).
1268 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1269 vector element, not from the 4th, since PSECS is now at the end.
1270 (Fcurrent_idle_time): Doc fix.
1271
1272 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1273
1274 Function to mark objects and remove killed buffers at once.
1275 * alloc.c (discard_killed_buffers): Rename to ...
1276 (mark_discard_killed buffers) ... new name. Add marking
1277 of remaining objects. Fix comment. Adjust users.
1278 (mark_object): Do not touch frame buffer lists here.
1279 * frame.c (delete_frame): Reset frame buffer lists here.
1280
1281 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1282
1283 Better workaround for GNOME bug when --enable-gcc-warnings.
1284 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1285 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1286 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1287
1288 Simplify SIGIO usage (Bug#12408).
1289 The code that dealt with SIGIO was crufty and confusing, e.g., it
1290 played tricks like "#undef SIGIO" but these tricks were not used
1291 consistently. Simplify mostly by not #undeffing standard symbols,
1292 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1293 or not as we please) rather than "defined SIGIO" (standard symbol
1294 that we probably shouldn't #undef).
1295 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1296 Modules that need it can include it.
1297 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1298 * dispextern.h (ignore_sigio): New decl.
1299 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1300 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1301 * emacs.c (shut_down_emacs):
1302 * keyboard.c (kbd_buffer_store_event_hold):
1303 Use ignore_sigio rather than invoking 'signal' directly.
1304 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1305 for FIONREAD.
1306 (FIONREAD, SIGIO): Do not #undef.
1307 (tty_read_avail_input): Use #error rather than a syntax error.
1308 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1309 for I_PIPE, used by SETUP_SLAVE_PTY.
1310 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1311 * sysdep.c (croak): Remove; no longer needed. This bit of
1312 temporary code, with Fred N. Fish's comment that it's temporary,
1313 has been in Emacs since at least 1992!
1314 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1315 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1316 * syssignal.h (croak): Remove decl.
1317 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1318 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1319 now that we're termios-only.
1320 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1321 * term.c (dissociate_if_controlling_tty): Use #error rather than
1322 a run-time error.
1323
1324 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1325 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1326 to work around GNOME bug 683906.
1327 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1328 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1329 This works around GCC bug 54561.
1330
1331 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1332
1333 More fixes for 'volatile' and setjmp/longjmp.
1334 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1335 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1336 (png_load_body) [HAVE_PNG]:
1337 (jpeg_load_body) [HAVE_JPEG]:
1338 New function, with most of the old parent function's body.
1339 (png_load) [HAVE_PNG]:
1340 (jpeg_load) [HAVE_JPEG]:
1341 Invoke the new function, to avoid longjmp munging our locals.
1342 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1343 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1344 longjmp is passed 2, as the C standard doesn't guarantee this.
1345 Instead, store the failure code into mgr->failure_code.
1346
1347 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1348
1349 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1350 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1351 (syms_of_keyboard): Remove support for unread-command-char.
1352
1353 2012-09-12 Eli Zaretskii <eliz@gnu.org>
1354
1355 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1356 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1357 violation. (Bug#12426)
1358
1359 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1360
1361 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1362
1363 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1364
1365 * eval.c: Add `inhibit-debugger'.
1366 (Qinhibit_debugger): New symbol.
1367 (call_debugger): Bind it instead of Qdebug_on_error.
1368 (maybe_call_debugger): Test Vinhibit_debugger.
1369 (syms_of_eval): Define inhibit-debugger.
1370 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1371 (syms_of_xdisp): Remove inhibit-debug-on-message.
1372
1373 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1374
1375 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1376 If a nonvolatile local variable is written before a _longjmp to
1377 the frame containing the variable, and is read after the _longjmp,
1378 the value read is indeterminate. Some local variables of type
1379 'struct handler' and 'struct catchtag' are used in this way, so
1380 mark each of their slots as volatile if the slot can be set before
1381 _longjmp and read afterwards.
1382 * lisp.h (struct handler): var and chosen_clause are now volatile.
1383 (struct catchtag): val, next, and pdlcount are now volatile.
1384
1385 * bidi.c (bidi_push_it, bidi_pop_it):
1386 * fns.c (copy_hash_table):
1387 * image.c (define_image_type):
1388 * keyboard.c (kbd_buffer_store_event_hold):
1389 * process.c (Fprocess_send_eof):
1390 * xfaces.c (x_create_gc) [HAVE_NS]:
1391 * xgselect.c (xg_select):
1392 Prefer assignment to memcpy when either will do.
1393
1394 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1395 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1396 time an item is removed. No need to mark this function 'inline';
1397 the compiler knows better than we do.
1398
1399 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1400
1401 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1402 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1403 to change_frame_size (Bug#12388).
1404 (windowDidResize:): Pass YES to updateFrameSize.
1405
1406 * nsterm.h: Add delay parameter to updateFrameSize.
1407
1408 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1409
1410 Discard killed buffers from deleted window and frame objects.
1411 This reduces an amount of references to killed buffers and
1412 helps GC to reclaim them faster.
1413 * alloc.c (discard_killed_buffers): New function.
1414 (mark_object): Use it for deleted windows and frames.
1415 (mark_object): If symbol's value is set up for a killed buffer
1416 or deleted frame, restore it's global binding.
1417 * data.c (swap_in_global_binding): Add GC notice.
1418 (swap_in_symval_forwarding): Use convenient set_blv_where.
1419 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1420 * window.h: ... to here.
1421
1422 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1423
1424 Convenient macro to check whether the buffer is live.
1425 * buffer.h (BUFFER_LIVE_P): New macro.
1426 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1427 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1428
1429 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1430
1431 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1432 composition cases (Bug#12364).
1433
1434 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1435 overhang of succeeding glyphs overlapping box cursor.
1436
1437 * w32term.c (x_draw_glyph_string): Likewise.
1438
1439 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1440
1441 Simplify, document, and port floating-point (Bug#12381).
1442 The porting part of this patch fixes bugs on non-IEEE platforms
1443 with frexp, ldexp, logb.
1444 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1445 Now static.
1446 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1447 support, by removing commented-out code and briefly listing the
1448 C89 functions excluded. The commented-out stuff was confusing
1449 maintenance, e.g., we thought we needed cbrt but it was commented out.
1450 (logb): Remove decl; no longer needed.
1451 (isfinite): New macro, if not already supplied.
1452 (isnan): Don't replace any existing macro.
1453 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1454 are present on all C89 platforms.
1455 (Ffrexp): Do not special-case zero, as frexp does the right thing
1456 for that case.
1457 (Flogb): Do not use logb, as it doesn't have the desired meaning
1458 on hosts that use non-base-2 floating point. Instead, stick with
1459 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1460 frexp, to avoid getting an unspecified result.
1461
1462 * xdisp.c (Qinhibit_debug_on_message): Now static.
1463
1464 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1465
1466 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1467 NSBezierPath (Bug#12131).
1468
1469 2012-09-10 Chong Yidong <cyd@gnu.org>
1470
1471 * fns.c (Fdelq, Fdelete): Doc fix.
1472
1473 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1474
1475 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1476 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1477
1478 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1479
1480 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1481 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1482 Use it.
1483
1484 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1485
1486 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1487 left fringe if the window has a left margin. This avoids leaving
1488 traces of the cursor because its leftmost pixel is not drawn over.
1489
1490 * dispnew.c (update_window_line): When the left margin area of a
1491 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1492 that screen line. (Bug#12277)
1493
1494 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1495
1496 Assume C89 or later for math functions (Bug#12381).
1497 This simplifies the code, and makes it a bit smaller and faster,
1498 and (most important) makes it easier to clean up signal handling
1499 since we can stop worring about floating-point exceptions in
1500 library code. That was a problem before C89, but the problem
1501 went away many years ago on all practical Emacs targets.
1502 * data.c, image.c, lread.c, print.c:
1503 Don't include <math.h>; no longer needed.
1504 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1505 might be autoconfigured, as that never happens.
1506 * data.c (fmod):
1507 * doprnt.c (DBL_MAX_10_EXP):
1508 * print.c (DBL_DIG):
1509 Remove. C89 or later always defines these.
1510 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1511 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1512 (arith_error, domain_error, domain_error2):
1513 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1514 no longer needed -- we simply return what C returns. All uses removed.
1515 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1516 the wrapped code.
1517 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1518 Remove. All uses expanded, as these macros are no longer used
1519 more than once and are now more trouble than they're worth.
1520 (Ftan): Use tan, not sin / cos.
1521 (Flogb): Assume C89 frexp.
1522 (fmod_float): Assume C89 fmod.
1523 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1524 (init_floatfns): Remove. All uses removed.
1525
1526 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1527
1528 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1529 compositeToPoint for OSX < 10.6 (Bug#12390).
1530
1531 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1532
1533 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1534 This produces more-accurate results.
1535
1536 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1537
1538 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1539 changes (Bug#12088).
1540
1541 2012-09-08 Chong Yidong <cyd@gnu.org>
1542
1543 * syntax.c (Fstring_to_syntax): Doc fix.
1544
1545 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1546
1547 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1548 in the internal border.
1549 (x_set_window_size): Remove static variables and their usage.
1550 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1551 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1552 Remove fringe/internal border adjustment (Bug#11052).
1553 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1554 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1555 (ns_fix_rect_ibw): Remove.
1556 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1557 (ns_dumpglyphs_box_or_relief): Ditto.
1558 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1559 adjustment.
1560 (ns_dumpglyphs_image): Ditto.
1561 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1562 border adjustment.
1563 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1564 their usage. Add fringe_extended_p and its use as in other terms.
1565 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1566 scroll bar was removed.
1567 (updateFrameSize): New function.
1568 (windowDidResize): Move code to updateFrameSize and call it.
1569
1570 * nsterm.h (EmacsView): Add updateFrameSize.
1571
1572 2012-09-07 Chong Yidong <cyd@gnu.org>
1573
1574 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1575
1576 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1577
1578 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1579
1580 More signal-handler cleanup (Bug#12327).
1581 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1582 Problem introduced when merging patches. Noted by Eli Zaretskii in
1583 <http://bugs.gnu.org/12327#67>.
1584 * floatfns.c: Comment fix.
1585 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1586 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1587 and anyway the declaration is harmless even if SIGDANGER is not defined.
1588 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1589 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1590 source files not surprisingly expected syssignal.h to define, or
1591 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1592 Include <sys/ioctl.h>, for FIONREAD.
1593 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1594 This eliminates a problem whereby other files mysteriously had
1595 to include "syssignal.h" before including "systty.h" if they
1596 wanted to use "#ifdef SIGIO".
1597
1598 2012-09-07 Eli Zaretskii <eliz@gnu.org>
1599
1600 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1601
1602 * w32.c (sigemptyset): Empty the set.
1603 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1604
1605 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1606
1607 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1608
1609 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1610 (mark_object): Likewise for frame objects.
1611
1612 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1613
1614 * syssignal.h (handle_on_main_thread): Always declare,
1615 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1616 This ports to platforms without HAVE_PTHREAD.
1617
1618 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1619
1620 Signal-handler cleanup (Bug#12327).
1621 Emacs's signal handlers were written in the old 4.2BSD style with
1622 sigblock and sigmask and so forth, and this led to some
1623 inefficiencies and confusion. Rewrite these to use
1624 pthread_sigmask etc. without copying signal sets around. Also,
1625 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1626 'signal', and instead use functions that do not attempt to take
1627 over the system name space. This patch causes Emacs's text
1628 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1629 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1630 Do not include <signal.h> or "syssignal.h", as these
1631 modules do not use signals.
1632 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1633 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1634 Do not include <signal.h>, as "syssignal.h" does that for us now.
1635 * atimer.c (sigmask_atimers): New function.
1636 (block_atimers, unblock_atimers): New functions,
1637 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1638 All uses replaced.
1639 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1640 no longer needed here.
1641 * emacs.c (main): Inspect existing signal handler with sigaction,
1642 so that there's no need to block and unblock SIGHUP.
1643 * sysdep.c (struct save_signal): New member 'action', replacing
1644 old member 'handler'.
1645 (save_signal_handlers, restore_signal_handlers):
1646 Use sigaction instead of 'signal' to save and restore.
1647 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1648 New function. All users of 'signal' modified to use set_sighandler
1649 if they're writeonly, and to use sys_signal if they're read+write.
1650 (emacs_sigaction_init, forwarded_signal): New functions.
1651 (sys_signal): Remove. All uses replaced by calls to sigaction
1652 and emacs_sigaction_init, or by direct calls to 'signal'.
1653 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1654 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1655 all uses replaced by pthread_sigmask etc. calls.
1656 * syssignal.h: Include <signal.h>.
1657 (emacs_sigaction_init, forwarded_signal): New decls.
1658 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1659 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1660 (sigmask, sys_sigmask): Remove; no longer needed.
1661 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1662 (sigblock, sigunblock, sigfree):
1663 (sigsetmask) [!defined sigsetmask]:
1664 Remove. All uses replaced by pthread_sigmask.
1665 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1666 no longer need to be replaced, and its typical old uses
1667 are now done via emacs_sigaction_init and sigaction.
1668 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1669 (sys_sigdel): Remove; unused.
1670 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1671
1672 2012-09-06 Eli Zaretskii <eliz@gnu.org>
1673
1674 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1675 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1676
1677 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1678
1679 Explicitly mark buffer_defaults and buffer_local_symbols.
1680 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1681 mark_local_symbols here.
1682 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1683 since special buffers aren't marked here any more.
1684 (allocate_buffer): Chain new buffer with all_buffers here...
1685 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1686 not here.
1687 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1688 (syms_of_buffer): Remove staticpro of the above.
1689 (init_buffer_once): Set names for buffer_defaults and
1690 buffer_local_symbols.
1691
1692 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1693
1694 Use bool for booleans in font-related modules.
1695 * font.c (font_intern_prop, font_style_to_value)
1696 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1697 (generate_otf_features, font_check_otf_features, font_check_otf)
1698 (font_match_p, font_list_entities, font_at):
1699 * fontset.c (fontset_id_valid_p, reorder_font_vector
1700 (fontset_find_font, Fset_fontset_font)
1701 (face_suitable_for_char_p) [0]:
1702 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1703 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1704 (m17n_flt_initialized, ftfont_shape_by_flt):
1705 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1706 * nsfont.m (nsfont_draw):
1707 * w32font.c (w32font_draw):
1708 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1709 Use bool for booleans.
1710 * font.h: Adjust to above API changes.
1711 (struct font, struct font_driver, struct font_driver_list):
1712 Use bool for booleans.
1713 (struct font): Remove useless member encoding_type.
1714 All users removed.
1715 * fontset.c, xftfont.c: Omit unnecessary static decls.
1716
1717 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1718
1719 * alloc.c (mark_object): Revert window marking code
1720 since it's unsafe for the Fset_window_configuration.
1721
1722 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1723
1724 Fix race conditions with signal handlers and errno (Bug#12327).
1725 Be more systematic about preserving errno whenever a signal
1726 handler returns, even if it's not in the main thread. Do this by
1727 renaming signal handlers to distinguish between signal delivery
1728 and signal handling. All uses changed.
1729 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1730 * data.c (deliver_arith_signal): Rename from arith_error.
1731 * dispnew.c (deliver_window_change_signal): Rename from
1732 window_change_signal.
1733 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1734 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1735 * keyboard.c (deliver_input_available_signal): Rename from
1736 input_available_signal.
1737 (deliver_user_signal): Rename from handle_user_signal.
1738 (deliver_interrupt_signal): Rename from interrupt_signal.
1739 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1740 (deliver_child_signal): Rename from sigchld_handler.
1741 * atimer.c (handle_alarm_signal):
1742 * data.c (handle_arith_signal):
1743 * dispnew.c (handle_window_change_signal):
1744 * emacs.c (handle_fatal_signal, handle_danger_signal):
1745 * keyboard.c (handle_input_available_signal):
1746 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1747 * process.c (handle_pipe_signal, handle_child_signal):
1748 New functions, with the actual signal-handling code taken from the
1749 original respective signal handlers, sans the sporadic attempts to
1750 preserve errno, since that's now done by handle_on_main_thread.
1751 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1752 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1753 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1754 Move to sysdep.c.
1755 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1756 Move initialization of main_thread to sysdep.c's init_signals.
1757 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1758 our usage, and simplifies the mainline code.
1759 (record_child_status_change): New static function, as a helper
1760 for handle_child_signal, and with most of the old child handler's
1761 contents.
1762 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1763 (handle_child_signal): Use the above.
1764 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1765 Moved here from emacs.c.
1766 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1767 code moved here from emacs.c's main function.
1768 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1769 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1770 This lets callers save and restore errno properly.
1771
1772 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1773
1774 Remove redundant or unused things here and there.
1775 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1776 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1777 * editfns.c (Fcompare_buffer_substrings): Likewise.
1778 * frame.h (struct terminal, struct font_driver_list):
1779 Remove redundant declarations.
1780 * window.h (Qleft, Qright): Likewise.
1781
1782 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1783
1784 Do not mark objects from deleted buffers, windows and frames.
1785 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1786 (mark_object): Likewise for windows and frames.
1787
1788 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1789
1790 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1791 buffer_defaults and buffer_local_symbols as valid objects.
1792 Return special value to denote them.
1793
1794 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1795
1796 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1797 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1798 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1799 (file_name_absolute_p, Fsubstitute_in_file_name):
1800 (check_executable, check_writable, Ffile_accessible_directory_p)
1801 (Fset_file_selinux_context, Fdefault_file_modes)
1802 (Finsert_file_contents, choose_write_coding_system)
1803 (Fwrite_region, build_annotations, a_write, e_write)
1804 (Fdo_auto_save):
1805 * filelock.c (boot_time_initialized, get_boot_time)
1806 (get_boot_time_1, lock_file_1, within_one_second):
1807 * floatfns.c (in_float):
1808 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1809 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1810 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1811 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1812 * window.c (compare_window_configurations):
1813 Use bool for booleans.
1814 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1815 (Fdefault_file_modes): Now mode_t, not int, for modes.
1816 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1817 (internal_delete_file): Now returns void, not a (boolean) int,
1818 since nobody was looking at the return value.
1819 * lisp.h, window.h: Adjust to above API changes.
1820
1821 * xdisp.c (set_message): Simplify and reindent last change.
1822
1823 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
1824
1825 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1826
1827 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1828
1829 * eval.c (call_debugger): Make the function non-static so that we
1830 can call it from set_message.
1831
1832 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1833 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1834
1835 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1836
1837 Give more-useful info on a fatal error (Bug#12328).
1838 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1839 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1840 of doing the work ourselves.
1841 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1842 do most of the work.
1843 (fatal_error_backtrace): New function, taken from the guts
1844 of the old fatal_error_signal, but with a new option to output
1845 a backtrace.
1846 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1847 info about the signal than just its number.
1848 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1849 * sysdep.c: Include <execinfo.h>
1850 (emacs_backtrace): New function, taken partly from the previous
1851 code of the 'die' function.
1852 (emacs_abort): Call fatal_error_backtrace rather than abort.
1853
1854 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1855
1856 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1857 eager (load-time) macro-expansion.
1858 * lisp.mk (lisp): Add macroexp.
1859
1860 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1861
1862 Simplify redefinition of 'abort' (Bug#12316).
1863 Do not try to redefine the 'abort' function. Instead, redo
1864 the code so that it calls 'emacs_abort' rather than 'abort'.
1865 This removes the need for the NO_ABORT configure-time macro
1866 and makes it easier to change the abort code to do a backtrace.
1867 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1868 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1869 Remove; sysdep.c's emacs_abort now takes its place.
1870 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1871 'abort' changed to use 'emacs_abort'.
1872 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1873 (abort) [!defined abort]: Rename to ...
1874 (emacs_abort): ... new name.
1875 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1876 the place of the old 'abort' in emacs.c.
1877 * w32.c, w32fns.c (abort): Do not #undef.
1878 * w32.c (emacs_abort): Rename from w32_abort.
1879
1880 2012-09-04 Eli Zaretskii <eliz@gnu.org>
1881
1882 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1883 offsets[j].dv, since the y axis of the screen coordinates points
1884 down, while the y axis of the font definition coordinates points
1885 up. This fixes display of Arabic diacritics such as KASRA and
1886 KASRATAN. (Bug#11860)
1887
1888 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1889
1890 Be more systematic about _setjmp vs setjmp.
1891 * alloc.c (test_setjmp, mark_stack):
1892 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1893 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1894 (png_load, my_error_exit, jpeg_load):
1895 * process.c (send_process_trap, send_process):
1896 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1897 The underscored versions are up to 30x faster on some hosts.
1898 Formerly, the code used setjmp+longjmp sometimes and
1899 _setjmp+_longjmp at other times, with no particular reason to
1900 prefer setjmp+longjmp.
1901
1902 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1903
1904 Fix minor problem found by static checking.
1905 * buffer.c (Fdelete_all_overlays): Return nil.
1906
1907 2012-09-03 Martin Rudalics <rudalics@gmx.at>
1908
1909 * buffer.c (Fdelete_all_overlays): New function.
1910
1911 2012-09-03 Chong Yidong <cyd@gnu.org>
1912
1913 * gtkutil.c: Add extern decl for Qxft.
1914
1915 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1916
1917 * emacs.c, eval.c: Use bool for boolean.
1918 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1919 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1920 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1921 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1922 (main, decode_env_path, Fdaemon_initialized):
1923 * eval.c (call_debugger, Finteractive_p, interactive_p):
1924 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1925 (maybe_call_debugger, Fbacktrace):
1926 * process.c (read_process_output, exec_sentinel):
1927 Use bool for booleans.
1928 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1929 All callers changed.
1930 * eval.c (interactive_p): Omit always-true boolean argument
1931 EXCLUDE_SUBRS_P. All callers changed.
1932 * dispextern.h, lisp.h: Reflect above API changes.
1933 * firstfile.c (dummy): Use the address of 'main', whose signature
1934 won't change, instead of the address of 'initialize', whose
1935 signature just changed from int to bool.
1936 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1937 * msdos.c (fatal_error_in_progress): ... from here.
1938 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1939 of incrementing it.
1940 (redisplay_internal, unwind_redisplay): Simply clear
1941 REDISPLAYING_P when unwinding, instead of saving its previous,
1942 always-false value and then restoring it.
1943
1944 Clean up some extern decls.
1945 Mostly, this hoists extern decls out of .c files and into .h files.
1946 That way, we're more likely to catch errors if the interfaces change.
1947 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1948 declare xg_mark_data.
1949 * dispextern.h (x_frame_parm_handlers):
1950 * font.h (Qxft):
1951 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1952 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1953 (Qultra_bold, Qoblique, Qitalic):
1954 Move extern decl here from .c file.
1955 * alloc.c (xg_mark_data) [USE_GTK]:
1956 * doc.c (Qclosure):
1957 * eval.c (Qlexical_binding):
1958 * fns.c (time) [!HAVE_UNISTD_H]:
1959 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1960 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1961 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1962 * lread.c (Qinternal_interpreter_environment):
1963 * minibuf.c (Qbuffer):
1964 * process.c (QCfamily, QCfilter):
1965 * widget.c (free_frame_faces):
1966 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1967 * xfont.c (x_clear_errors):
1968 * xterm.c (x_frame_parm_handlers):
1969 Remove now-redundant extern decls.
1970 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1971 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1972 Now static.
1973 * xfaces.c: Remove unnecessary static decls.
1974 * xterm.c (updating_frame): Remove decl of nonexistent object.
1975
1976 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1977 when building globals.h, as the objects that are not built on
1978 this host are not needed to compile C files on this host.
1979
1980 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1981
1982 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1983
1984 * frame.h: Add missing prototype for x_wm_set_size_hint.
1985
1986 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1987
1988 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1989 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1990 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1991 (Fsubstitute_command_keys):
1992 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1993 (save_excursion_save, save_excursion_restore)
1994 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1995 (format_time_string, general_insert_function)
1996 (make_buffer_string, make_buffer_string_both)
1997 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1998 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1999 (copy_text, insert_1, insert_1_both, insert_from_string)
2000 (insert_from_string_before_markers, insert_from_string_1)
2001 (insert_from_buffer, insert_from_buffer_1, replace_range)
2002 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2003 (del_range_2, modify_region):
2004 * intervals.c (intervals_equal, balance_possible_root_interval)
2005 (adjust_intervals_for_insertion, merge_properties_sticky)
2006 (graft_intervals_into_buffer, lookup_char_property)
2007 (adjust_for_invis_intang, set_point_both)
2008 (get_property_and_range, compare_string_intervals)
2009 (set_intervals_multibyte_1, set_intervals_multibyte):
2010 * keyboard.c (decode_timer):
2011 Use bool for boolean.
2012 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2013 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2014
2015 2012-09-02 Chong Yidong <cyd@gnu.org>
2016
2017 * keymap.c (push_key_description): Print M-TAB as C-M-i
2018 (Bug#11758).
2019
2020 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2021
2022 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2023 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2024 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2025 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2026 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2027 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2028 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2029
2030 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2031
2032 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2033 more than one grapheme cluster passed to the shaper: compute the
2034 offset adjustment values separately for each cluster. (Bug#11860)
2035
2036 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2037 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2038 about implicit conversions from integer to pointer.
2039
2040 2012-09-01 Daniel Colascione <dancol@dancol.org>
2041
2042 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2043 system used too early.
2044
2045 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2046
2047 Better seed support for (random).
2048 * emacs.c (main): Call init_random.
2049 * fns.c (Frandom): Set the seed from a string argument, if given.
2050 Remove long-obsolete Gentzel cruft.
2051 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2052 (init_random): New function.
2053
2054 2012-09-01 Daniel Colascione <dancol@dancol.org>
2055
2056 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2057 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2058 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2059 x_wm_set_size_hint, x_query_colors, x_real_positions,
2060 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2061 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2062 all of which have been moved to common code.
2063
2064 * xfaces.c: Include TERM_HEADER instead of listing all possible
2065 window-system headers.
2066
2067 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2068 to match header.
2069
2070 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2071 directly accessing frame internals.
2072
2073 * w32font.h: Include font.h. Define syms_of_w32font and
2074 globals_of_w32font.
2075
2076 * process.c: Include TERM_HEADER instead of listing all possible
2077 window-system headers.
2078
2079 * nsterm.h: Remove declarations now in frame.h.
2080 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2081
2082 * menu.c: Include TERM_HEADER instead of listing all possible
2083 window-system headers.
2084
2085 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2086 window system.
2087
2088 * keyboard.c: Include TERM_HEADER instead of listing all possible
2089 window-system headers.
2090
2091 * image.c: Include TERM_HEADER instead of listing all possible
2092 window-system headers. Declare Vlibrary_cache when compiling for
2093 Windows.
2094
2095 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2096 window system declarations.
2097
2098 * frame.h: Move common functions here: set_frame_menubar,
2099 x_set_window_size, x_sync, x_get_focus_frame,
2100 x_set_mouse_position, x_set_mouse_pixel_position,
2101 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2102 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2103 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2104 x_activate_menubar, x_real_positions, x_bitmap_icon,
2105 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2106 and x_query_colors.
2107
2108 * frame.c: Include TERM_HEADER instead of listing all possible
2109 window-system headers.
2110
2111 * font.c: Include TERM_HEADER instead of listing all possible
2112 window-system headers.
2113
2114 * emacs.c: Include TERM_HEADER.
2115
2116 * dispnew.c: Include TERM_HEADER instead of listing all possible
2117 window-system headers.
2118
2119 * ccl.h: Include character.h.
2120
2121 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2122 the current window system; include in list of objects to link into
2123 Emacs.
2124
2125 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2126
2127 Remove mark_ttys function and fix tty_display_info initialization.
2128 * lisp.h (mark_ttys): Remove prototype.
2129 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2130 to mark_ttys because all possible values of 'top_frame' slot are
2131 the frames which are reachable from Vframe_list.
2132 * term.c (mark_ttys): Remove.
2133 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2134
2135 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2136
2137 Change struct frame bitfields from unsigned char to unsigned.
2138 * frame.h (struct frame): Change type of 'display_preempted',
2139 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2140 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2141 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2142 bitfields from unsigned char to unsigned.
2143
2144 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2145
2146 Remove unused member of struct x_output and struct w32_output.
2147 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2148 * w32term.h (struct w32_output): Likewise.
2149
2150 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2151
2152 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2153 does not become zero (Bug#12234).
2154
2155 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2156
2157 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2158 for GCC 4.7.1 x86-64.
2159
2160 2012-08-30 Glenn Morris <rgm@gnu.org>
2161
2162 * lread.c (init_lread): For out-of-tree builds, only add the
2163 source directory's site-lisp dir to the load-path if it exists,
2164 consistent with in-tree builds. (Bug#12302)
2165
2166 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2167
2168 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2169 button_values to NULL. Call setStykeMask so dialogs get a close button.
2170 (windowShouldClose:): Set window_closed.
2171 (dealloc): New member, free button_values.
2172 (process_dialog:): Make member function. Remove window argument,
2173 replace window with self. Count buttons and allocate and store values
2174 in button_values.
2175 (addButton:value:row:): value is int with the name tag. Call setTag
2176 with tag. Remove return self, declare return value as void.
2177 (addString:row:): Remove return self, declare return value as void.
2178 (addSplit): Remove return self, declare return value as void.
2179 (clicked:): Remove return self, declare return value as void.
2180 Set dialog_return to button_values[seltag]. Code formatting change.
2181 (initFromContents:isQuestion:): Adjust call to process_dialog.
2182 Code formatting change.
2183 (timeout_handler:): Set timer_fired to YES.
2184 (runDialogAt:): Set timer_fired to NO.
2185 Handle click on close button as quit.
2186
2187 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2188 Add window_closed and button_values. Add void as return value for
2189 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2190 Add process_dialog as new member.
2191
2192 2012-08-28 Eli Zaretskii <eliz@gnu.org>
2193
2194 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2195 is not one of the heaps we manage. (Bug#12242)
2196
2197 2012-08-28 Glenn Morris <rgm@gnu.org>
2198
2199 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2200
2201 2012-08-28 Martin Rudalics <rudalics@gmx.at>
2202
2203 * window.c (Fset_window_configuration): Remove handling of
2204 auto-buffer-name window parameter. Install revision of reverted
2205 fix.
2206
2207 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2208
2209 Do not allow to set major mode for a dead buffer.
2210 * buffer.c (Fset_buffer_major_mode): Signal an error
2211 if the buffer is dead.
2212 (Fother_buffer, other_buffer_safely): Remove redundant
2213 nested declaration.
2214
2215 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2216
2217 Always use set_buffer_if_live to restore original buffer at unwind.
2218 * buffer.h (record_unwind_current_buffer): New function.
2219 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2220 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2221 * undo.c, window.c: Adjust users.
2222 * buffer.c (set_buffer_if_live): Fix comment.
2223
2224 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2225
2226 Fix usage of set_buffer_internal.
2227 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2228 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2229 * coding.c (decode_coding): Omit redundant test.
2230 * fileio.c (decide_coding_unwind): Likewise.
2231 * fns.c (secure_hash): Likewise.
2232 * insdel.c (modify_region): Likewise.
2233 * keyboard.c (command_loop_1): Likewise.
2234 * print.c (PRINTFINISH): Likewise.
2235 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2236
2237 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2238
2239 * dispnew.c: Use bool for boolean.
2240 (frame_garbaged, display_completed, delayed_size_change)
2241 (fonts_changed_p, add_window_display_history)
2242 (add_frame_display_history, verify_row_hash)
2243 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2244 (row_equal_p, realloc_glyph_pool)
2245 (allocate_matrices_for_frame_redisplay)
2246 (showing_window_margins_p)
2247 (adjust_frame_glyphs_for_frame_redisplay)
2248 (build_frame_matrix_from_leaf_window, make_current)
2249 (mirrored_line_dance, mirror_line_dance, update_frame)
2250 (update_window_tree, update_single_window)
2251 (check_current_matrix_flags, update_window, update_text_area)
2252 (update_window_line, set_window_update_flags, scrolling_window)
2253 (update_frame_1, scrolling, buffer_posn_from_coords)
2254 (do_pending_window_change, change_frame_size)
2255 (change_frame_size_1, sit_for):
2256 Use bool for boolean.
2257 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2258 and remove last int (actually boolean) argument, which was always 0.
2259 All callers changed.
2260 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2261 * dispextern.h (struct composition_it): Use bool for boolean.
2262 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2263 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2264 * dired.c (file_name_completion):
2265 Use bool for boolean. (This was missed in an earlier change.)
2266
2267 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2268
2269 * window.c (Fset_window_configuration): Revert first part of
2270 last change.
2271
2272 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2273
2274 * nsterm.h (NSPanel): New class variable dialog_return.
2275
2276 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2277 Initialize dialog_return.
2278 (windowShouldClose:): Use stop instead of stopModalWithCode.
2279 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2280 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2281 event.
2282 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2283 modal loop returns.
2284
2285 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2286
2287 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2288 * composite.c (find_composition, composition_gstring_p)
2289 (composition_reseat_it, find_automatic_composition):
2290 * data.c (let_shadows_buffer_binding_p)
2291 (let_shadows_global_binding_p, set_internal, make_blv)
2292 (Fmake_variable_buffer_local, Fmake_local_variable)
2293 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2294 (cons_to_signed, arith_driver):
2295 * dbusbind.c (xd_in_read_queued_messages):
2296 * dired.c (directory_files_internal, file_name_completion):
2297 Use bool for booleans.
2298 * dired.c (file_name_completion):
2299 * process.h (fd_callback):
2300 Omit int (actually boolean) argument. It wasn't being used.
2301 All uses changed.
2302 * composite.h, lisp.h: Reflect above API changes.
2303
2304 * cmds.c, coding.c: Use bool for booleans.
2305 * cmds.c (move_point, Fself_insert_command):
2306 * coding.h (struct composition status, struct coding_system):
2307 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2308 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2309 (emacs_mule_char, decode_coding_emacs_mule)
2310 (encode_coding_emacs_mule, detect_coding_iso_2022)
2311 (decode_coding_iso_2022, encode_invocation_designation)
2312 (encode_designation_at_bol, encode_coding_iso_2022)
2313 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2314 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2315 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2316 (encode_coding_raw_text, detect_coding_charset)
2317 (decode_coding_charset, encode_coding_charset, detect_eol)
2318 (detect_coding, get_translation_table, produce_chars)
2319 (consume_chars, reused_workbuf_in_use)
2320 (make_conversion_work_buffer, code_conversion_save)
2321 (decode_coding_object, encode_coding_object)
2322 (detect_coding_system, char_encodable_p)
2323 (Funencodable_char_position, code_convert_region)
2324 (code_convert_string, code_convert_string_norecord)
2325 (Fset_coding_system_priority):
2326 * fileio.c (Finsert_file_contents):
2327 Use bool for booleans.
2328 * coding.h, lisp.h: Reflect above API changes.
2329 * coding.c: Remove unnecessary static function decls.
2330 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2331 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2332 not a boolean 'int', since callers never look at the return value.
2333 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2334 * coding.h (decoding_buffer_size, encoding_buffer_size)
2335 (emacs_mule_string_char): Remove unused extern decls.
2336 (struct iso_2022_spec, struct coding_system):
2337 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2338 (struct emacs_mule_spec): Remove unused field 'full_support'.
2339 All initializations removed.
2340 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2341
2342 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2343
2344 Fix spare memory change (Bug#12286).
2345 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2346 (valid_lisp_object_p): Likewise.
2347
2348 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2349
2350 * window.c (Fset_window_configuration): Record any window's old
2351 buffer if it's replaced (see Bug#8789). If the new current
2352 buffer doesn't appear in the selected window, go to its old
2353 point (Bug#12208).
2354
2355 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2356
2357 Special MEM_TYPE_SPARE to denote reserved memory.
2358 * alloc.c (enum mem_type): New memory type.
2359 (refill_memory_reserve): Use new type for spare memory.
2360 This prevents live_cons_p and live_string_p from incorrect
2361 detection of uninitialized objects from spare memory as live.
2362
2363 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2364
2365 Spelling fixes.
2366 * Makefile.in (.PHONY): versioclean -> versionclean.
2367
2368 Remove unused external symbols.
2369 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2370 * window.c (Qwindow_valid_p, decode_valid_window):
2371 Now static, not extern.
2372 * data.c (Qinterval): Remove; unused.
2373 (syms_of_data): Do not define 'interval'.
2374 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2375 * window.h (decode_valid_window):
2376 Remove decls.
2377
2378 * character.c, charset.c, chartab.c: Use bool for booleans.
2379 * character.c (lisp_string_width, string_count_byte8)
2380 (string_escape_byte8):
2381 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2382 (load_charset_map_from_file, map_charset_chars)
2383 (Fdefine_charset_internal, define_charset_internal)
2384 (Fdeclare_equiv_charset, find_charsets_in_text)
2385 (Ffind_charset_region, char_charset, Fiso_charset):
2386 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2387 (sub_char_table_set, sub_char_table_set_range)
2388 (char_table_set_range, optimize_sub_char_table)
2389 (map_sub_char_table):
2390 Use bool for boolean.
2391 * character.c (str_to_unibyte): Omit last boolean argument; it was
2392 always 0. All callers changed.
2393 * character.h, charset.h: Adjust to match previous changes.
2394 * character.h (char_printable_p): Remove decl of nonexistent function.
2395 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2396 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2397 are all boolean, so make them single-bit bitfields.
2398
2399 * lisp.h (ASET): Remove attempt to detect side effects.
2400 It was meant to be temporary and it often doesn't work,
2401 because when IDX has side effects the behavior of IDX==IDX
2402 is undefined. See Stefan Monnier in
2403 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2404
2405 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2406
2407 * lisp.h (functionp): New function (extracted from Ffunctionp).
2408 (FUNCTIONP): Use it.
2409 * eval.c (Ffunctionp): Use it.
2410
2411 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2412
2413 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2414 as that's faster and simpler than static storage. Don't bother
2415 with the g_main_context_query overhead if g_main_context_pending
2416 says no events are pending.
2417 (gfds, gfds_size): Remove these static vars.
2418 (xgselect_initialize): Remove; no longer needed.
2419 All uses and decls removed.
2420
2421 * emacs.c (fatal_error_signal_hook): Remove.
2422 All uses removed. This leftover from old code was always 0.
2423
2424 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2425 * casefiddle.c (casify_object, casify_region):
2426 * casetab.c (set_case_table):
2427 * category.c, category.h (word_boundary_p):
2428 * category.h (CHAR_HAS_CATEGORY):
2429 Use bool for booleans, instead of int.
2430
2431 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2432
2433 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2434
2435 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2436
2437 On assertion failure, print backtrace if available.
2438 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2439 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2440 * Makefile.in (LIB_EXECINFO): New macro.
2441 (LIBES): Use it.
2442
2443 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2444 * bytecode.c (exec_byte_code):
2445 * callint.c (check_mark, Fcall_interactively):
2446 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2447 (getenv_internal, sync_process_alive, call_process_exited):
2448 * lisp.h (USE_SAFE_ALLOCA):
2449 Use bool for booleans, instead of int.
2450 * lisp.h, process.h: Adjust prototypes to match above changes.
2451 * callint.c (Fcall_interactively): Don't assume the mark's
2452 offset fits in 'int'.
2453
2454 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2455
2456 * buffer.c, buffer.h: Use bool for boolean.
2457 * buffer.c (reset_buffer_local_variables)
2458 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2459 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2460 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2461 (overlay_touches_p, overlay_strings, Foverlay_put)
2462 (report_overlay_modification, call_overlay_mod_hooks):
2463 (mmap_enlarge, mmap_set_vars):
2464 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2465 Use bool for booleans, instead of int.
2466 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2467 since the 1-or-0 return value is always ignored anyway.
2468 (mmap_initialized_p):
2469 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2470 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2471
2472 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2473
2474 * bidi.c: Use bool for boolean.
2475 This is a bit more readable, and makes the text segment of bidi.o
2476 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2477 Presumably it's faster too.
2478 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2479 Now bool.
2480 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2481 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2482 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2483 (bidi_explicit_dir_char, bidi_level_of_next_char)
2484 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2485 Use bool for booleans, instead of int.
2486 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2487 (bidi_unshelve_cache): Adjust decls to match code.
2488
2489 2012-08-23 Martin Rudalics <rudalics@gmx.at>
2490
2491 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2492 argument.
2493
2494 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2495
2496 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2497 * atimer.h: Include <stdbool.h>.
2498
2499 2012-08-22 Dan Nicolaescu <dann@gnu.org>
2500
2501 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2502 compile time tests instead of run time tests on systems that do
2503 not use them.
2504 (FRAME_MAC_P): Remove leftover from deleted code.
2505 * frame.c (syms_of_frame): Remove leftover from deleted code.
2506
2507 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2508
2509 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2510
2511 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2512
2513 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2514 Otherwise, the compiler complains about (A?B:C) where B is void
2515 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2516 (fontset_add): Return void, for FONTSET_ADD.
2517
2518 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2519
2520 * alloc.c: Use bool for booleans.
2521 (gc_in_progress, abort_on_gc)
2522 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2523 (dont_register_blocks) [GC_MALLOC_CHECK]:
2524 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2525 (check_string_bytes, make_specified_string, memory_full)
2526 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2527 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2528 (mark_stack, valid_pointer_p, make_pure_string)
2529 (Fgarbage_collect, survives_gc_p, gc_sweep):
2530 Use bool for booleans, instead of int.
2531 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2532 Remove unused local.
2533 * alloc.c (PURE_POINTER_P):
2534 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2535 * editfns.c (Fformat):
2536 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2537 (Fdo_auto_save):
2538 * fns.c (sweep_weak_table):
2539 * lisp.h (suppress_checking, push_message, survives_gc_p)
2540 (make_pure_string, gc_in_progress, abort_on_gc):
2541 * lread.c (readchar, read1):
2542 * print.c (Fprin1_to_string):
2543 * xdisp.c (push_message):
2544 Use bool for booleans affected directly or indirectly by
2545 alloc.c's changes.
2546
2547 Make recently-introduced setters macros.
2548 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2549 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2550 (set_fontset_default, set_fontset_fallback): Rename from their
2551 upper-case counterparts, and make them functions rather than macros.
2552 This is more consistent with the other recently-introduced setters.
2553 These don't need to be inline, since they're local.
2554
2555 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2556
2557 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2558 the loop (Bug#12247).
2559
2560 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2561
2562 * lisp.h (vcopy): Use memcpy rather than our own loop.
2563 This fixes a performance regression introduced by the recent
2564 addition of vcopy. This means 'vcopy' will need to be modified
2565 for a copying collector, but that's OK. Also, tighten the
2566 checking in the assertion.
2567
2568 2012-08-21 Eli Zaretskii <eliz@gnu.org>
2569
2570 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2571 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2572 non-base glyph for the width of the base character, according to
2573 what x_draw_composite_glyph_string_foreground expects.
2574 Generate WADJUST value according to composition_gstring_width's
2575 expectations, to produce correct width of the composed character.
2576 Reverse the sign of the DU offset produced by ScriptPlace.
2577
2578 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2579
2580 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2581
2582 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2583
2584 Avoid direct writes to contents member of struct Lisp_Vector.
2585 * lisp.h (vcopy): New function to copy data into vector.
2586 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2587 * fns.c (Ffillarray): Use ASET.
2588 * keyboard.c (timer_check_2): Use AREF and ASET.
2589 (append_tool_bar_item, Frecent_keys): Use vcopy.
2590 * lread.c (read_vector): Use ASET.
2591 * msdos.c (Frecent_doskeys): Use vcopy.
2592 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2593 (Finternal_merge_in_global_face): Use ASET and vcopy.
2594 * xfont.c (xfont_list_pattern): Likewise.
2595
2596 2012-08-21 Martin Rudalics <rudalics@gmx.at>
2597
2598 * window.c (Fwindow_point): For the selected window always return
2599 the position of its buffer's point.
2600 (Fset_window_point): For the selected window always go in its
2601 buffer to the specified position.
2602
2603 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2604
2605 Setter macros for fontsets.
2606 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2607 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2608 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2609 Adjust users.
2610
2611 2012-08-20 Glenn Morris <rgm@gnu.org>
2612
2613 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2614 Don't assume that `ln -f' works.
2615
2616 2012-08-20 Eli Zaretskii <eliz@gnu.org>
2617
2618 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2619 and later about non-assignments with no effect. See discussion at
2620 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2621 details.
2622
2623 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2624
2625 Inline setter functions for Lisp_Objects slots of struct specbinding.
2626 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2627 Adjust users.
2628
2629 2012-08-20 Martin Rudalics <rudalics@gmx.at>
2630
2631 * window.c (select_window): Always make selected window's buffer
2632 current.
2633
2634 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2635
2636 Use AREF and ASET for docstrings of category tables.
2637 * category.h (CATEGORY_DOCSTRING): Use AREF.
2638 (SET_CATEGORY_DOCSTRING): Use ASET.
2639 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2640
2641 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2642
2643 Inline setter functions for hash table members.
2644 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2645 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2646 (set_hash_key_and_value, set_hash_index, set_hash_next)
2647 (set_hash_hash): New functions.
2648 * charset.c, fns.c: Adjust users.
2649
2650 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2651
2652 Inline getter and setter functions for per-buffer values.
2653 * buffer.h (per_buffer_default, set_per_buffer_default)
2654 (per_buffer_value, set_per_buffer_value): New functions.
2655 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2656 * buffer.c, data.c: Adjust users.
2657
2658 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
2659
2660 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2661
2662 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2663
2664 Rely on <config.h> + <unistd.h> to declare 'environ',
2665 as gnulib does this if the system doesn't.
2666 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2667 Remove declaration. MS-Windows declares it on stdlib.h which is
2668 included by conf_post.h.
2669 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2670 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2671 * vm-limit.c: Include <unistd.h>, for 'environ'.
2672
2673 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2674 (start_of_data): Remove decl; mem-limits.h provides it.
2675
2676 * xdisp.c (handle_invisible_prop): Make it a bit faster
2677 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2678
2679 2012-08-19 Chong Yidong <cyd@gnu.org>
2680
2681 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2682 ends (Bug#3874).
2683
2684 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2685
2686 * .gdbinit: Use call instead of set when calling a function in the
2687 inferior.
2688
2689 * data.c (set_internal): Don't use set_blv_found.
2690 (Fkill_local_variable): Likewise.
2691
2692 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2693
2694 * nsfont.m (ns_ascii_average_width): Ensure the string
2695 ascii_printable is initialized with a null-terminated character
2696 array. Otherwise, it can contain undesired extra characters.
2697
2698 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2699
2700 port new setting code to Sun C 5.8 2005/10/13
2701 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2702 Return void, not Lisp_Object. Otherwise, the compiler
2703 complains about (A?B:C) where B is void and C is Lisp_Object
2704 when compiling CHAR_TABLE_SET, due to the recent change to
2705 the API of sub_char_table_set_contents.
2706
2707 2012-08-18 Chong Yidong <cyd@gnu.org>
2708
2709 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2710 for the string case (Bug#3874).
2711
2712 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2713
2714 * buffer.h (BSET): Remove (Bug#12215).
2715 Replace all uses with calls to new setter functions.
2716 (bset_bidi_paragraph_direction, bset_case_canon_table)
2717 (bset_case_eqv_table, bset_directory, bset_display_count)
2718 (bset_display_time, bset_downcase_table)
2719 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2720 (bset_last_selected_window, bset_local_var_alist)
2721 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2722 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2723 (bset_width_table):
2724 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2725 (bset_auto_fill_function, bset_auto_save_file_format)
2726 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2727 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2728 (bset_cache_long_line_scans, bset_case_fold_search)
2729 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2730 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2731 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2732 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2733 (bset_header_line_format, bset_indicate_buffer_boundaries)
2734 (bset_indicate_empty_lines, bset_invisibility_spec)
2735 (bset_left_fringe_width, bset_major_mode, bset_mark)
2736 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2737 (bset_name, bset_overwrite_mode, bset_pt_marker)
2738 (bset_right_fringe_width, bset_save_length)
2739 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2740 (bset_scroll_up_aggressively, bset_selective_display)
2741 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2742 (bset_word_wrap, bset_zv_marker):
2743 * category.c (bset_category_table):
2744 * syntax.c (bset_syntax_table):
2745 New setter functions.
2746
2747 * process.h (PSET): Remove (Bug#12215).
2748 Replace all uses with calls to new setter functions.
2749 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2750 (PROCESS_INLINE): New macro.
2751 (pset_childp): New setter function.
2752 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2753 * process.c (PROCESS_INLINE):
2754 Define to EXTERN_INLINE, so that the corresponding functions
2755 are compiled into code.
2756 (pset_buffer, pset_command, pset_decode_coding_system)
2757 (pset_decoding_buf, pset_encode_coding_system)
2758 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2759 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2760 (pset_type, pset_write_queue): New setter functions.
2761
2762 * window.h (WSET): Remove (Bug#12215).
2763 Replace all uses with calls to new setter functions.
2764 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2765 (WINDOW_INLINE): New macro.
2766 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2767 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2768 (wset_total_lines, wset_vertical_scroll_bar)
2769 (wset_window_end_pos, wset_window_end_valid)
2770 (wset_window_end_vpos): New setter functions.
2771 * window.c (WINDOW_INLINE):
2772 Define to EXTERN_INLINE, so that the corresponding functions
2773 are compiled into code.
2774 (wset_combination_limit, wset_dedicated, wset_display_table)
2775 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2776 (wset_new_normal, wset_new_total, wset_next_buffers)
2777 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2778 (wset_prev_buffers, wset_right_fringe_width)
2779 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2780 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2781 (wset_window_parameters):
2782 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2783 (wset_column_number_displayed, wset_region_showing):
2784 New setter functions.
2785
2786 * termhooks.h (TSET): Remove (Bug#12215).
2787 Replace all uses with calls to new setter functions.
2788 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2789 (TERMHOOKS_INLINE): New macro.
2790 (tset_charset_list, tset_selection_alist): New setter functions.
2791 * terminal.c (TERMHOOKS_INLINE):
2792 Define to EXTERN_INLINE, so that the corresponding functions
2793 are compiled into code.
2794 (tset_param_alist): New setter function.
2795
2796 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2797
2798 * keyboard.h (KSET): Remove (Bug#12215).
2799 Replace all uses with calls to new setter functions.
2800 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2801 (KEYBOARD_INLINE): New macro.
2802 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2803 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2804 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2805 New setter functions.
2806 * keyboard.c (KEYBOARD_INLINE):
2807 Define to EXTERN_INLINE, so that the corresponding functions
2808 are compiled into code.
2809 (kset_echo_string, kset_kbd_queue)
2810 (kset_keyboard_translate_table, kset_last_prefix_arg)
2811 (kset_last_repeatable_command, kset_local_function_key_map)
2812 (kset_overriding_terminal_local_map, kset_real_last_command)
2813 (kset_system_key_syms): New setter functions.
2814
2815 * frame.h (FSET): Remove (Bug#12215).
2816 Replace all uses with calls to new setter functions.
2817 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2818 (FRAME_INLINE): New macro.
2819 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2820 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2821 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2822 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2823 (fset_param_alist, fset_root_window, fset_scroll_bars)
2824 (fset_selected_window, fset_title, fset_tool_bar_items)
2825 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2826 * frame.c (FRAME_INLINE):
2827 Define to EXTERN_INLINE, so that the corresponding functions
2828 are compiled into code.
2829 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2830
2831 A few more naming-convention fixes for getters and setters.
2832 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2833 and rename from buffer_overlays_set_before.
2834 (set_buffer_overlays_after): Move here from buffer.h, and rename
2835 from buffer_overlays_set_after.
2836 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2837 All uses changed.
2838 (set_buffer_intervals): Rename from buffer_set_intervals.
2839 * intervals.c (set_interval_object): Move here from intervals.h,
2840 and rename from interval_set_object.
2841 (set_interval_left): Move here from intervals.h, and rename from
2842 interval_set_left.
2843 (set_interval_right): Move here from intervals.h, and rename from
2844 interval_set_right.
2845 (copy_interval_parent): Move here from intervals.h, and rename from
2846 interval_copy_parent.
2847 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2848 (set_interval_plist): Rename from interval_set_plist.
2849 Return void, not Lisp_Object, since no caller uses the result.
2850 * lisp.h (string_intervals): Rename from string_get_intervals.
2851 (set_string_intervals): Rename from string_set_intervals.
2852
2853 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2854 (set_char_table_contents): Rename from char_table_set_contents.
2855 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2856 All uses changed. See the end of
2857 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2858
2859 * lisp.h (CSET): Remove (Bug#12215).
2860 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2861 (set_char_table_purpose): New functions,
2862 replacing CSET. All uses changed. For example, replace
2863 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2864 "set_char_table_parent (char_table, parent);".
2865 The old version was confusing because it used the same name
2866 'parent' for two different things.
2867
2868 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2869
2870 Functions to get and set Lisp_Object fields of buffer-local variables.
2871 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2872 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2873 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2874 * data.c, eval.c, frame.c: Adjust users.
2875
2876 2012-08-17 Chong Yidong <cyd@gnu.org>
2877
2878 * xfaces.c (merge_face_vectors): If the target font specfies a
2879 font spec, make the font's attributes take precedence over
2880 directly-specified attributes.
2881 (merge_face_ref): Recognize :font.
2882
2883 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2884
2885 Do not use memcpy for copying intervals.
2886 * intervals.c (reproduce_interval): New function.
2887 (reproduce_tree, reproduce_tree_obj): Use it.
2888 (reproduce_tree_obj): Remove prototype.
2889
2890 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2891
2892 * lisp.h (duration_to_sec_usec): Remove unused decl.
2893
2894 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2895
2896 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2897 to an allocated instance of NSString, not to the class itself.
2898
2899 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
2900
2901 * makefile.w32-in (C_CTYPE_H): New macro.
2902 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2903 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2904 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2905
2906 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2907
2908 Use ASCII tests for character types.
2909 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2910 * xfns.c, xterm.c:
2911 Don't include <ctype.h>; was not needed.
2912 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2913 * sysdep.c, xfaces.c:
2914 Include <c-ctype.h> instead of <ctype.h>.
2915 * nsterm.m: Include <c-ctype.h>.
2916 * charset.c (read_hex):
2917 * doc.c (Fsnarf_documentation):
2918 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2919 (DRIVE_LETTER) [DOS_NT]:
2920 (Ffile_name_directory, Fexpand_file_name)
2921 (Fsubstitute_in_file_name):
2922 * font.c (font_parse_xlfd, font_parse_fcname):
2923 * frame.c (x_set_font_backend):
2924 * gtkutil.c (xg_get_font):
2925 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2926 * nsimage.m (hexchar):
2927 * nsterm.m (ns_xlfd_to_fontname):
2928 * sysdep.c (system_process_attributes):
2929 * xfaces.c (hash_string_case_insensitive):
2930 Use C-locale tests instead of locale-specific tests for character
2931 types, since we want the ASCII interpretation here, not the
2932 interpretation suitable for whatever happens to be the current locale.
2933
2934 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2935
2936 Consistently check windows for validity/liveness
2937 (Bug#11984, Bug#12025, Bug#12026).
2938 * lisp.h (CHECK_VALID_WINDOW): New macro.
2939 * window.c (decode_window): Rename to decode_live_window.
2940 (decode_valid_window, Fwindow_valid_p): New functions.
2941 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2942 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2943 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2944 (Fwindow_prev_sibling, Fwindow_combination_limit)
2945 (Fset_window_combination_limit, Fwindow_use_time)
2946 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2947 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2948 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2949 (Fwindow_hscroll, Fset_window_hscroll)
2950 (Fwindow_redisplay_end_trigger)
2951 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2952 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2953 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2954 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2955 (Fwindow_end, Fset_window_point, Fset_window_start)
2956 (Fpos_visible_in_window_p, Fwindow_line_height)
2957 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2958 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2959 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2960 (Fset_window_parameter, Fwindow_display_table)
2961 (Fset_window_display_table, Fdelete_other_windows_internal)
2962 (Fset_window_buffer, Fset_window_new_total)
2963 (Fset_window_new_normal, Fdelete_window_internal)
2964 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2965 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2966 (Fwindow_scroll_bars): Check whether argument window is a valid or
2967 live window. Update doc-strings.
2968 (syms_of_window): New symbol Qwindow_valid_p.
2969 * keyboard.c (Fposn_at_x_y): Check whether argument
2970 frame_or_window denotes a valid window.
2971
2972 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2973
2974 Fix previous char table change.
2975 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2976 * chartab.c (optimize_sub_char_table): Likewise.
2977
2978 2012-08-16 Chong Yidong <cyd@gnu.org>
2979
2980 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2981
2982 * xfont.c (xfont_open):
2983 * xftfont.c (xftfont_open): Set the font's max_width field.
2984
2985 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2986 min_width to space_width and average_width to the average over
2987 printable ASCII characters.
2988 (ns_char_width): Code cleanup.
2989 (ns_ascii_average_width): New utility function.
2990
2991 * font.h (struct font): Update comments.
2992
2993 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2994
2995 Simple interface to set Lisp_Object fields of character tables.
2996 * lisp.h (CSET): New macro.
2997 (char_table_set_extras, char_table_set_contents)
2998 (sub_char_table_set_contents): New function.
2999 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3000 * syntax.c: Adjust users.
3001
3002 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3003
3004 * eval.c (eval_sub): Bind lexical-binding.
3005 * lread.c (Qlexical_binding): Make non-static.
3006
3007 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3008
3009 * nsmenu.m (popupSession): Remove.
3010 (pop_down_menu): Remove endModalSession.
3011 (timeout_handler:): New method.
3012 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3013 Call runModalForWindow. Check timer_fired when it returns.
3014 If not set, cancel timer and break out of loop.
3015 Otherwise loop again, with a new timeout.
3016
3017 * nsterm.m: Include fcntl.h if present.
3018 (fd_entry, t_readfds, inNsSelect): Remove.
3019 (select_writefds, select_valid, select_timeout, selfds)
3020 (select_mutex, apploopnr): Add.
3021 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3022 Otherwise call kbd_buffer_store_event.
3023 (ns_send_appdefined): Remove release of fd_entry.
3024 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3025 Increment and decrement apploopnr.
3026 (ns_select): If no file descriptors, just do a NSTimer.
3027 Otherwise copy read/write masks and start select thread (fd_handler).
3028 Start main loop and wait for application defined event.
3029 Inform select thread to stop selecting after main loop is exited.
3030 (ns_term_init): Create selfds pipe and set non-blocking.
3031 Initialize select_mutex. Start the select thread (fd_handler).
3032 (fd_handler:): Loop forever, wait for info from the main thread
3033 to either start or stop selecting. When select returns, send
3034 and appdefined event.
3035 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3036 If not call kbd_buffer_store_event.
3037
3038 * nsterm.h (EmacsApp): fd_handler takes id argument.
3039 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3040
3041 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3042
3043 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3044
3045 * region-cache.c (move_cache_gap): Update gap_len using the actual
3046 growth of the boundaries array. Do not change cache_len.
3047 (Bug#12196)
3048
3049 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3050
3051 Generalize and cleanup font subsystem checks.
3052 * font.h (FONT_DEBUG, font_assert): Remove.
3053 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3054 Change font_assert to eassert. Use eassert where appropriate.
3055
3056 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3057
3058 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3059
3060 2012-08-15 Chong Yidong <cyd@gnu.org>
3061
3062 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3063 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3064 extract the font descriptor instead of just the font name.
3065 In that case, return a font spec instead of a string.
3066 (x_last_font_name): Move to this file from xfns.c.
3067
3068 * xfns.c (Fx_select_font): The return value can also be a font
3069 spec. Move x_last_font_name management to gtkutil.c.
3070
3071 * xfaces.c: Make font weight and style symbols non-static.
3072
3073 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3074
3075 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3076 (bug#12117).
3077
3078 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3079
3080 * alloc.c (Fgarbage_collect): Use plural form consistently.
3081
3082 2012-08-14 Eli Zaretskii <eliz@gnu.org>
3083
3084 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3085 iteration through the command loop. Fixes a problem whereby mouse
3086 movements are ignored until the first mouse click.
3087
3088 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3089
3090 Use bool, not int, for Lisp booleans.
3091 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3092 makes Emacs a bit smaller and presumably a bit faster.
3093 * lisp.h: Include <stdbool.h>.
3094 (struct Lisp_Boolfwd, defvar_bool):
3095 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3096 * regex.c [!emacs]: Include <stdbool.h>.
3097 (false, true): Remove; <stdbool.h> does this for us now.
3098
3099 2012-08-14 Chong Yidong <cyd@gnu.org>
3100
3101 * character.c (Fcharacterp): Doc fix (Bug#12076).
3102
3103 * data.c (Findirect_variable): Doc fix (Bug#11040).
3104
3105 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3106
3107 * editfns.c (Fformat): Doc fix (Bug#12059).
3108 (Fsave_current_buffer): Doc fix (Bug#11542).
3109
3110 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3111
3112 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3113 (bug#12022).
3114
3115 2012-08-14 Martin Rudalics <rudalics@gmx.at>
3116
3117 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3118 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3119 * minibuf.c (choose_minibuf_frame, read_minibuf):
3120 * w32fns.c (x_create_tip_frame):
3121 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3122 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3123
3124 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3125
3126 * intervals.c (offset_intervals): Remove obsolete comment.
3127
3128 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3129
3130 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3131
3132 2012-08-14 Gergely Risko <gergely@risko.hu>
3133
3134 * coding.c (decode_coding): Record buffer modification before
3135 disabling undo_list (Bug#11773).
3136
3137 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3138
3139 Revert and cleanup some recent overlay changes.
3140 * buffer.h (enum overlay_type): Remove.
3141 (buffer_get_overlays, buffer_set_overlays): Likewise.
3142 (buffer_set_overlays_before, buffer_set_overlays_after):
3143 New function. Adjust users.
3144 (unchain_both): Add eassert.
3145
3146 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3147
3148 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3149
3150 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3151
3152 * gtkutil.c (xg_mark_data): Don't assume C99.
3153
3154 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3155
3156 * gtkutil.c (xg_frame_tb_info): New struct.
3157 (TB_INFO_KEY): New define.
3158 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3159 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3160 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3161 if not present.
3162 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3163 is up to date. Otherwise store new data.
3164 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3165
3166 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3167
3168 Use KSET for write access to Lisp_Object members of struct kboard.
3169 * keyboard.h (KSET): New macro.
3170 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3171 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3172 * xterm.c: Adjust users.
3173
3174 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3175
3176 Use BSET for write access to Lisp_Object members of struct buffer.
3177 * buffer.h (BSET): New macro.
3178 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3179 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3180 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3181 * window.c, xdisp.c, xfns.c: Adjust users.
3182
3183 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3184
3185 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3186
3187 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3188
3189 * nsterm.m (not_in_argv): New function.
3190 (application:openFile, application:openTempFile:):
3191 (application:openFileWithoutUI:, application:openFiles:): Open file
3192 if not_in_argv returns non-zero (bug#12171).
3193
3194 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3195 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3196 Define for Gtk+ versions less than 3.2.
3197 (xg_get_font_name): Use those functions/macros here.
3198 Reported by Frans Oilinki <moilinki@gmail.com>.
3199
3200 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3201
3202 * unexmacosx.c (copy_data_segment): Copy initialized data in
3203 statically linked libraries from input file rather than memory.
3204
3205 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3206 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3207 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3208
3209 2012-08-10 Glenn Morris <rgm@gnu.org>
3210
3211 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3212 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3213
3214 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3215
3216 Fix last change to allow compilation with low optimization levels.
3217 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3218 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3219
3220 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3221
3222 Use common inline syntax in intervals.h.
3223 * intervals.h (INTERVALS_INLINE): New macro.
3224 Change all users from LISP_INLINE.
3225
3226 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3227
3228 Define Qnone once for all platforms.
3229 * frame.c (Qnone): Define here.
3230 (syms_of_frame): DEFSYM it.
3231 * lisp.h (Qnone): New declaration.
3232 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3233 * xfns.c: Remove duplication. Adjust users.
3234
3235 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3236
3237 Remove unused macros from intervals.h.
3238 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3239 * intervals.c: Adjust comment.
3240
3241 2012-08-10 Eli Zaretskii <eliz@gnu.org>
3242
3243 * w32fns.c <w32_unicode_gui>: New static variable.
3244 (globals_of_w32fns): Initialize it according to os_subtype.
3245 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3246 testing os_subtype.
3247
3248 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
3249 Eli Zaretskii <eliz@gnu.org>
3250
3251 Fix bug #10299 with Unicode characters sent by customized
3252 keyboards created by MSKLC.
3253 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3254 (w32_init_class): Use it to initialize the Emacs class with either
3255 ANSI or Unicode API calls.
3256 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3257 later.
3258 (w32_wnd_proc): If the character code sent by WM_CHAR or
3259 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3260 original message. Call DefWindowProcW on NT and later.
3261
3262 2012-08-10 Glenn Morris <rgm@gnu.org>
3263
3264 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3265
3266 * lisp.h (DIRECTORY_SEP): Let configure set it.
3267
3268 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3269
3270 Use TSET for write access to Lisp_Object slots of struct terminal.
3271 * termhooks.h (TSET): New macro.
3272 * coding.c, terminal.c, xselect.c: Adjust users.
3273
3274 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3275
3276 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3277 the failing expression, include them in the error message.
3278 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3279 * lisp.h (internal_condition_case_n): Update declaration.
3280
3281 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3282
3283 Inline functions to examine and change buffer overlays.
3284 * buffer.c (unchain_both): New function.
3285 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3286 (buffer_has_overlays): New function.
3287 (enum overlay_type): New enum.
3288 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3289 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3290
3291 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3292
3293 Inline functions to examine and change buffer intervals.
3294 * alloc.c (mark_interval_tree): Remove.
3295 (MARK_INTERVAL_TREE): Simplify.
3296 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3297 * intervals.c (buffer_balance_intervals): New function.
3298 (graft_intervals_into_buffer): Adjust indentation.
3299 (set_intervals_multibyte): Simplify.
3300 * buffer.h (BUF_INTERVALS): Remove.
3301 (buffer_get_intervals, buffer_set_intervals): New function.
3302 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3303 * intervals.c, textprop.c: Adjust users.
3304
3305 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3306
3307 Inline functions to examine and change string intervals.
3308 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3309 (string_get_intervals, string_set_intervals): New function.
3310 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3311 * lread.c, print.c, textprop.c: Adjust users.
3312
3313 2012-08-08 Glenn Morris <rgm@gnu.org>
3314
3315 * lisp.mk (lisp): Remove language/persian.elc.
3316
3317 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3318
3319 Cleanup intervals.
3320 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3321 (NULL_INTERVAL_P): Likewise. Adjust users.
3322 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3323 Adjust comment. Move under #if 0.
3324 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3325 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3326
3327 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3328
3329 Check total length of intervals with eassert.
3330 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3331 * intervals.c: Change all users to eassert.
3332
3333 2012-08-07 Eli Zaretskii <eliz@gnu.org>
3334
3335 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3336 Rename fields to match removal of FGET and WGET and disuse of
3337 INTERNAL_FIELD in Lisp_Cons.
3338
3339 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3340
3341 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3342 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3343 name since all xname users are fixed long time ago. Do not
3344 use INTERNAL_FIELD.
3345 (set_symbol_name, set_symbol_function, set_symbol_plist):
3346 (set_symbol_next, set_overlay_plist): New function.
3347 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3348 (struct Lisp_Overlay): Likewise.
3349 (CVAR, MVAR, SVAR): Remove.
3350 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3351 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3352 * xterm.c: Adjust users.
3353 * .gdbinit: Change to use name field of struct Lisp_Symbol
3354 where appropriate.
3355
3356 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3357
3358 Basic functions to set Lisp_Object and pointer slots of intervals.
3359 * intervals.h (interval_set_parent, interval_set_object):
3360 (interval_set_left, interval_set_right, interval_set_plist):
3361 (interval_copy_parent): New function.
3362 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
3363 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3364 Adjust indentation.
3365 (INTERVAL_SIZE): Remove. Adjust users.
3366 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3367
3368 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3369
3370 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3371 * process.h (PGET): Remove.
3372 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3373 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3374
3375 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3376
3377 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3378 * window.h (WGET): Remove.
3379 (struct window): Do not use INTERNAL_FIELD.
3380 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3381 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3382 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3383 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3384 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3385 Adjust users.
3386
3387 2012-08-07 Chong Yidong <cyd@gnu.org>
3388
3389 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3390 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3391 (Fdelete_window_internal): Signal an error if the window is not on
3392 a live frame (Bug#12025).
3393
3394 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3395
3396 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3397 * frame.h (FGET): Remove.
3398 (struct frame): Do not use INTERNAL_FIELD.
3399 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3400 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3401 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3402 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3403
3404 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
3405
3406 * w32.c: Silence compiler warnings.
3407 (map_w32_filename): Remove unused variable `is_fat'.
3408 (chase_symlinks): Add parentheses around expression.
3409
3410 2012-08-06 Glenn Morris <rgm@gnu.org>
3411
3412 * sysdep.c: Respect BROKEN_GETWD.
3413
3414 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3415 Let configure handle it.
3416 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3417
3418 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3419
3420 Use GCALIGNMENT where appropriate.
3421 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3422 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3423 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3424
3425 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3426
3427 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3428 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3429
3430 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3431
3432 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3433 that should be sufficient for everyone.
3434
3435 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3436
3437 * keyboard.c (timer_check_2): Add break so timer_check returns next
3438 timeout.
3439
3440 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3441
3442 Fix Windows build errors introduced after converting to WGET and WSET.
3443 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3444 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3445
3446 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3447
3448 * nsterm.m (ns_frame_rehighlight): Use FSET.
3449
3450 * nsmenu.m (ns_update_menubar): Use FSET.
3451
3452 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3453
3454 Separate read and write access to Lisp_Object slots of Lisp_Process.
3455 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3456 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3457
3458 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3459
3460 Separate read and write access to Lisp_Object slots of struct window.
3461 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3462 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3463 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3464 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3465 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3466 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3467 Adjust users.
3468
3469 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3470
3471 Fix Windows build errors introduced after converting to FGET and FSET.
3472 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3473 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3474 (w32_judge_scroll_bars): Change to use FSET.
3475 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3476
3477 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3478
3479 Fix replacement typo.
3480 * window.c (replace_window): Set root_window instead of
3481 selected_window. This fixes a total window subsystem
3482 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3483
3484 2012-08-06 Glenn Morris <rgm@gnu.org>
3485
3486 * lisp.mk (lisp): Add language/persian.elc.
3487
3488 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3489
3490 Separate read and write access to Lisp_Object slots of struct frame.
3491 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3492 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3493 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3494 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3495 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3496
3497 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3498
3499 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3500
3501 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3502
3503 Generalize common compile-time constants.
3504 * lisp.h (header_size, bool_header_size, word_size): Now here.
3505 (struct Lisp_Vector): Add comment.
3506 (struct Lisp_Bool_Vector): Move up to define handy constants.
3507 (VECSIZE, PSEUDOVECSIZE): Simplify.
3508 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3509 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3510 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3511 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3512 * xfont.c, xmenu.c: Use word_size where appropriate.
3513
3514 2012-08-05 Lawrence Mitchell <wence@gmx.li>
3515
3516 * search.c (Freplace_match): Treat \? in the replacement text
3517 literally (Bug#8161).
3518
3519 2012-08-05 Chong Yidong <cyd@gnu.org>
3520
3521 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3522 * frame.c (Vdelete_frame_functions):
3523 * emacs.c (Vkill_emacs_hook): Doc fix.
3524
3525 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3526
3527 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3528 --with-x-toolkit=no builds.
3529 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3530
3531 2012-08-04 Chong Yidong <cyd@gnu.org>
3532
3533 * syntax.c (Fmodify_syntax_entry): Doc fix.
3534
3535 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3536
3537 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3538 * w32.c (init_environment): Change the default values of many
3539 environment variables in dflt_envvars[] to NULL, to avoid pushing
3540 them into environment when they were not already defined.
3541 Remove the code that deletes site-lisp subdirectories from the default
3542 value of EMACSLOADPATH, as it is no longer needed.
3543 (check_windows_init_file): Now external, not static.
3544 Use Vload_path as is, without adding anything, as this function is now
3545 called when Vload_path is already set up.
3546
3547 * w32.h (check_windows_init_file): Add prototype.
3548
3549 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3550 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3551 compatibility with Posix platforms.
3552 (main): Move the call to check_windows_init_file to here from
3553 w32.c.
3554 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3555 any, in the DEFALT argument into the root of the Emacs build or
3556 installation tree, as appropriate.
3557
3558 * callproc.c (init_callproc_1): Call decode_env_path instead of
3559 doing its equivalent by hand.
3560 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3561 the code that sets Vexec_path run on MS-Windows.
3562
3563 * lread.c (init_lread): Add comments to #ifdef's.
3564
3565 * msdos.c (dos_set_window_size, IT_update_begin)
3566 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3567 instead of direct references.
3568
3569 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3570
3571 Export DEFAULT_REHASH_* to GDB.
3572 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3573 Now constants, not macros.
3574
3575 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3576
3577 Remove unnecessary casts involving pointers.
3578 These casts are no longer needed now that we assume C89 or later,
3579 since they involve casting to or from void *.
3580 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3581 (make_pure_float, make_pure_vector):
3582 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3583 * macros.c (Fstart_kbd_macro):
3584 * menu.c (find_and_return_menu_selection):
3585 * minibuf.c (read_minibuf_noninteractive):
3586 * sysdep.c (closedir):
3587 * xdisp.c (x_produce_glyphs):
3588 * xfaces.c (compare_fonts_by_sort_order):
3589 * xfns.c (x_real_positions, select_visual):
3590 * xselect.c (x_stop_queuing_selection_requests)
3591 (x_get_window_property, x_get_window_property_as_lisp_data):
3592 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3593 Remove unnecessary pointer casts.
3594 * alloc.c (record_xmalloc): New function.
3595 * lisp.h (record_xmalloc): New decl.
3596 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3597 more like a function. This is because the pointer cast is not
3598 needed. All uses changed.
3599 * print.c (print_string, print_error_message): Avoid length recalc.
3600
3601 Improve fix for macroexp crash with debugging (Bug#12118).
3602 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3603 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3604 not supposed to be invoked from the garbage collector.
3605 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3606 (gc_aset): New function, which is like ASET but can be
3607 used in the garbage collector.
3608 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3609 (set_hash_index): Use it instead of ASET.
3610
3611 2012-08-03 Eli Zaretskii <eliz@gnu.org>
3612
3613 Support symlinks on latest versions of MS-Windows.
3614 * w32.c: Include winioctl.h and aclapi.h.
3615 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3616 (revert_to_self): Forward declarations of static functions.
3617 <static BOOL g_b_init_get_security_info>:
3618 <g_b_init_create_symbolic_link>: New static flags.
3619 (globals_of_w32): Initialize them to zero.
3620 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3621 (map_w32_filename): Improve commentary. Simplify switch.
3622 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3623 headers (most versions of MinGW w32api don't).
3624 (get_security_info, create_symbolic_link)
3625 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3626 New functions.
3627 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3628 in the argument file name.
3629 (sys_access): Call unc_volume_file_attributes only if
3630 GetFileAttributes fails with network-related error codes.
3631 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3632 have the required privileges.
3633 (get_file_security_desc_by_name): Rename from
3634 get_file_security_desc.
3635 (stat_worker): New function, with most of the guts of 'stat', and
3636 with addition of handling of symlinks and support for 'lstat'.
3637 If possible, get file's attributes and security information by
3638 handle, not by name. Produce S_IFLNK bit for symlinks, when
3639 called from 'lstat'.
3640 (stat, lstat): New functions, call 'stat_worker'.
3641 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3642 symlinks when the underlying filesystem supports them.
3643
3644 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3645
3646 Fix macroexp crash on Windows with debugging (Bug#12118).
3647 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3648 checking subscripts; problem introduced with the recent
3649 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3650 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3651 since it's used in non-static inline functions now.
3652
3653 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3654 Don't assume buffer size fits in 'int'. Remove unused local.
3655
3656 Use C99-style 'extern inline' if available.
3657 * buffer.h (BUFFER_INLINE):
3658 * category.h (CATEGORY_INLINE):
3659 * character.h (CHARACTER_INLINE):
3660 * charset.h (CHARSET_INLINE):
3661 * composite.h (COMPOSITE_INLINE):
3662 * dispextern.h (DISPEXTERN_INLINE):
3663 * lisp.h (LISP_INLINE):
3664 * systime.h (SYSTIME_INLINE):
3665 New macro, replacing 'static inline' in this header.
3666 * buffer.h, category.h, character.h, charset.h, composite.h:
3667 * dispextern.h, lisp.h, systime.h:
3668 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3669 * alloc.c (LISP_INLINE):
3670 * buffer.c (BUFFER_INLINE):
3671 * category.c (CATEGORY_INLINE):
3672 * character.c (CHARACTER_INLINE):
3673 * charset.c (CHARSET_INLINE):
3674 * composite.c (COMPOSITE_INLINE):
3675 * dispnew.c (DISPEXTERN_INLINE):
3676 * sysdep.c (SYSTIME_INLINE):
3677 Define to EXTERN_INLINE, so that the corresponding functions
3678 are compiled into code.
3679 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3680 (INLINE_HEADER_END): New macros.
3681 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3682 since it's used in non-static inline functions now.
3683 (VALMASK) [!USE_LSB_TAG]: Likewise.
3684
3685 2012-08-02 Glenn Morris <rgm@gnu.org>
3686
3687 * s/: Remove empty directory.
3688
3689 * s/ms-w32.h: Move to ../nt/inc.
3690 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3691 Update for new ms-w32.h location.
3692
3693 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3694
3695 Port to Solaris 8.
3696 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3697
3698 2012-08-02 Glenn Morris <rgm@gnu.org>
3699
3700 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3701 hard-coding the path separator.
3702
3703 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3704
3705 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3706 This how ASET and AREF are supposed to work, and makes
3707 it easier to think about future improvements. See
3708 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3709 * charset.h (set_charset_attr): New function.
3710 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3711 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3712 (aref_addr): New function. All uses of &AREF(...) changed.
3713 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3714 (set_hash_index): New functions. All lvalue-style uses of
3715 HASH_KEY etc. changed.
3716 * keyboard.c (set_prop): New function. All lvalue-style uses
3717 of PROP changed.
3718
3719 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3720
3721 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3722 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3723 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3724 * nsfns.m (ns_set_name_as_filename): Likewise.
3725 * nsmenu.m (ns_update_menubar): Likewise.
3726 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3727
3728 2012-08-01 Eli Zaretskii <eliz@gnu.org>
3729
3730 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3731 Adapt to latest changes in field names of the corresponding Lisp
3732 objects.
3733
3734 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3735
3736 2012-08-01 Glenn Morris <rgm@gnu.org>
3737
3738 * s/msdos.h: Remove file.
3739 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3740 * Makefile.in (S_FILE): Remove.
3741 (config_h): Remove S_FILE.
3742
3743 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3744
3745 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3746 Remove; moved to nt/config.nt.
3747
3748 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3749
3750 Use INTERNAL_FIELD for conses and overlays.
3751 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3752 Remove obsolete comment.
3753 (MVAR): New macro.
3754 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3755 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3756
3757 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3758
3759 Use INTERNAL_FIELD for symbols.
3760 * lisp.h (SVAR): New macro. Adjust users.
3761 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3762 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3763
3764 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3765
3766 Use INTERNAL_FIELD for processes.
3767 * process.h (PVAR): New macro. Adjust style.
3768 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3769 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3770
3771 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3772
3773 Use INTERNAL_FIELD for windows.
3774 * window.h (WVAR): New macro.
3775 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3776 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3777 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3778 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3779 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3780 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3781
3782 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3783
3784 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3785
3786 2012-08-01 Glenn Morris <rgm@gnu.org>
3787
3788 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3789 Move to configure.ac.
3790
3791 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3792
3793 * makefile.w32-in (CONFIG_H): Update dependencies.
3794 (CONF_POST_H): New macro.
3795
3796 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3797
3798 2012-07-31 Glenn Morris <rgm@gnu.org>
3799
3800 * Makefile.in (S_FILE): No longer set by configure.
3801
3802 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3803 is available.
3804 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3805
3806 * process.h (NULL_DEVICE):
3807 * emacs.c (SEPCHAR):
3808 * editfns.c (USER_FULL_NAME): Let configure set them.
3809
3810 * s/README, s/template.h: Remove files.
3811
3812 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3813
3814 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3815 Move to configure.ac.
3816
3817 2012-07-31 Eli Zaretskii <eliz@gnu.org>
3818
3819 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3820 resulting renaming of 'struct frame' members.
3821
3822 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3823
3824 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3825 after introduction of FVAR.
3826
3827 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3828
3829 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3830
3831 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3832 instead of compositeToPoint.
3833 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3834
3835 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3836
3837 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3838
3839 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3840 * lisp.h (INTERNAL_FIELD): New macro.
3841 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3842 (BVAR): Change to use INTERNAL_FIELD.
3843 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3844 (KVAR): Change to use INTERNAL_FIELD.
3845 * frame.h (FVAR): New macro.
3846 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3847 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3848 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3849 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3850 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3851
3852 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3853
3854 Miscellaneous fixes for non-default X toolkits.
3855 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3856 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3857 Move under #ifdef USE_LUCID.
3858 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3859 definition and usage to avoid warnings.
3860
3861 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3862
3863 * nsterm.m (openFiles): Fix previous checkin.
3864
3865 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3866
3867 * indent.c (compute_motion): Remove unused local.
3868
3869 2012-07-31 Glenn Morris <rgm@gnu.org>
3870
3871 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3872
3873 * conf_post.h [USG5_4]:
3874 Move remaining contents of s/usg5-4-common.h here.
3875 * s/usg5-4-common.h: Remove file.
3876
3877 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3878 * s/irix6-5.h: Remove file.
3879
3880 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3881 * s/darwin.h: Remove file.
3882
3883 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3884 * s/hpux10-20.h: Remove file, which is now empty.
3885
3886 2012-07-30 Glenn Morris <rgm@gnu.org>
3887
3888 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3889 * Makefile.in (config_h): Add conf_post.h.
3890 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3891
3892 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3893
3894 * nsterm.m (ns_do_open_file): New variable.
3895 (ns_term_init): Set ns_do_open_file to YES after run returns.
3896 (openFile, openTempFile, openFileWithoutUI, openFiles):
3897 Open files only if ns_do_open_file.
3898
3899 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3900
3901 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3902 This no-op macro hasn't been needed for many years.
3903 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3904
3905 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3906 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3907 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3908 gdb_make_enums_visible.
3909 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3910 (DIRECTORY_SEP): Now a constant, not a macro.
3911
3912 2012-07-30 Eli Zaretskii <eliz@gnu.org>
3913
3914 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3915 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3916
3917 * w32term.c <w32_keyboard_codepage>: Renamed from
3918 keyboard_codepage and now external. All users changed.
3919
3920 * w32term.h: Add declaration of w32_keyboard_codepage.
3921
3922 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3923 the codepage to translate keys to Unicode. If this argument is
3924 -1, use the value returned by GetConsoleCP. All callers changed.
3925
3926 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3927
3928 Update .PHONY listings in makefiles.
3929 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3930 bootstrap-clean, distclean, maintainer-clean, versioclean,
3931 extraclean, frc.
3932
3933 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3934 This is a bit clearer. Fix some commentary typos.
3935
3936 2012-07-30 Glenn Morris <rgm@gnu.org>
3937
3938 * s/netbsd.h: Let configure include signal.h if needed.
3939 Remove file, which is now empty.
3940
3941 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3942 Let configure set them.
3943 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3944 No more need to undefine.
3945
3946 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3947
3948 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3949 non-single-byte char when adding meta modifier. (Bug#12090)
3950
3951 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3952
3953 Convert safe_call to use variable number of arguments.
3954 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3955 (safe_call2): Fix comment.
3956 * lisp.h (safe_call): Adjust prototype.
3957 * coding.c (encode_coding_object): Change to use safe_call2.
3958 * xfaces.c (merge_face_heights): Change to use safe_call1.
3959
3960 2012-07-30 Glenn Morris <rgm@gnu.org>
3961
3962 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3963 does that unconditionally. Remove file, which is now empty.
3964
3965 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3966 Remove empty files.
3967
3968 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3969
3970 Export to GDB most of lisp.h's remaining object-like macros.
3971 * lisp.h (min, max): Move earlier, because they're used earlier now.
3972 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3973 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3974 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3975 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3976 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3977 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3978 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3979 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3980 Now constants, for GDB. They need not be macros.
3981 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3982 Now constants, for GDB, as well as macros, for static initializers.
3983 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3984 Move to after the definition of struct Lisp_Char_Table,
3985 since the former now needs that type defined.
3986 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3987 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3988 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3989 New enums, for gdb_make_enums_visible.
3990 (GLYPH_MODE_LINE_FACE): Remove; unused.
3991 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3992 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3993 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3994 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3995 enum maxargs, enum MAX_ALLOCA.
3996 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3997 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3998 no longer needed, now that they are done in lisp.h.
3999
4000 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4001
4002 Cleanup string bytes checking.
4003 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4004 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4005 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4006 (check_sblock, compact_small_strings): Simplify.
4007
4008 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4009
4010 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4011 These macros are confusing and no longer need to be defined, as
4012 the enum values now suffice. All uses replaced with definiens.
4013 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4014
4015 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4016
4017 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4018 ($(BLD)/w32console.$(O)): Update dependencies.
4019
4020 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4021
4022 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4023 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4024 time. Adjust users.
4025 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4026
4027 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4028
4029 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4030 setting sitelisp (Bug#12010).
4031
4032 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4033
4034 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4035
4036 * w32heap.c (cache_system_info):
4037 * w32.c (sys_rename):
4038 * w32proc.c (find_child_console, sys_kill): All users changed.
4039
4040 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4041
4042 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4043
4044 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4045
4046 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4047
4048 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4049
4050 Cleanup statistics calculation in Fgarbage_collect.
4051 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4052 Fix zombies percentage calculation. Simplify elapsed time calculation.
4053
4054 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4055
4056 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4057 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4058 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4059 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4060 (replace_range, replace_range_2, del_range_2): Change to eassert.
4061 * marker.c (byte_char_debug_check): Adjust style.
4062
4063 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4064
4065 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4066 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4067 long-ago-commented-out code that talks about "WIN32".
4068 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4069 All uses changed.
4070
4071 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4072
4073 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4074 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4075 Simplify by using alignof.
4076 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4077 * lisp.h: Include <stdalign.h>.
4078 (GCALIGNMENT): New macro and constant.
4079 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4080 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4081 (stdalign): New macro, if not already defined.
4082
4083 2012-07-28 Eli Zaretskii <eliz@gnu.org>
4084
4085 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4086 * w32inevt.c: Include w32inevt.h.
4087 (w32_read_console_input): New inline function, calls either
4088 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4089 w32_console_unicode_input.
4090 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4091 (w32_kbd_patch_key, key_event): Use the codepage returned by
4092 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4093 (key_event): use uChar.UnicodeChar only if
4094 w32_console_unicode_input is non-zero.
4095
4096 * w32console.c: Include w32heap.h.
4097 <w32_console_unicode_input>: New global variable.
4098 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4099 family of Windows, zero otherwise.
4100
4101 * w32inevt.h: Declare w32_console_unicode_input.
4102
4103 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4104 --without-x. (Bug#11742)
4105
4106 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4107
4108 Adjust GDB to reflect pvec_type changes (Bug#12036).
4109 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4110 2012-07-04 changes to pseudovector representation.
4111 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4112
4113 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
4114
4115 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4116 bus address.
4117 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4118
4119 2012-07-27 Eli Zaretskii <eliz@gnu.org>
4120
4121 * alloc.c (listn): Fix the order the arguments are consed onto the
4122 list.
4123
4124 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4125 enumeration constants, as PURE and HEAP are too general, and clash
4126 with other headers and sources, such as gmalloc.c and the
4127 MS-Windows system headers. All users changed.
4128
4129 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4130
4131 Revert last save_excursion_save and save_excursion_restore changes.
4132 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4133 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4134
4135 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4136
4137 Fix recently-introduced typos in Windows port.
4138 Reported by Martin Rudalics <rudalics@gmx.at>.
4139 * w32.c (init_environment): Replace comma with semicolon.
4140 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4141
4142 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4143
4144 Improve GDB symbol export (Bug#12036).
4145 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4146 arms of an 'if', not using conditional expressions; otherwise GDB
4147 complains about the types in the unevaluated arm when the argument
4148 is an integer literal.
4149 (xgetint): Simplify expression.
4150 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4151 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4152 Zaretskii in <http://bugs.gnu.org/12036#13>.
4153 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4154 needed now that we have gdb_make_enums_visible.
4155 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4156 (enum enum_USE_LSB_TAG):
4157 New enum types, packaging up enums that need to be exported to GDB.
4158
4159 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4160
4161 Utility function to make a list from specified amount of objects.
4162 * lisp.h (enum constype): New datatype.
4163 (listn): New prototype.
4164 * alloc.c (listn): New function.
4165 (Fmemory_use_count, syms_of_alloc): Use it.
4166 * buffer.c (syms_of_buffer): Likewise.
4167 * callint.c (syms_of_callint): Likewise.
4168 * charset.c (define_charset_internal): Likewise.
4169 * coding.c (syms_of_coding): Likewise.
4170 * keymap.c (syms_of_keymap): Likewise.
4171 * search.c (syms_of_search): Likewise.
4172 * syntax.c (syms_of_syntax): Likewise.
4173 * w32.c (init_environment): Likewise.
4174 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4175 * xdisp.c (syms_of_xdisp): Likewise.
4176 * xfns.c (syms_of_xfns): Likewise.
4177
4178 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4179
4180 Fast save_excursion_save and save_excursion_restore.
4181 * lisp.h (struct Lisp_Excursion): New data type.
4182 (PVEC_EXCURSION): New pseudovector type.
4183 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4184 to deal with it. Adjust comments.
4185 (init_marker, attach_marker): New prototype.
4186 (unchain_marker): Adjust prototype.
4187 * marker.c (attach_marker): Change to global.
4188 (init_marker): New function.
4189 * alloc.c (Fmake_marker, build_marker): Use it.
4190 (build_marker): More easserts.
4191 (mark_object): Handle struct Lisp_Excursion.
4192 * editfns.c (save_excursion_save, save_excursion_restore):
4193 Reimplement to use struct Lisp_Excursion. Add comments.
4194
4195 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4196
4197 Fix export of symbols to GDB (Bug#12036).
4198 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4199 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4200 emacs.c, as this is a more-suitable home. Had this been done earlier
4201 the fix for 12036 would have avoided some of the problems noted in
4202 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4203 would have been more obvious.
4204 * emacs.c: Do not include <verify.h>; no longer needed.
4205 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4206 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4207 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4208 Remove; now done in lisp.h.
4209 * lisp.h (PUBLISH_TO_GDB): New macro.
4210 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4211 (DATA_SEG_BITS): Use it.
4212 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4213 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4214 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4215 not be usable in #if. This simplifies things.
4216
4217 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
4218
4219 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4220
4221 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4222
4223 Simplify export of symbols to GDB (Bug#12036).
4224 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4225 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4226 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4227 Adjust to changes in lisp.h and emacs.c, by using
4228 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4229 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4230 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4231 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4232 instead of gdb_valbits.
4233 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4234 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4235 instead of gdb_array_mark_flag.
4236 (xboolvector): Get size from $->size, not $->header.size.
4237 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4238 (xreload, hook-run, hookpost-run): Remove.
4239 * emacs.c: Include <verify.h>.
4240 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4241 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4242 Remove.
4243 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4244 (gdb_USE_LSB_TAG): New enum constants.
4245 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4246 Also define these as enum constants, so they're visible to GDB.
4247 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4248 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4249 as constants, so they're visible to GDB.
4250 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4251 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4252 Now enum constants, not macros, so they're visible to GDB.
4253 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4254 more convenient now. All uses changed.
4255 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4256 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4257
4258 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4259
4260 Explicitly free restriction data that are not needed anymore.
4261 * editfns.c (save_restriction_restore): Free restriction data.
4262
4263 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4264
4265 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4266 add argument, tune behavior, and adjust all callers.
4267
4268 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4269
4270 Use typedef for EMACS_INT, EMACS_UINT.
4271 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4272 than macros. This simplifies debugging in the usual case, since
4273 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4274 and it allows expressions involving EMACS_INT casts.
4275 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4276
4277 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4278
4279 * nsterm.m (ns_read_socket): Return early if there is a modal
4280 window (Bug#12043).
4281
4282 2012-07-25 Martin Rudalics <rudalics@gmx.at>
4283
4284 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4285 that FOCUS-FRAME can be omitted.
4286
4287 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4288
4289 Adjust buffer text indirection counters at the end of Fkill_buffer.
4290 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4291 buffer is definitely dead. This should really fix an issue reported
4292 by Christoph Scholtes again. (Bug#12007).
4293 (init_buffer_once): Initialize indirection counters of
4294 buffer_defaults and buffer_local_symbols (for sanity and safety).
4295
4296 2012-07-24 Eli Zaretskii <eliz@gnu.org>
4297
4298 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4299 and continuation glyphs on tooltip frames, leave them at zero.
4300 Avoids continued lines in tooltips. (Bug#11832)
4301
4302 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4303
4304 Simplify copy_overlay.
4305 * buffer.c (copy_overlay): Simplify. Use build_marker.
4306 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4307
4308 2012-07-23 Eli Zaretskii <eliz@gnu.org>
4309
4310 * print.c (print_object): Don't crash when a frame's name is nil
4311 or invalid. (Bug#12025)
4312
4313 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4314 it signals an error when a tooltip frame is being created.
4315
4316 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4317
4318 Cleanup miscellaneous objects allocation and initialization.
4319 * alloc.c (allocate_misc): Change to static. Add argument to
4320 specify the subtype. Adjust comment and users.
4321 (build_overlay): New function.
4322 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4323 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4324 (allocate_misc): Remove prototype.
4325 (build_overlay): Add prototype.
4326
4327 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4328
4329 Swap buffer text indirection counters in Fbuffer_swap_text.
4330 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4331 This avoids crash reported by Christoph Scholtes at
4332 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4333
4334 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4335
4336 * nsmenu.m (Popdown_data): New struct.
4337 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4338 free Popdown_data.
4339 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4340 (initWithContentRect): Make imgView and contentView non-static
4341 and autorelease them. Also autorelease img and matrix (Bug#12005).
4342 (dealloc): Remove (Bug#12005).
4343
4344 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4345
4346 Adjust consing_since_gc when objects are explicitly freed.
4347 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4348 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4349 (free_cons, free_misc): Subtract object size from consing_since_gc.
4350
4351 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4352
4353 Simplify and cleanup markers positioning code.
4354 * marker.c (attach_marker): More useful eassert.
4355 (live_buffer, set_marker_internal): New function.
4356 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4357 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4358
4359 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4360
4361 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4362 as it's limited by the amount of memory, not by INT_MAX.
4363
4364 2012-07-21 Eli Zaretskii <eliz@gnu.org>
4365
4366 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4367 in special-event-map. See the discussion at
4368 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4369 for the reasons.
4370
4371 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4372 info.dwItemData. Fixes crashes on 64-bit Windows.
4373 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4374
4375 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4376
4377 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4378 (conversationIdentifier): Return value is NSInteger.
4379 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4380
4381 2012-07-21 Chong Yidong <cyd@gnu.org>
4382
4383 * window.c (decode_any_window): Signal an error if the window is
4384 on a dead frame (Bug#11984).
4385
4386 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4387
4388 Add indirection counting to speed up Fkill_buffer.
4389 * buffer.h (struct buffer): New member.
4390 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4391 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4392 base buffer indirection counter.
4393 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4394 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4395 through buffer list if indirection counter is 0.
4396
4397 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4398
4399 Extend the value returned by Fgarbage_collect with heap statistics.
4400 * alloc.c (Qheap): New symbol.
4401 (syms_of_alloc): DEFSYM it.
4402 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4403 (Fmemory_free): Remove.
4404 (syms_of_alloc): Don't defsubr it.
4405 * buffer.c (Fcompact_buffer): Remove.
4406 (syms_of_buffer): Don't defsubr it.
4407
4408 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4409
4410 Make maybe_gc inline.
4411 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4412 * lisp.h (consing_since_gc, gc_relative_threshold)
4413 (memory_full_cons_threshold): Revert declaration.
4414 (maybe_gc): Remove prototype, define as inline.
4415 * alloc.c: Remove old commented-out code.
4416 (consing_since_gc, gc_relative_threshold)
4417 (memory_full_cons_threshold): Revert to global.
4418 (maybe_gc): Remove.
4419
4420 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4421
4422 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4423 * lisp.h (build_unibyte_string): New function.
4424 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4425 * sysdep.c, w32fns.c, xfns.c: Use it.
4426 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4427 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4428 Adjust users accordingly.
4429 * font.h (font_open_by_name): Adjust prototype.
4430
4431 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4432
4433 Cleanup calls to Fgarbage_collect.
4434 * lisp.h (maybe_gc): New prototype.
4435 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4436 Remove declarations.
4437 * alloc.c (maybe_gc): New function.
4438 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4439 Make them static.
4440 * bytecode.c (MAYBE_GC): Use maybe_gc.
4441 * eval.c (eval_sub, Ffuncall): Likewise.
4442 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4443 to avoid dependency from auto-save feature.
4444
4445 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4446
4447 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4448 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4449 'for_each_per_buffer_object_at'.
4450 All uses changed. It's better to use upper-case for macros that
4451 cannot be implemented as functions, to give the reader a clue
4452 that they're special.
4453
4454 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4455
4456 * alloc.c (Fgarbage_collect): Tweak docstring.
4457
4458 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4459
4460 Tweak the value returned from Fgarbage_collect again.
4461 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4462 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4463 Adjust documentation.
4464 (total_vector_bytes): Rename to total_vector_slots, adjust
4465 accounting.
4466 (total_free_vector_bytes): Rename to total_free_vector_slots,
4467 adjust accounting.
4468 (Qstring_bytes, Qvector_slots): New symbols.
4469 (syms_of_alloc): DEFSYM them.
4470
4471 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4472
4473 Buffer compaction primitive which may be used from Lisp.
4474 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4475 (syms_of_buffer): Register Fcompact_buffer.
4476 * alloc.c (Fgarbage_collect): Use compact_buffer.
4477 * buffer.h (compact_buffer): New prototype.
4478 (struct buffer_text): New member.
4479
4480 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4481
4482 New macro to iterate over all buffers, miscellaneous cleanups.
4483 * lisp.h (all_buffers): Remove declaration.
4484 * buffer.h (all_buffers): Add declaration, with comment.
4485 (for_each_buffer): New macro.
4486 * alloc.c (Fgarbage_collect, mark_object): Use it.
4487 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4488 (init_buffer): Likewise.
4489 * data.c (Fset_default): Likewise.
4490 * coding.c (code_conversion_restore): Remove redundant check
4491 for dead buffer.
4492 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4493
4494 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4495
4496 Fix bug that created negative-length intervals.
4497 * intervals.c (merge_interval_right, merge_interval_left):
4498 Do not zero out this interval if it is absorbed by its children,
4499 as this interval's total length doesn't change in that case. See
4500 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4501
4502 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4503
4504 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4505 when invoking (make-bool-vector N t) and N is a positive
4506 multiple of 8 -- the last 8 bits were mistakenly cleared.
4507
4508 Remove some struct layout assumptions in bool vectors.
4509 * alloc.c (bool_header_size): New constant.
4510 (header_size, word_size): Move earlier, as they're now used earlier.
4511 Use 'word_size' in a few more places, where it's appropriate.
4512 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4513 padding before the data member of a bool vector.
4514 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4515 than doing the check by hand with an abort ().
4516
4517 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4518
4519 * eval.c (Fdefvar): Don't check constants since we only set the var if
4520 it's not yet defined anyway (bug#11904).
4521
4522 * lisp.h (last_undo_boundary): Declare new var.
4523 * keyboard.c (command_loop_1): Set it.
4524 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4525 were auto-added by the command loop (bug#11774).
4526
4527 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4528
4529 * w32font.c (Qsymbol): Remove local definition.
4530 (syms_of_w32font): Don't DEFSYM it.
4531
4532 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4533
4534 Fix sweep_vectors to handle large bool vectors correctly.
4535 * alloc.c (sweep_vectors): Account total_vector_bytes for
4536 bool vectors larger than VBLOCK_BYTES_MAX.
4537
4538 2012-07-18 Chong Yidong <cyd@gnu.org>
4539
4540 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4541 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4542
4543 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4544
4545 Return more descriptive data from Fgarbage_collect.
4546 Suggested by Stefan Monnier in
4547 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4548 * alloc.c (bounded_number): New function.
4549 (total_buffers, total_vectors): New variable.
4550 (total_string_size): Rename to total_string_bytes, adjust users.
4551 (total_vector_size): Rename to total_vector_bytes, adjust users.
4552 (sweep_vectors): Account total_vectors and total_vector_bytes.
4553 (Fgarbage_collect): New return value. Adjust documentation.
4554 (gc_sweep): Account total_buffers.
4555 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4556 (VECTOR_SIZE): Remove.
4557 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4558 (Qinterval, Qmisc): New symbols.
4559 (syms_of_data): Initialize them.
4560 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4561 (Qcons, Qbuffer): New declarations.
4562
4563 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4564
4565 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4566 Round up, not down. Improve doc.
4567
4568 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4569
4570 Restore old code in allocate_string_data to avoid Faset breakage.
4571 Reported by Julien Danjou <julien@danjou.info> in
4572 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4573 * alloc.c (allocate_string_data): Restore old code with minor
4574 adjustments, fix comment to explain this subtle issue.
4575
4576 2012-07-17 Eli Zaretskii <eliz@gnu.org>
4577
4578 Remove FILE_SYSTEM_CASE.
4579 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4580
4581 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4582 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4583 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4584 call-process-region passes it through expand-file-name.
4585
4586 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4587
4588 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4589
4590 Fix crash when creating indirect buffer (Bug#11917)
4591 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4592 Don't handle unbound variables specially if non-zero.
4593 (Fbuffer_local_variables): Pass zero.
4594 (clone_per_buffer_values): Pass non-zero.
4595
4596 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4597
4598 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4599 to make the loop interruptible.
4600
4601 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4602
4603 * gnutls.c (emacs_gnutls_handshake): Only retry if
4604 GNUTLS_E_INTERRUPTED.
4605
4606 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4607
4608 Cleanup and convert miscellaneous checks to eassert.
4609 * alloc.c (mark_interval): Fix comment, partially rephrase
4610 old comment from intervals.h (see below).
4611 * intervals.c (find_interval, adjust_intervals_for_insertion)
4612 (delete_interval, adjust_intervals_for_deletion)
4613 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4614 Convert to eassert.
4615 (adjust_intervals_for_insertion, make_new_interval):
4616 Remove obsolete and unused code.
4617 * intervals.h (struct interval): Remove obsolete comment.
4618 * textprotp.c (erase_properties): Remove unused code.
4619 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4620 (Fremove_list_of_text_properties): Convert to eassert.
4621
4622 2012-07-17 Chong Yidong <cyd@gnu.org>
4623
4624 * editfns.c (Finsert_char): Doc fix.
4625
4626 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4627
4628 Fix previous change to make Fmemory_free always accurate.
4629 * alloc.c (make_interval): Update total_free_intervals.
4630 (make_float): Likewise for total_free_floats.
4631 (free_cons, Fcons): Likewise for total_free_conses.
4632 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4633 Likewise for total_free_vector_bytes.
4634 (Fmake_symbol): Likewise for total_free_symbols.
4635 (bytes_free): Remove.
4636
4637 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4638
4639 Simple free memory accounting feature.
4640 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4641 (sweep_vectors): Accumulate size of free vectors.
4642 (Fgarbage_collect): Setup bytes_free.
4643 (Fmemory_free): New function.
4644 (syms_of_alloc): Register it.
4645
4646 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4647
4648 Cleanup overlays checking.
4649 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4650 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4651 eassert and OVERLAYP.
4652 (sort_overlays): Change to use OVERLAYP.
4653
4654 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4655
4656 * editfns.c (Finsert_char): Make it interactive, and make the
4657 second arg optional. Copy interactive spec and docstring from
4658 ucs-insert.
4659
4660 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4661
4662 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4663 Unlike the other wrapped functions, fabs has an unspecified
4664 effect on errno.
4665
4666 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4667
4668 * nsterm.m (keyDown): Interpret flags without left/right bits
4669 as the left key (Bug#11670).
4670
4671 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4672
4673 Remove empty and useless init functions.
4674 * lisp.h (init_character_once, init_fns, init_image)
4675 (init_filelock, init_sound): Remove prototype.
4676 * character.c (init_character_once): Remove.
4677 * filelock.c (init_filelock): Likewise.
4678 * fns.c (init_fns): Likewise.
4679 * image.c (init_image): Likewise.
4680 * sound.c (init_sound): Likewise.
4681 * emacs.c (main): Adjust accordingly.
4682
4683 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4684
4685 * gtkutil.h: Tiny cleanups.
4686 (use_old_gtk_file_dialog): Remove useless declaration.
4687 (xg_uses_old_file_dialog): Add suggested const attribute.
4688
4689 2012-07-15 Eli Zaretskii <eliz@gnu.org>
4690
4691 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4692 (bidi_paragraph_init): Use it to limit search forward for a strong
4693 directional character in abnormally large paragraphs full of
4694 neutral or weak characters. (Bug#11943)
4695
4696 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4697
4698 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4699 the toolbar (Bug#9451).
4700 (xg_make_tool_item): Give the widget event box a transparent
4701 background.
4702
4703 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4704
4705 Cleanup basic allocation variables and functions.
4706 * alloc.c (ignore_warnings, init_intervals, init_float)
4707 (init_cons, init_symbol, init_marker): Remove.
4708 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4709 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4710 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4711 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4712 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4713 (staticidx, init_alloc_once, init_strings, free_ablock):
4714 Remove redundant initialization.
4715 * fns.c (init_weak_hash_tables): Remove.
4716 * lisp.h (init_weak_hash_tables): Remove prototype.
4717
4718 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4719
4720 Use zero_vector where appropriate.
4721 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4722 accordingly.
4723 * lisp.h (zero_vector): New declaration.
4724 * font.c (null_vector): Remove.
4725 (syms_of_font): Remove initialization and staticpro.
4726 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4727 * keymap.c (Faccessible_keymaps): Likewise.
4728
4729 2012-07-15 Leo Liu <sdl.web@gmail.com>
4730
4731 * fringe.c: Fix typo in comments.
4732
4733 2012-07-14 Leo Liu <sdl.web@gmail.com>
4734
4735 * fringe.c: Add a new bitmap exclamation-mark.
4736
4737 2012-07-14 Eli Zaretskii <eliz@gnu.org>
4738
4739 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4740
4741 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4742 (HAVE_MENUS): Don't define, defined by editing config.in with
4743 msdos/sed2v2.inp.
4744 (GMALLOC_INHIBIT_VALLOC): Don't define.
4745 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4746
4747 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
4748
4749 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4750
4751 2012-07-14 Glenn Morris <rgm@gnu.org>
4752
4753 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4754 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4755 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4756
4757 2012-07-13 Glenn Morris <rgm@gnu.org>
4758
4759 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4760
4761 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4762 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4763
4764 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4765
4766 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4767 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4768 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4769 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4770 where appropriate.
4771 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4772 as boolean expression.
4773 (x_set_window_size): Remove unused variable toolbar.
4774 (ns_get_color_default, ns_mod_to_lisp): Remove.
4775 (ns_mouse_position): Remove unused variables xchar and ychar.
4776 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4777 (ns_set_vertical_scroll_bar): Remove unused variable count.
4778 (ns_delete_terminal): Remove unused variable i.
4779 (ns_term_init): Remove unused variables r, g and b.
4780 (mouseDown): Remove unused variable window.
4781 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4782 (initFrameFromEmacs): Remove unused variable vbextra.
4783 (mouseEntered): Remove unused variables p and dpyinfo.
4784 (mouseExited): Remove unused variables p and r.
4785 (ns_define_frame_cursor, ns_clear_frame_area)
4786 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4787 (menuDown): Assign [sender tag] to variable and cast the variable.
4788
4789 * nsterm.h (menuDown): Add id as type to argument sender.
4790 (ns_display_info_for_name): Add Lisp_Object argument.
4791 (ns_term_init): Add Lisp_Object argument.
4792 (ns_map_event_to_object): Add void argument.
4793 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4794 prototype with arguments and only declare if __OBJC__.
4795 (nxatoms_of_nsselect): Add void argument.
4796 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4797 (ns_alloc_autorelease_pool): Add void argument.
4798 (ns_release_autorelease_pool): Add void* argument.
4799 (ns_get_defaults_value): Add const char* argument.
4800
4801 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4802 (initFromContents): Use SSDATA where appropriate.
4803 (ns_update_menubar): Add braces to ambigous if-else.
4804 (initWithTitle): Put () around assignment in if statement.
4805 (ns_menu_show): Remove unused variables window and keymap.
4806 (update_frame_tool_bar): Remove unused variable selected_p.
4807 (initWithContentRect): Remove unused variable this_cmd_name.
4808
4809 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4810 appropriate.
4811 (setXBMColor): Remove unused variable len.
4812 (setPixmapData): Put () around assignment in loop statement.
4813
4814 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4815 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4816 where appropriate.
4817 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4818 around assignment in loop statement.
4819 (nsfont_open): Remove unused variable i.
4820 (nsfont_open): Remove unused variable len.
4821 (nsfont_draw): Remove unused variable cs.
4822
4823 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4824 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4825 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4826 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4827 (Fns_font_name, Fns_perform_service)
4828 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4829 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4830 (ns_set_name): Remove unused variable view.
4831 (x_set_menu_bar_lines): Remove unused variable olines.
4832 (x_set_tool_bar_lines): Remove unused variable root_window.
4833 (Fns_list_colors): Put () around assignment in while statement.
4834 (Fns_perform_service): Remove unused variable len.
4835 (Fns_display_usable_bounds): Remove unused variable top.
4836 (syms_of_nsfns): Remove unused variable i.
4837
4838 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4839 memcpy (Bug#11907).
4840
4841 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4842
4843 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4844 and free it with DestroyExceptionInfo (Bug#11558).
4845
4846 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
4847
4848 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4849 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4850 Set here, not in nt/config.nt.
4851
4852 2012-07-13 Eli Zaretskii <eliz@gnu.org>
4853
4854 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4855 cursor overflow into the last glyph on display line when the right
4856 fringe is off. (Bug#11832)
4857
4858 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4859
4860 * xdisp.c (produce_special_glyphs): Now static.
4861 * dispextern.h (produce_special_glyphs): Remove decl.
4862
4863 2012-07-13 Glenn Morris <rgm@gnu.org>
4864
4865 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4866 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4867
4868 * s/usg5-4-common.h (USG, USG5):
4869 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4870 * s/sol2-6.h (SOLARIS2):
4871 * s/irix6-5.h (IRIX6_5):
4872 * s/hpux10-20.h (USG, USG5, HPUX):
4873 * s/gnu-linux.h (USG, GNU_LINUX):
4874 * s/freebsd.h (BSD_SYSTEM):
4875 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4876 * s/cygwin.h (CYGWIN):
4877 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4878 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4879
4880 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4881
4882 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4883
4884 2012-07-13 Glenn Morris <rgm@gnu.org>
4885
4886 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4887
4888 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4889
4890 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4891 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4892
4893 2012-07-12 Glenn Morris <rgm@gnu.org>
4894
4895 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4896
4897 * process.c (init_process_emacs): Rename from init_process.
4898 The old name is also the name of a Mach system call.
4899 * lisp.h, emacs.c: Update for this name change.
4900 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4901 longer needed.
4902
4903 2012-07-12 Eli Zaretskii <eliz@gnu.org>
4904
4905 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4906 memmove call that removes glyphs covered by the left truncation
4907 glyph. Improve commentary.
4908 (display_line): Fix display of continuation glyphs on GUI frames
4909 when the right fringe is turned off and variable-size fonts are
4910 used in the window. Move the code that appends a stretch glyph to
4911 produce_special_glyphs, so that it could be used for truncation
4912 and continuation glyphs alike.
4913 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4914 glyph of a suitably computed width, to align the special glyphs at
4915 the window margin. Code moved from display_line. (Bug#11832)
4916
4917 2012-07-12 Glenn Morris <rgm@gnu.org>
4918
4919 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4920
4921 * s/gnu-linux.h, s/hpux10-20.h:
4922 Do not unconditionally define HAVE_XRMSETDATABASE.
4923
4924 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4925
4926 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4927
4928 Fix typos that broke OS X build.
4929 Reported by Randal L. Schwartz in
4930 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4931 * nsterm.m (ns_timeout): Add missing local decl.
4932 (ns_get_color): snprintf -> sprintf, to fix typo.
4933
4934 2012-07-12 Glenn Morris <rgm@gnu.org>
4935
4936 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4937 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4938 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4939 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4940
4941 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4942 Move PTY_OPEN to configure.
4943
4944 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4945 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4946 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4947
4948 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4949
4950 Use empty_unibyte_string where applicable.
4951 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4952 * lread.c (read1): Likewise.
4953 * xsettings.c (syms_of_xsettings): Likewise.
4954
4955 2012-07-12 Glenn Morris <rgm@gnu.org>
4956
4957 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4958 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4959 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4960 * s/hpux10-20.h (RUN_TIME_REMAP):
4961 * s/bsd-common.h (TABDLY): Move to configure.
4962
4963 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4964
4965 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4966
4967 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4968 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4969
4970 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4971
4972 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4973 * s/template.h: Move NARROWPROTO to configure.
4974
4975 2012-07-11 Glenn Morris <rgm@gnu.org>
4976
4977 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4978 unused since 2011-01-17 change to systty.h.
4979
4980 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4981 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4982 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4983
4984 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4985
4986 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4987
4988 2012-07-11 Glenn Morris <rgm@gnu.org>
4989
4990 * s/darwin.h, s/gnu-linux.h, s/template.h:
4991 Move INTERRUPT_INPUT to configure.
4992
4993 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4994
4995 Minor adjustments to interning code.
4996 * lisp.h (intern, intern_c_string): Redefine as static inline
4997 wrappers for intern_1 and intern_c_string_1, respectively.
4998 (intern_1, intern_c_string_1): Rename prototypes.
4999 * lread.c (intern_1, intern_c_string_1, oblookup):
5000 Simplify Vobarray checking.
5001 * font.c (font_intern_prop): Likewise. Adjust comment.
5002 * w32font.c (intern_font_name): Likewise.
5003
5004 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5005
5006 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5007
5008 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5009 of Fcar/Fcdr if possible.
5010 * font.c (check_otf_features): Likewise.
5011 * fontset.c (Fnew_fontset): Likewise.
5012 * gnutls.c (Fgnutls_boot): Likewise.
5013 * minibuf.c (read_minibuf): Likewise.
5014 * msdos.c (IT_set_frame_parameters): Likewise.
5015 * xmenu.c (Fx_popup_dialog): Likewise.
5016 * w32menu.c (Fx_popup_dialog): Likewise.
5017
5018 2012-07-11 Glenn Morris <rgm@gnu.org>
5019
5020 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5021 since nothing has defined it on these platforms.
5022
5023 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5024 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5025
5026 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5027 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5028 Move CLASH_DETECTION to configure.
5029
5030 * s/gnu.h: Remove file, which is now empty.
5031
5032 * s/gnu.h, s/gnu-linux.h:
5033 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5034
5035 2012-07-11 John Wiegley <johnw@newartisans.com>
5036
5037 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5038 function attribute, so we only use it if it exists in the
5039 compiler.
5040
5041 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5042
5043 Avoid call to strlen in fast_c_string_match_ignore_case.
5044 * search.c (fast_c_string_match_ignore_case): Change to use
5045 length argument. Adjust users accordingly.
5046 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5047
5048 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5049
5050 Assume mkdir, rmdir.
5051 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5052 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5053
5054 Assume rename.
5055 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5056
5057 Assume perror.
5058 * s/hpux10-20.h (HAVE_PERROR): Remove.
5059 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5060 Remove dummy definition, as this problem was obsolete long ago.
5061
5062 Assume strerror.
5063 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5064
5065 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5066
5067 Avoid calls to strlen in font processing functions.
5068 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5069 (font_open_by_name): Change to use length argument.
5070 Adjust users accordingly.
5071 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5072 Adjust prototypes.
5073 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5074 Change to return ptrdiff_t.
5075 (xfont_list_pattern, xfont_match): Use length returned by
5076 xfont_decode_coding_xlfd.
5077 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5078
5079 2012-07-11 Glenn Morris <rgm@gnu.org>
5080
5081 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5082 Move DONT_REOPEN_PTY to configure.
5083
5084 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5085 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5086
5087 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5088
5089 Remove "#define unix" that is no longer needed (Bug#11905).
5090 * s/aix4-2.h (unix): Remove; no longer needed.
5091
5092 EMACS_TIME simplification (Bug#11875).
5093 This replaces macros (which typically do not work in GDB)
5094 with functions, typedefs and enums, making the code easier to debug.
5095 The functional style also makes code easier to read and maintain.
5096 * systime.h: Include <sys/time.h> on all hosts, not just if
5097 WINDOWSNT, since 'struct timeval' is needed in general.
5098 (EMACS_TIME): Now a typedef, not a macro.
5099 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5100 not macros.
5101 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5102 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5103 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5104 (EMACS_TIME_LE): Now functions, not macros.
5105 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5106 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5107 which are not functions. All uses rewritten to use:
5108 (make_emacs_time): New function.
5109 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5110 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5111 not functions. All uses rewritten to use the following, respectively:
5112 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5113 (add_emacs_time, sub_emacs_time): New functions.
5114 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5115 * fileio.c (Fcopy_file):
5116 * xterm.c (XTflash): Get the current time closer to when it's used.
5117 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5118
5119 * bytecode.c (targets): Suppress -Woverride-init warnings.
5120
5121 Simplify by avoiding confusing use of strncpy etc.
5122 * doc.c (Fsnarf_documentation):
5123 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5124 * frame.c (Fmake_terminal_frame):
5125 * gtkutil.c (get_utf8_string):
5126 * lread.c (openp):
5127 * nsmenu.m (ns_update_menubar):
5128 * regex.c (regerror):
5129 Prefer memcpy to strncpy and strncat when either will do.
5130 * fileio.c (Fsubstitute_in_file_name):
5131 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5132 (menu_separator_name_p):
5133 * nsmenu.m (ns_update_menubar):
5134 Prefer memcmp to strncmp when either will do.
5135 * nsterm.m: Include <ftoastr.h>.
5136 (ns_get_color):
5137 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5138 Prefer snprintf to strncpy.
5139 * nsterm.m (ns_term_init):
5140 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5141 * nsterm.m (ns_term_init):
5142 Avoid the need for strncpy, by using build_string or
5143 make_unibyte_string directly. Use dtoastr, not snprintf.
5144 * process.c (Fmake_network_process): Diagnose service names that
5145 are too long, rather than silently truncating them or creating
5146 non-null-terminated names.
5147 (Fnetwork_interface_info): Likewise, for interface names.
5148 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5149 Prefer sprintf to strncat.
5150 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5151 Prefer vsnprintf to vsprintf + strncpy.
5152
5153 2012-07-10 Glenn Morris <rgm@gnu.org>
5154
5155 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5156 Clarify fallback case.
5157
5158 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5159
5160 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5161 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5162 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5163 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5164 where argument type is known to be a Lisp_Cons.
5165
5166 2012-07-10 Tom Tromey <tromey@redhat.com>
5167
5168 * bytecode.c (BYTE_CODE_THREADED): New macro.
5169 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5170 (enum byte_code_op): New type.
5171 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5172 (exec_byte_code): Use them. Use token threading when applicable.
5173
5174 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5175
5176 Optimize pure C strings initialization.
5177 * lisp.h (make_pure_string): Fix prototype.
5178 (build_pure_c_string): New function, defined as static inline. This
5179 provides a better opportunity to optimize away calls to strlen when
5180 the function is called with compile-time constant argument.
5181 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5182 argument, adjust users accordingly. Use build_pure_c_string where
5183 appropriate.
5184 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5185 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5186 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5187
5188 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5189
5190 Avoid calls to strlen in miscellaneous functions.
5191 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5192 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5193 * lread.c (openp): Likewise.
5194
5195 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5196
5197 Avoid calls to strlen in path processing functions.
5198 * fileio.c (file_name_as_directory): Add comment. Change to add
5199 srclen argument and return the length of result. Adjust users
5200 accordingly.
5201 (directory_file_name): Fix comment. Change to add srclen argument,
5202 swap 1st and 2nd arguments to obey the common convention.
5203 Adjust users accordingly.
5204 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5205
5206 2012-07-10 Glenn Morris <rgm@gnu.org>
5207
5208 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5209 Move PENDING_OUTPUT_COUNT definition to configure.
5210
5211 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5212 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5213 * s/gnu.h (DATA_START): Move definitions to configure.
5214
5215 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5216 We include usg5-4-common.h, which defines them both.
5217
5218 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5219 O_RDONLY already includes it).
5220
5221 Stop ns builds setting the EMACSLOADPATH environment variable.
5222 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5223 Now it does not set EMACSLOADPATH, just returns the load-path string.
5224 * nsterm.h: Update accordingly.
5225 * lread.c [HAVE_NS]: Include nsterm.h.
5226 (init_lread) [HAVE_NS]: Use ns_load_path.
5227 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5228
5229 2012-07-09 Glenn Morris <rgm@gnu.org>
5230
5231 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5232 since the included bsd-common.h does so.
5233
5234 Stop ns builds setting the EMACSPATH environment variable.
5235 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5236 (ns_init_paths): Do not set EMACSPATH.
5237 * nsterm.h (ns_exec_path): Add it.
5238 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5239 Use ns_exec_path.
5240
5241 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5242
5243 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5244
5245 * process.c (wait_reading_process_output): 'waitchannels' was unset
5246 when read_kbd || !NILP (wait_for_cell); fix this.
5247
5248 Add GCC-style 'const' attribute to functions that can use it.
5249 * character.h (char_resolve_modifier_mask):
5250 * keyboard.h (make_ctrl_char):
5251 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5252 (init_character_once, next_almost_prime, init_fns, init_image)
5253 (flush_pending_output, init_sound):
5254 * mem-limits.h (start_of_data):
5255 * menu.h (finish_menu_items):
5256 Add ATTRIBUTE_CONST.
5257 * emacs.c (DEFINE_DUMMY_FUNCTION):
5258 Declare the dummy function with ATTRIBUTE_CONST.
5259 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5260 Add decls with ATTRIBUTE_CONST.
5261
5262 Minor improvements to make_formatted_string.
5263 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5264 where int is good enough, as vsprintf returns an int.
5265 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5266
5267 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5268
5269 Use make_formatted_string to avoid double length calculation.
5270 * lisp.h (make_formatted_string): New prototype.
5271 * alloc.c (make_formatted_string): New function.
5272 * buffer.c (Fgenerate_new_buffer_name): Use it.
5273 * dbus.c (syms_of_dbusbind): Likewise.
5274 * editfns.c (Fcurrent_time_zone): Likewise.
5275 * filelock.c (get_boot_time): Likewise.
5276 * frame.c (make_terminal_frame, set_term_frame_name)
5277 (x_report_frame_params): Likewise.
5278 * image.c (gs_load): Likewise.
5279 * minibuf.c (get_minibuffer): Likewise.
5280 * msdos.c (dos_set_window_size): Likewise.
5281 * process.c (make_process): Likewise.
5282 * xdisp.c (ensure_echo_area_buffers): Likewise.
5283 * xsettings.c (apply_xft_settings): Likewise.
5284
5285 2012-07-09 Glenn Morris <rgm@gnu.org>
5286
5287 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5288 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5289 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5290 * nsterm.h (ns_etc_directory): Add it.
5291 * callproc.c [HAVE_NS]: Include nsterm.h.
5292 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5293
5294 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5295
5296 Move marker debugging code under MARKER_DEBUG.
5297 * marker.c (MARKER_DEBUG): Move marker debugging code under
5298 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5299 for bootstrap with --enable-checking (~3x slowdown reported
5300 by Juanma Barranquero <lekktu@gmail.com>).
5301 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5302
5303 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5304
5305 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5306 See <http://bugs.gnu.org/11825#29>.
5307
5308 2012-07-08 Eli Zaretskii <eliz@gnu.org>
5309
5310 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5311 has no font, use the frame's font. (Bug#11813)
5312 (display_line): Add commentary about displaying truncation glyphs
5313 on GUI frames.
5314 (produce_special_glyphs): Move here from term.c.
5315
5316 * term.c (produce_special_glyphs): Move to xdisp.c.
5317
5318 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5319 section.
5320
5321 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5322
5323 * xdisp.c (display_line): Avoid warning about implicit declaration
5324 of FRAME_FONT.
5325
5326 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5327
5328 * lisp.h: Remove empty conditional.
5329
5330 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5331
5332 * lread.c (load_path_check): Now static.
5333
5334 Fix some minor --with-ns problems found by static checking.
5335 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5336 (x_set_font) [!HAVE_X_WINDOWS]:
5337 * image.c (xpm_load_image) [HAVE_NS]:
5338 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5339 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5340 Remove unused local.
5341 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5342 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5343 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5344 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5345 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5346 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5347 Fix pointer signedness problem.
5348 * xfaces.c (FRAME_X_FONT_TABLE):
5349 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5350
5351 2012-07-07 Glenn Morris <rgm@gnu.org>
5352
5353 * lread.c (load_path_check): New function, split from init_lread.
5354 (init_lread): Reorganize. Motivation:
5355 If EMACSLOADPATH is set, check/warn about that rather than the
5356 defaults, which we are not going to use. Hence we can remove
5357 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5358 Don't warn if site-lisp directories are missing.
5359 If not installed, start from a blank load-path, since
5360 PATH_LOADSEARCH refers to the eventual installation directories.
5361
5362 2012-07-07 Eli Zaretskii <eliz@gnu.org>
5363
5364 Support truncation and continuation glyphs on GUI frames, when
5365 fringes are disabled. (Bug#11832)
5366 * xdisp.c (init_iterator): Get dimensions of truncation and
5367 continuation glyphs even if on GUI frames.
5368 Adjust it->last_visible_x on GUI frames when the left or right fringes,
5369 or both, are absent.
5370 (start_display, move_it_in_display_line_to): Handle the case of a
5371 GUI frame without a fringe to display continuation or truncation
5372 glyphs.
5373 (insert_left_trunc_glyphs): Support GUI frames: make sure
5374 truncation glyphs overwrite enough glyphs from the current line to
5375 have sufficient space in pixels.
5376 (display_line): Support truncation and continuation glyphs on GUI
5377 frames. If some spare pixels are left on the line after inserting
5378 the truncation glyphs, fill that space with a stretch glyph of a
5379 suitably computed width.
5380
5381 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5382 produce_glyphs, to support GUI sessions.
5383
5384 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5385
5386 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5387
5388 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5389
5390 Do not require float-time's arg to fit in time_t (Bug#11825).
5391 This works better on hosts where time_t is unsigned, and where
5392 float-time is applied to the (negative) difference between two times.
5393 * editfns.c (decode_time_components): Last arg is now double *,
5394 not int *, and means to store all the result as a double, without
5395 worrying about whether the seconds part fits in time_t.
5396 All callers changed.
5397 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5398 All callers changed.
5399 (Ffloat_time): Do not fail merely because the specified time falls
5400 outside of time_t range.
5401
5402 2012-07-07 Glenn Morris <rgm@gnu.org>
5403
5404 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5405 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5406 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5407
5408 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
5409
5410 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5411 Update dependencies.
5412
5413 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5414
5415 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5416
5417 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5418 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5419 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5420 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5421 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5422 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5423
5424 * xfont.c (compare_font_names): Redo to omit the need for casts.
5425
5426 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5427
5428 * xfns.c (Fx_change_window_property): Doc fix.
5429 * w32fns.c (Fx_change_window_property): Doc fix.
5430
5431 * w32fns.c (Fx_window_property): Accept the same arguments as the
5432 X Windows version. Doc fix.
5433 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5434
5435 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5436 Eli Zaretskii <eliz@gnu.org>
5437
5438 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5439 Windows-specific code from nt/config.nt moved here.
5440 Obsolete settings removed.
5441
5442 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5443
5444 * process.c: Avoid unnecessary calls to gettime.
5445 (wait_reading_process_output): Don't get the time of day
5446 when gobbling data immediately and not waiting, as there's no need
5447 for it in that case. This removes a FIXME.
5448
5449 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5450
5451 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5452 is defined (Bug#11768).
5453
5454 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5455
5456 Fix marker debugging code.
5457 * marker.c (byte_char_debug_check): Do not perform the check
5458 if buffer is not multibyte.
5459 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5460 Call byte_char_debug_check with correct arguments.
5461
5462 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5463
5464 Compile marker debugging code only if ENABLE_CHECKING is defined.
5465 * marker.c (byte_char_debug_check, count_markers):
5466 Use only if ENABLE_CHECKING is defined.
5467 (byte_debug_flag): Remove.
5468 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5469 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5470
5471 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5472
5473 Avoid code repetition in marker-related functions.
5474 * marker.c (attach_marker): New function.
5475 (Fset_marker, set_marker_restricted, set_marker_both)
5476 (set_marker_restricted_both): Use it.
5477 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5478 Consistently rename charno to charpos.
5479 (marker_position): Add eassert.
5480 (marker_byte_position): Convert to eassert.
5481
5482 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5483
5484 Simplify list operations in unchain_overlay and unchain_marker.
5485 * buffer.c (unchain_overlay): Simplify. Add comment.
5486 * marker.c (unchain_marker): Simplify. Fix comments.
5487
5488 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5489
5490 Introduce fast path for the widely used marker operation.
5491 * alloc.c (build_marker): New function.
5492 * lisp.h (build_marker): New prototype.
5493 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5494 * composite.c (autocmp_chars): Likewise.
5495 * editfns.c (buildmark): Remove.
5496 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5497 (save_restriction_save): Use build_marker.
5498 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5499 * window.c (save_window_save): Likewise.
5500
5501 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5502
5503 Do not use Fdelete_overlay in delete_all_overlays
5504 to avoid redundant calls to unchain_overlay.
5505 * buffer.c (drop_overlay): New function.
5506 (delete_all_overlays, Fdelete_overlay): Use it.
5507 * minibuf.c (get_minibuffer): Fix comment.
5508
5509 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5510
5511 Port to OpenBSD 5.1 amd64.
5512 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5513 This is needed for OpenBSD, and should be harmless on all BSD systems.
5514 Also, include <sys/sysctl.h>, as it should be available on all
5515 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5516 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5517 use p_pid member, not kp_proc.pid.
5518
5519 2012-07-06 Glenn Morris <rgm@gnu.org>
5520
5521 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5522
5523 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5524
5525 More xmalloc and related cleanup.
5526 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5527 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5528 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5529 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5530 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5531 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5532 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5533 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5534 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5535 * xterm.c:
5536 Omit needless casts involving void * pointers and allocation.
5537 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5538 as the former is more robust if P's type is changed.
5539 Prefer xzalloc to xmalloc + memset 0.
5540 Simplify malloc-or-realloc to realloc.
5541 Don't worry about xmalloc returning a null pointer.
5542 Prefer xstrdup to xmalloc + strcpy.
5543 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5544 growing it.
5545 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5546 alloca of a constant.
5547
5548 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5549
5550 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5551 hscroll is larger than the line width. Fixes long and futile
5552 looping inside extend_face_to_end_of_line (on a TTY) producing
5553 glyphs that are not needed and thrown away.
5554
5555 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5556
5557 * marker.c (set_marker_restricted_both): Simplify by using
5558 clip_to_bounds.
5559
5560 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5561
5562 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5563
5564 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5565
5566 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5567 not defined (Bug#11768).
5568 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5569 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5570 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5571 followed by gtk_box_set_homogeneous (Bug#11768).
5572 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5573 (update_theme_scrollbar_width, xg_create_scroll_bar):
5574 Use gtk_scrollbar_new (Bug#11768).
5575 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5576 (is_box_type): New function (Bug#11768).
5577 (xg_tool_item_stale_p): Call is_box_type.
5578 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5579 with default display (Bug#11768).
5580
5581 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5582
5583 * xdisp.c (window_hscroll_limited): New function.
5584 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5585 coordinates when window's hscroll is set to insanely large
5586 values. (Bug#11857)
5587
5588 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
5589
5590 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5591 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5592
5593 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5594
5595 Cleanup xmalloc.
5596 * lisp.h (xzalloc): New prototype. Omit needless casts.
5597 * alloc.c (xzalloc): New function. Omit needless casts.
5598 * charset.c: Omit needless casts. Convert all calls to
5599 xmalloc with following memset to xzalloc.
5600 * dispnew.c: Likewise.
5601 * fringe.c: Likewise.
5602 * image.c: Likewise.
5603 * sound.c: Likewise.
5604 * term.c: Likewise.
5605 * w32fns.c: Likewise.
5606 * w32font.c: Likewise.
5607 * w32term.c: Likewise.
5608 * xfaces.c: Likewise.
5609 * xfns.c: Likewise.
5610 * xterm.c: Likewise.
5611 * atimer.c: Omit needless casts.
5612 * buffer.c: Likewise.
5613 * callproc.c: Likewise.
5614 * ccl.c: Likewise.
5615 * coding.c: Likewise.
5616 * composite.c: Likewise.
5617 * doc.c: Likewise.
5618 * doprnt.c: Likewise.
5619 * editfns.c: Likewise.
5620 * emacs.c: Likewise.
5621 * eval.c: Likewise.
5622 * filelock.c: Likewise.
5623 * fns.c: Likewise.
5624 * gtkutil.c: Likewise.
5625 * keyboard.c: Likewise.
5626 * lisp.h: Likewise.
5627 * lread.c: Likewise.
5628 * minibuf.c: Likewise.
5629 * msdos.c: Likewise.
5630 * print.c: Likewise.
5631 * process.c: Likewise.
5632 * region-cache.c: Likewise.
5633 * search.c: Likewise.
5634 * sysdep.c: Likewise.
5635 * termcap.c: Likewise.
5636 * terminal.c: Likewise.
5637 * tparam.c: Likewise.
5638 * w16select.c: Likewise.
5639 * w32.c: Likewise.
5640 * w32reg.c: Likewise.
5641 * w32select.c: Likewise.
5642 * w32uniscribe.c: Likewise.
5643 * widget.c: Likewise.
5644 * xdisp.c: Likewise.
5645 * xmenu.c: Likewise.
5646 * xrdb.c: Likewise.
5647 * xselect.c: Likewise.
5648
5649 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5650
5651 * fileio.c (time_error_value): Check the right error number.
5652 Problem reported by Troels Nielsen in
5653 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5654
5655 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5656
5657 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5658 This should be fixed in a better way; see Eli Zaretskii in
5659 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5660 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5661
5662 * fileio.c (time_error_value): Rename from special_mtime.
5663 The old name's problems were noted by Eli Zaretskii in
5664 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5665
5666 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5667 This variable's comment says Emacs needs at least one GDB-visible
5668 symbol of type enum pvec_type, to work around GDB problems.
5669 The symbol's value doesn't matter.
5670
5671 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5672 that causes compilation to fail on pre-C99 compilers.
5673
5674 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
5675
5676 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5677 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5678
5679 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5680
5681 * buffer.c (init_buffer_once): Fix initialization of
5682 headers for buffer_defaults and buffer_local_symbols.
5683 Reported by Juanma Barranquero <lekktu@gmail.com>.
5684
5685 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5686
5687 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5688 * lisp.h (enum pvec_type): Use fewer bits.
5689 (PSEUDOVECTOR_SIZE_BITS): New constant.
5690 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5691 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5692 change in pvec_type.
5693 (PSEUDOVECTOR_TYPEP): New macro.
5694 (TYPED_PSEUDOVECTORP): Use it.
5695 * fns.c (internal_equal): Adapt code to extract pvectype.
5696 * emacs.c (gdb_pvec_type): Update type.
5697 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5698 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5699 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5700 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5701 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5702 abusing vector->header.next.nbytes.
5703 (live_vector_p): Use PVEC_TYPE.
5704 (mark_object): Adapt code to extract pvectype. Use switch.
5705
5706 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5707
5708 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5709 Tighten new eassert a bit.
5710
5711 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5712
5713 Fix compilation with --enable-gcc-warnings and -O1
5714 optimization level.
5715 * doprnt.c (doprnt): Change type of tem to int, initialize
5716 to avoid compiler warning. Add eassert.
5717 * search.c (simple_search): Initialize match_byte to avoid
5718 compiler warning. Add eassert.
5719
5720 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5721
5722 Avoid weird behavior with large horizontal scrolls.
5723 Without this change, for example, large hscroll values would
5724 mess up Emacs's display on Fedora 15 x86, presumably due to
5725 overflows in int calculations in the display code.
5726 Also, if buffers had long lines, Emacs would freeze.
5727 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5728 (set_window_hscroll): New function, containing the old guts of
5729 Fset_window_hscroll. Return the clipped value.
5730 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5731 This avoids the need to check against PTRDIFF_MAX.
5732
5733 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5734
5735 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5736
5737 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5738
5739 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5740
5741 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5742 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5743 since GCC 4.4.6 issues a bogus warning for them.
5744
5745 Fix bugs in file timestamp newness comparisons.
5746 * fileio.c (Ffile_newer_than_file_p):
5747 * lread.c (Fload): Use full timestamp resolution of files,
5748 not just the 1-second resolution, so that files that are only
5749 slightly newer still count as newer.
5750 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5751 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5752
5753 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5754
5755 * fileio.c: Improve handling of file time marker. (Bug#11852)
5756 (special_mtime): New function.
5757 (Finsert_file_contents, Fverify_visited_file_modtime):
5758 Use it to set special mtime values consistently.
5759
5760 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5761
5762 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5763 marker for non-existing file. (Bug#11852)
5764
5765 2012-07-03 Glenn Morris <rgm@gnu.org>
5766
5767 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5768 and did not make it into globals.h).
5769
5770 2012-07-03 Tom Tromey <tromey@redhat.com>
5771
5772 * window.c (Fset_window_margins, Fset_window_fringes)
5773 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5774 * textprop.c (Fprevious_property_change): No longer static.
5775 * syntax.c (Fsyntax_table_p): No longer static.
5776 * process.c (Fget_process, Fprocess_datagram_address): No longer
5777 static.
5778 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5779 * keyboard.c (Fcommand_execute): No longer static.
5780 Remove EXFUN.
5781 * insdel.c (Fcombine_after_change_execute): No longer static.
5782 * image.c (Finit_image_library): No longer static.
5783 * fileio.c (Fmake_symbolic_link): No longer static.
5784 * eval.c (Ffetch_bytecode): No longer static.
5785 * editfns.c (Fuser_full_name): No longer static.
5786 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5787 No longer static.
5788 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5789 static.
5790 * dired.c (Ffile_attributes): No longer static.
5791 * composite.c (Fcomposition_get_gstring): No longer static.
5792 * callproc.c (Fgetenv_internal): No longer static.
5793
5794 * ccl.h: Remove EXFUNs.
5795 * buffer.h: Remove EXFUNs.
5796 * dispextern.h: Remove EXFUNs.
5797 * intervals.h: Remove EXFUNs.
5798 * fontset.h: Remove EXFUN.
5799 * font.h: Remove EXFUNs.
5800 * dosfns.c (system_process_attributes): Remove EXFUN.
5801 * keymap.h: Remove EXFUNs.
5802 * lisp.h: Remove EXFUNs.
5803 * w32term.h: Remove EXFUNs.
5804 * window.h: Remove EXFUNs.
5805 * xsettings.h: Remove EXFUN.
5806 * xterm.h: Remove EXFUN.
5807
5808 2012-07-03 Glenn Morris <rgm@gnu.org>
5809
5810 * lisp.h (Frandom): Make it visible to C.
5811 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5812 buffer for invisible buffers. (Bug#1229)
5813
5814 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5815
5816 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5817 values which aren't power of 2.
5818 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5819 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5820 accordingly.
5821
5822 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5823
5824 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5825
5826 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5827
5828 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5829
5830 * alloc.c (allocate_vector_block): Remove redundant
5831 calls to mallopt if DOUG_LEA_MALLOC is defined.
5832 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5833 avoid calls to mallopt if zero_vector is returned.
5834
5835 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5836
5837 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5838 is enabled, avoid dereferencing NULL current_sblock if
5839 running undumped.
5840
5841 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5842
5843 Cleanup basic buffer management.
5844 * buffer.h (struct buffer): Change layout to use generic vector
5845 marking code. Fix some comments. Change type of 'clip_changed'
5846 to bitfield. Remove unused #ifndef old.
5847 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5848 (GET_OVERLAYS_AT): Fix indentation.
5849 (for_each_per_buffer_object_at): New macro.
5850 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5851 (Fbuffer_local_variables): Use it.
5852 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5853 * alloc.c (allocate_buffer): Adjust to match new layout of
5854 struct buffer. Fix comment.
5855 (mark_overlay): New function.
5856 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5857 Lisp area of struct buffer.
5858 (mark_object): Use it. Adjust marking of misc objects
5859 and related comments.
5860
5861 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5862
5863 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5864 wrapper that is not needed because the wrapped code is a no-op (zero
5865 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5866 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5867
5868 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5869
5870 * alloc.c (mark_buffer): Simplify. Remove prototype.
5871 (mark_object): Add comment. Reorganize marking of vector-like
5872 objects. Use CHECK_LIVE for all vector-like objects except buffers
5873 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5874 Avoid redundant calls to mark_vectorlike for bool vectors.
5875
5876 2012-06-30 Glenn Morris <rgm@gnu.org>
5877
5878 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5879
5880 * epaths.in (PATH_SITELOADSEARCH): New.
5881 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5882 This is rather than relying on --enable-locallisppath elements
5883 having "site-lisp" in their names. (Bug#10208#25, 11658)
5884
5885 2012-06-30 Eli Zaretskii <eliz@gnu.org>
5886
5887 * w32proc.c (sys_select): Accept and ignore one more argument.
5888
5889 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5890
5891 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5892 (pselect) [!MS_DOS]: Redirect to sys_select.
5893
5894 * sysdep.c: Don't include dos.h and dosfns.h.
5895
5896 * process.c (sys_select):
5897 * msdos.c (sys_select): Accept one more argument and ignore it.
5898
5899 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5900 adapt data types and code to that.
5901
5902 * dosfns.c:
5903 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5904 which clashes with the gnulib function of the same name.
5905
5906 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5907
5908 * font.c (font_style_to_value, font_style_symbolic)
5909 (font_prop_validate_style): Add type checks for values in
5910 font_style_table.
5911
5912 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5913 argument.
5914 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5915 uses.
5916
5917 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5918
5919 * xdisp.c (try_window_id): Undo last change.
5920
5921 * w32.c (getwd): Adjust commentary about startup_dir.
5922 (init_environment): Always call sys_access, even in non-MSVC
5923 builds. Don't chdir to the directory of the Emacs executable.
5924 This undoes code from 1997 which was justified by the need to
5925 "avoid conflicts when removing and renaming directories". But its
5926 downside was that every relative file name was being interpreted
5927 relative to the directory of the Emacs executable, which can never
5928 be TRT. In particular, it broke sys_access when called with
5929 relative file names.
5930 (sys_access): Map GetLastError to errno.
5931
5932 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5933
5934 * window.h (struct window): Change type of 'fringes_outside_margins'
5935 to bitfield. Fix comment. Adjust users accordingly.
5936 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5937 Adjust comment.
5938 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5939 to ptrdiff_t.
5940
5941 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5942
5943 * gnutls.c (emacs_gnutls_handshake):
5944 Add QUIT to make the loop interruptible.
5945
5946 2012-06-29 Glenn Morris <rgm@gnu.org>
5947
5948 * charset.c (init_charset): Make lack of etc/charsets fatal.
5949
5950 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5951
5952 * editfns.c (region_limit): Fix type mismatch.
5953
5954 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5955
5956 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5957 undefined. Convert from xassert to eassert.
5958 * nsmenu.m: Convert from xassert to eassert.
5959 * nsterm.m: Likewise.
5960
5961 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5962
5963 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5964
5965 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5966
5967 Avoid integer overflow on scroll-left and scroll-right.
5968 * window.c (HSCROLL_MAX): New macro.
5969 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5970 overflow when requested scroll falls outside ptrdiff_t range.
5971
5972 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5973
5974 * window.h (struct window): Change type of 'hscroll',
5975 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5976 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5977 Adjust users accordingly.
5978 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5979 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5980 from EMACS_INT to ptrdiff_t.
5981 (make_window): Omit redundant initialization.
5982
5983 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5984
5985 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5986
5987 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5988
5989 * window.h (struct window): Change type of 'use_time' and
5990 'sequence_number' from Lisp_Object to int.
5991 * frame.c (make_frame): Adjust users accordingly.
5992 * print.c (print_object): Likewise.
5993 * window.c (select_window, Fwindow_use_time, make_parent_window)
5994 (make_window): Likewise.
5995
5996 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5997
5998 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5999 enabled with --enable-checking=[all,glyphs] configure option.
6000 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6001 adjust comments accordingly.
6002 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6003 undefined, adjust comments accordingly.
6004 * image.c: Likewise.
6005 * scroll.c: Likewise.
6006 * w32fns.c: Likewise.
6007 * w32term.c: Likewise.
6008 * xdisp.c: Likewise.
6009 * xfaces.c: Likewise.
6010 * xfns.c: Likewise.
6011 * xterm.c: Likewise.
6012
6013 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6014
6015 Generalize run-time debugging checks.
6016 * dispextern.h (XASSERTS): Remove.
6017 * fontset.c (xassert): Remove.
6018 Convert from xassert to eassert.
6019 * alloc.c: Convert from xassert to eassert.
6020 * bidi.c: Likewise.
6021 * dispnew.c: Likewise.
6022 * fns.c: Likewise.
6023 * fringe.c: Likewise.
6024 * ftfont.c: Likewise.
6025 * gtkutil.c: Likewise.
6026 * image.c: Likewise.
6027 * keyboard.c: Likewise.
6028 * menu.c: Likewise.
6029 * process.c: Likewise.
6030 * scroll.c: Likewise.
6031 * sound.c: Likewise.
6032 * term.c: Likewise.
6033 * w32console.c: Likewise.
6034 * w32fns.c: Likewise.
6035 * w32term.c: Likewise.
6036 * window.c: Likewise.
6037 * xdisp.c: Likewise.
6038 * xfaces.c: Likewise.
6039 * xfns.c: Likewise.
6040 * xselect.c: Likewise.
6041 * xterm.c: Likewise.
6042
6043 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6044
6045 * fns.c (maybe_resize_hash_table): Output message when growing the
6046 purify-hashtable.
6047
6048 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6049
6050 * alloc.c (allocate_string_data): Remove dead code.
6051 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6052 avoid GCC warning about unused macro.
6053
6054 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6055
6056 * alloc.c (allocate_string): Omit intervals initialization.
6057 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6058 as in make_pure_string and make_pure_c_string.
6059
6060 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6061
6062 * alloc.c (allocate_string): Fix last change.
6063
6064 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6065
6066 * alloc.c (allocate_string): Remove two redundant calls
6067 to memset, add explicit initialization where appropriate.
6068
6069 2012-06-27 Glenn Morris <rgm@gnu.org>
6070
6071 * lisp.mk (lisp): Remove paths.elc.
6072
6073 2012-06-27 Chong Yidong <cyd@gnu.org>
6074
6075 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6076
6077 2012-06-26 John Wiegley <johnw@newartisans.com>
6078
6079 * unexmacosx.c (copy_data_segment): Add two section names used
6080 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6081
6082 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6083 when building with Clang.
6084
6085 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6086
6087 * eval.c (Fapply): Allow calling it with a single argument.
6088
6089 2012-06-26 Eli Zaretskii <eliz@gnu.org>
6090
6091 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6092 _stricmp and _strnicmp.
6093 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6094
6095 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6096
6097 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6098 allocated window.
6099 (allocate_process): Likewise for new process.
6100 (allocate_terminal): Change to use offsetof.
6101 (allocate_frame): Likewise.
6102 * frame.c (make_frame): Omit redundant initialization.
6103 * window.c (make_parent_window): Use memset.
6104 (make_window): Omit redundant initialization.
6105 * process.c (make_process): Omit redundant initialization.
6106 * terminal.c (create_terminal): Likewise.
6107
6108 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6109
6110 * term.c (delete_tty): Remove redundant call to memset.
6111
6112 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6113
6114 * alloc.c: Remove build_string.
6115 * lisp.h: Define build_string as static inline. This provides
6116 a better opportunity to optimize away calls to strlen when the
6117 function is called with compile-time constant argument.
6118 * image.c (imagemagick_error): Convert to build_string.
6119 * w32proc.c (sys_spawnve): Likewise.
6120 * xterm.c (x_term_init): Likewise.
6121
6122 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6123
6124 Use sprintf return value instead of invoking strlen on result.
6125 In the old days this wasn't portable, since some sprintf
6126 implementations returned char *. But they died out years ago and
6127 Emacs already assumes sprintf returns int.
6128 Similarly for float_to_string.
6129 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6130 * ccl.c (ccl_driver):
6131 * character.c (string_escape_byte8):
6132 * data.c (Fnumber_to_string):
6133 * doprnt.c (doprnt):
6134 * print.c (print_object):
6135 * xdisp.c (message_dolog):
6136 * xfns.c (syms_of_xfns):
6137 Use sprintf or float_to_string result to avoid need to call strlen.
6138 * data.c (Fnumber_to_string):
6139 Use make_unibyte_string, since the string must be ASCII.
6140 * lisp.h, print.c (float_to_string): Now returns int length.
6141 * term.c (produce_glyphless_glyph):
6142 Use sprintf result rather than recomputing it.
6143
6144 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6145 * Makefile.in (ALL_CFLAGS):
6146 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6147 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6148
6149 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6150
6151 * dispextern.h (xstrcasecmp): Define to library function
6152 strcasecmp if available.
6153 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6154
6155 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6156
6157 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6158 Avoid comma operator.
6159 * menu.c (push_submenu_start, push_submenu_end)
6160 (push_left_right_boundary, push_menu_pane): Likewise.
6161 * msdos.c (dos_rawgetc): Likewise.
6162
6163 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6164
6165 * xfns.c (xic_create_fontsetname): Remove redundant calls
6166 to memset.
6167
6168 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6169
6170 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6171 sprintf already null-terminates its output.
6172
6173 * xfns.c (x_window): Remove redundant cast.
6174
6175 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6176
6177 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6178 `const char *' to `char *' to avoid compiler warning.
6179
6180 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6181
6182 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6183 instead of truncating it to 63 (admittedly a generous limit).
6184
6185 * process.c: Fix spelling and caps in comments.
6186
6187 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6188
6189 * emacs.c (setpgrp): Remove definition, unused.
6190 * sysdep.c (setpgrp): Remove definition, not used in this file.
6191
6192 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
6193
6194 * makefile.w32-in: Update dependencies.
6195
6196 2012-06-24 Eli Zaretskii <eliz@gnu.org>
6197
6198 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6199 (SYSTIME_H): Add nt/inc/sys/time.h.
6200
6201 * systime.h [WINDOWSNT]: Include sys/time.h.
6202
6203 * s/ms-w32.h (struct timespec): Definition moved from
6204 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6205
6206 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6207
6208 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6209 * buffer.h (buffer_slot_type_mismatch):
6210 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6211 * eval.c (unwind_to_catch):
6212 * image.c (my_png_error, my_error_exit):
6213 * keyboard.c (quit_throw_to_read_char, user_error)
6214 (Fexit_recursive_edit, Fabort_recursive_edit):
6215 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6216 (wrong_type_argument, buffer_overflow, __executable_start)
6217 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6218 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6219 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6220 (fatal):
6221 (child_setup) [!DOS_NT]:
6222 * lread.c (end_of_file_error, invalid_syntax):
6223 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6224 * puresize.h (pure_write_error):
6225 * search.c (matcher_overflow):
6226 * sound.c (sound_perror, alsa_sound_perror):
6227 * sysdep.c, syssignal.h (croak):
6228 * term.c (maybe_fatal, vfatal):
6229 * textprop.c (text_read_only):
6230 * undo.c (user_error):
6231 * unexmacosx.c (unexec_error):
6232 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6233 Use _Noreturn rather than NO_RETURN.
6234 No need for separate decl merely because of _Noreturn.
6235 * sound.c (sound_warning, parse_sound):
6236 Remove unnecessary forward decls.
6237
6238 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6239
6240 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6241 * lisp.h (WAIT_READING_MAX): New macro.
6242 * dispnew.c (Fsleep_for, sit_for):
6243 * keyboard.c (kbd_buffer_get_event):
6244 * process.c (Faccept_process_output):
6245 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6246 This improves on the previous patch, which introduced a bug
6247 when time_t is unsigned and as wide as intmax_t.
6248 See <http://bugs.gnu.org/9000#51>.
6249
6250 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6251
6252 * dispnew.c (sit_for, Fsleep_for):
6253 * keyboard.c (kbd_buffer_get_event):
6254 * process.c (Faccept_process_output): Avoid compiler warnings when
6255 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6256
6257 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
6258
6259 * makefile.w32-in: Update dependencies.
6260
6261 * w32.c (ltime): Add return type and declare static.
6262 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6263
6264 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6265
6266 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6267 Privately reported by Herbert J. Skuhra.
6268 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6269 All uses changed.
6270 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6271 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6272
6273 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6274
6275 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6276 last argument of make_unibyte_string.
6277
6278 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6279 language ID in the event parameters.
6280
6281 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6282 event.code, not the obscure "character set ID".
6283
6284 2012-06-23 Chong Yidong <cyd@gnu.org>
6285
6286 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6287
6288 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6289
6290 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6291 * w32.c (fdutimens): New function.
6292
6293 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6294
6295 * s/ms-w32.h (pselect): Redirect to sys_select.
6296
6297 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6298
6299 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6300 in the logic of incrementing and decrementing the value of
6301 use_relocatable_buffers.
6302
6303 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6304
6305 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6306 Privately reported by Herbert J. Skuhra.
6307 [__FreeBSD__]: Remove "*/" typo after "#include".
6308 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6309 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6310 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6311 Don't assume EMACS_TIME and struct timeval are the same type.
6312
6313 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6314
6315 Support higher-resolution time stamps (Bug#9000).
6316 The time stamps are only nanosecond-resolution at the C level,
6317 since that's the best that any real-world system supports now.
6318 But they are picosecond-resolution at the Lisp level, as that's
6319 easy, and leaves room for future OS improvements.
6320
6321 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6322 (LIBES): Use it.
6323
6324 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6325 Don't get current time unless it's needed.
6326
6327 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6328 now provides it if it's absent.
6329 (start_atimer): Port to higher-res time stamps.
6330 Check for time stamp overflow. Don't get current time more
6331 often than is needed.
6332
6333 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6334 Include systime.h, not time.h.
6335 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6336
6337 * dired.c: Include stat-time.h.
6338 (Ffile-attributes): File times now have higher resolution.
6339
6340 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6341 (struct image): Timestamp now has higher resolution.
6342
6343 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6344 has at least microseconds now. All uses removed.
6345 (update_frame, update_single_window, update_window, update_frame_1)
6346 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
6347 (duration_to_sec_usec): Remove; no longer needed.
6348
6349 * editfns.c (time_overflow): Now extern.
6350 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6351 (float-time, Fformat_time_string, Fcurrent_time_string)
6352 (Fcurrent_time_zone): Accept and generate higher-resolution
6353 time stamps.
6354 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6355 (decode_time_components, lisp_seconds_argument): New functions.
6356 (make_time): Now static.
6357 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6358 Report an error if the time is invalid, rather than having the caller
6359 do that.
6360
6361 * fileio.c: Include <stat-time.h>
6362 (Fcopy_file): Copy higher-resolution time stamps.
6363 Prefer to set the time stamp via a file descriptor if that works.
6364 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6365 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6366 (Fvisited_file_modtime, Fset_visited_file_modtime):
6367 Support higher-resolution time stamps.
6368
6369 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6370
6371 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6372
6373 * image.c (prepare_image_for_display, clear_image_cache)
6374 (lookup_image): Port to higer-resolution time stamps.
6375
6376 * keyboard.c (start_polling, bind_polling_period):
6377 Check for time stamp overflow.
6378 (read_char, kbd_buffer_get_event, timer_start_idle)
6379 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6380 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6381 Port to higher-resolution time stamps. Do not assume time_t is signed.
6382 (decode_timer): New function. Timers are now vectors of length 9,
6383 not 8, to accommodate the picosecond component.
6384 (timer_check_2): Use it.
6385
6386 * nsterm.m (select_timeout, timeval_subtract): Remove.
6387 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6388 as they're a bit more accurate and handle overflow better.
6389 (ns_select): Change prototype to be compatible with pselect.
6390 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6391 * nsterm.h (ns_select): Adjust prototype.
6392
6393 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6394 us-resolution time stamps.
6395 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6396
6397 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6398
6399 * lisp.h (time_overflow): New decl.
6400 (wait_reading_process_output): First arg is now intmax_t, not int,
6401 to accommodate larger waits.
6402
6403 * process.h (struct Lisp_Process.read_output_delay):
6404 Now counts nanoseconds, not microseconds.
6405 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6406 EMACS_HAS_USECS.
6407 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6408 (wait_reading_process_output):
6409 Port to ns-resolution time stamps.
6410 (Faccept_process_output, wait_reading_process_output):
6411 Check for time stamp overflow. Do not assume time_t is signed.
6412 (select_wrapper): Remove; we now use pselect.
6413 (Fprocess_attributes): Now generates ns-resolution time stamps.
6414
6415 * sysdep.c: Include utimens.h. Don't include utime.h
6416 or worry about struct utimbuf; gnulib does that for us now.
6417 (gettimeofday): Remove; gnulib provides a substitute.
6418 (make_timeval): New function.
6419 (set_file_times): Now sets ns-resolution time stamps.
6420 New arg FD; all uses changed.
6421 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6422 (system_process_attributes):
6423 Now returns ns-resolution time stamp. All uses changed.
6424 Check for time stamp overflow.
6425
6426 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6427 provides a substitute now.
6428
6429 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6430 since it guarantees struct timespec.
6431 (EMACS_TIME): Now struct timespec, so that we can support
6432 ns-resolution time stamps.
6433 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6434 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6435 (EMACS_USECS): Remove.
6436 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6437 so multiply the arg by 1000 before storing it.
6438 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6439 New macros.
6440 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6441 Port to ns-resolution time stamps.
6442 (EMACS_TIME_NEG_P): Remove; replaced by....
6443 (EMACS_TIME_SIGN): New macro.
6444 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6445 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6446 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6447 (make_timeval, make_lisp_time, decode_time_components): New decls.
6448 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6449 that it mishandled time_t overflow. You can't compare by subtracting!
6450 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6451 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6452
6453 * term.c: Include <sys/time.h>.
6454 (timeval_to_Time): New function, for proper overflow wraparound.
6455 (term_mouse_position, term_mouse_click): Use it.
6456
6457 * undo.c (record_first_change): Support higher-resolution time stamps
6458 in the undo buffer.
6459 (Fprimitive_undo): Use them when restoring time stamps.
6460
6461 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6462 (w32_get_internal_run_time):
6463 Port to higher-resolution Emacs time stamps.
6464 (ltime): Now accepts single 64-bit integer, as that's more convenient
6465 for callers.
6466
6467 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6468
6469 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6470 for compatibility with pselect. Support ns-resolution time stamps.
6471
6472 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6473
6474 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6475 Check for time stamp overflow, and support ns-resolution time stamps.
6476
6477 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6478 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6479 (timeval_subtract): Remove; no longer needed.
6480 (XTflash, XTring_bell, x_wait_for_event):
6481 Port to ns-resolution time stamps. Don't assume time_t is signed.
6482
6483 2012-06-22 Chong Yidong <cyd@gnu.org>
6484
6485 * xdisp.c (x_consider_frame_title): Revert last change.
6486
6487 2012-06-22 Eli Zaretskii <eliz@gnu.org>
6488
6489 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6490 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6491 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6492 staticidx goes up to 1597 out of 1600 = 0x640.)
6493
6494 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6495
6496 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6497 Otherwise, the umask might be mistakenly 0 while handling input signals.
6498
6499 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6500
6501 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6502
6503 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6504
6505 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6506 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6507 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6508 access to `contents' member of Lisp_Vector objects with AREF and ASET
6509 where appropriate.
6510
6511 2012-06-19 Chong Yidong <cyd@gnu.org>
6512
6513 * frame.c (delete_frame): When selecting a frame on a different
6514 text terminal, do not alter the terminal's top-frame.
6515
6516 * xdisp.c (format_mode_line_unwind_data): Record the target
6517 frame's selected window and its terminal's top-frame.
6518 (unwind_format_mode_line): Restore them.
6519 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6520 Callers changed.
6521 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6522 since tty frames can be explicitly named.
6523 (prepare_menu_bars): Likewise.
6524
6525 * term.c (Ftty_top_frame): New function.
6526
6527 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6528
6529 Port byte-code-meter to modern targets.
6530 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6531 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6532 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6533 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6534 (METER_1, METER_2): Simplify.
6535
6536 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6537
6538 * data.c (Fdefalias): Return `symbol' (bug#11686).
6539
6540 2012-06-18 Martin Rudalics <rudalics@gmx.at>
6541
6542 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6543 gets killed during executing of this function (Bug#11665).
6544 Try to always return Qt when the buffer has been actually killed.
6545 (Vkill_buffer_query_functions): In doc-string say that functions
6546 run by this hook should not change the current buffer.
6547
6548 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6549
6550 Fix recently-introduced process.c problems found by static checking.
6551 * process.c (write_queue_push, write_queue_pop, send_process):
6552 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6553 (write_queue_pop): Fix pointer signedness problem.
6554 (send_process): Remove unused local.
6555
6556 2012-06-17 Chong Yidong <cyd@gnu.org>
6557
6558 * xdisp.c (redisplay_internal): No need to redisplay terminal
6559 frames that are not on top.
6560
6561 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
6562
6563 * process.c (make_process): Initialize write_queue.
6564 (write_queue_push, write_queue_pop): New functions.
6565 (send_process): Use them to maintain correct ordering of process
6566 writes (Bug#10815).
6567
6568 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6569
6570 * lisp.h (eassert): Assume C89 or later.
6571 This removes the need for CHECK.
6572 (CHECK): Remove. Its comments about always evaluating its
6573 argument were confusing, as 'eassert' typically does not evaluate
6574 its argument.
6575
6576 * coding.c (produce_chars): Use ptrdiff_t, not int.
6577
6578 * xterm.c (x_draw_underwave): Check for integer overflow.
6579 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6580
6581 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
6582
6583 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6584 referenced (Bug#11583).
6585
6586 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6587
6588 Implement wave-style variant of underlining.
6589 * dispextern.h (face_underline_type): New enum.
6590 (face): Add field for underline type.
6591 * nsterm.m (ns_draw_underwave): New function.
6592 (ns_draw_text_decoration): Use it.
6593 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6594 New functions.
6595 (x_draw_glyph_string): Use them.
6596 * xfaces.c (Qline, Qwave): New Lisp objects.
6597 (check_lface_attrs, merge_face_ref)
6598 (Finternal_set_lisp_face_attribute, realize_x_face):
6599 Handle wave-style underline face attributes.
6600 * xterm.c (x_draw_underwave): New function.
6601 (x_draw_glyph_string): Use it.
6602
6603 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
6604
6605 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6606 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6607 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6608 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6609 ($(BLD)/w32select.$(O)): Update dependencies.
6610
6611 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6612
6613 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6614 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6615 * character.c (_fetch_multibyte_char_p): Remove.
6616 * alloc.c: Include "character.h" before "buffer.h".
6617 * bidi.c: Likewise.
6618 * buffer.c: Likewise.
6619 * bytecode.c: Likewise.
6620 * callint.c: Likewise.
6621 * callproc.c: Likewise.
6622 * casefiddle.c: Likewise.
6623 * casetab.c: Likewise.
6624 * category.c: Likewise.
6625 * cmds.c: Likewise.
6626 * coding.c: Likewise.
6627 * composite.c: Likewise.
6628 * dired.c: Likewise.
6629 * dispnew.c: Likewise.
6630 * doc.c: Likewise.
6631 * dosfns.c: Likewise.
6632 * editfns.c: Likewise.
6633 * emacs.c: Likewise.
6634 * fileio.c: Likewise.
6635 * filelock.c: Likewise.
6636 * font.c: Likewise.
6637 * fontset.c: Likewise.
6638 * fringe.c: Likewise.
6639 * indent.c: Likewise.
6640 * insdel.c: Likewise.
6641 * intervals.c: Likewise.
6642 * keyboard.c: Likewise.
6643 * keymap.c: Likewise.
6644 * lread.c: Likewise.
6645 * macros.c: Likewise.
6646 * marker.c: Likewise.
6647 * minibuf.c: Likewise.
6648 * nsfns.m: Likewise.
6649 * nsmenu.m: Likewise.
6650 * print.c: Likewise.
6651 * process.c: Likewise.
6652 * regex.c: Likewise.
6653 * region-cache.c: Likewise.
6654 * search.c: Likewise.
6655 * syntax.c: Likewise.
6656 * term.c: Likewise.
6657 * textprop.c: Likewise.
6658 * undo.c: Likewise.
6659 * unexsol.c: Likewise.
6660 * w16select.c: Likewise.
6661 * w32fns.c: Likewise.
6662 * w32menu.c: Likewise.
6663 * window.c: Likewise.
6664 * xdisp.c: Likewise.
6665 * xfns.c: Likewise.
6666 * xmenu.c: Likewise.
6667 * xml.c: Likewise.
6668 * xselect.c: Likewise.
6669
6670 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6671
6672 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6673 If all the glyphs of the glyph row came from strings, and we have no
6674 cursor positioning clues, put the cursor on the first glyph of the
6675 row.
6676 (handle_face_prop): Use chunk-relative overlay string index when
6677 indexing into it->string_overlays array. (Bug#11653)
6678 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6679 the rightmost. (Bug#11720)
6680
6681 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6682
6683 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6684 (CATEGORY_MEMBER): Enforce 1/0 value.
6685 * category.c (_temp_category_set): Remove.
6686
6687 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6688
6689 * window.c (Fdelete_other_windows_internal)
6690 (Fdelete_window_internal): Don't access frame's mouse highlight
6691 info of the initial frame. (Bug#11677)
6692
6693 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6694
6695 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6696 Assume USE_2_TAGS_FOR_INTS.
6697 (xreload): Adjust $tagmask width to match recent lisp.h change.
6698
6699 Simplify lisp.h in minor ways that should not affect code.
6700 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6701 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6702 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6703 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6704 (INTTYPEBITS): New macro, for clarity.
6705 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6706 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6707 Simplify now that USE_LSB_TAG is always defined.
6708 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6709 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6710
6711 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
6712
6713 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6714
6715 2012-06-13 Glenn Morris <rgm@gnu.org>
6716
6717 * s/bsd-common.h (BSD4_3):
6718 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6719
6720 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6721
6722 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6723 instead of union.
6724 (XLI, XIL): Define.
6725 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6726 Use them.
6727 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6728 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6729 * alloc.c (widen_to_Lisp_Object): Remove.
6730 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6731 * frame.c (delete_frame): Remove outdated comment.
6732 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6733 USE_LISP_UNION_TYPE.
6734 (Fw32_unregister_hot_key): Likewise.
6735 (Fw32_toggle_lock_key): Likewise.
6736 * w32menu.c (add_menu_item): Likewise.
6737 (w32_menu_display_help): Use XIL instead of checking
6738 USE_LISP_UNION_TYPE.
6739 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6740 (init_heap): Likewise.
6741 * w32term.c (w32_read_socket): Update comment.
6742
6743 2012-06-13 Glenn Morris <rgm@gnu.org>
6744
6745 * s/usg5-4-common.h, src/s/unixware.h:
6746 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6747
6748 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6749
6750 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6751
6752 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6753 * alloc.c (make_number) [!defined make_number]:
6754 Remove, as lisp.h always defines this now.
6755 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6756 (roundup_size): Verify that it is a power of 2.
6757 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6758 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6759 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6760 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6761 USE_LSB_TAG now is always defined to be either 0 or 1.
6762 All uses changed.
6763 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6764 code works fine either way, and efficiency is not a concern here,
6765 as the union type is for debugging, not for production.
6766 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6767 Use an inline function on all platforms when using the union type,
6768 since this is simpler and 'static inline' can be used portably
6769 within Emacs now.
6770 (LISP_INITIALLY_ZERO): New macro.
6771 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6772 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6773
6774 2012-06-12 Glenn Morris <rgm@gnu.org>
6775
6776 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6777
6778 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6779
6780 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6781 Move BROKEN_SIGIO to configure.
6782
6783 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6784 Move NO_TERMIO to configure.
6785
6786 2012-06-12 Chong Yidong <cyd@gnu.org>
6787
6788 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6789 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6790 MagickExportImagePixels is undefined.
6791
6792 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6793
6794 * image.c (imagemagick_load_image): Remove unused label.
6795
6796 2012-06-11 Glenn Morris <rgm@gnu.org>
6797
6798 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6799 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6800 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6801 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6802
6803 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6804
6805 * alloc.c (make_byte_code): New function.
6806 (Fmake_byte_code): Use it. Don't purify here.
6807 * lread.c (read1): Use it as well to avoid extra allocation.
6808
6809 2012-06-11 Chong Yidong <cyd@gnu.org>
6810
6811 * image.c (imagemagick_load_image): Implement transparency.
6812
6813 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6814
6815 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6816 account for preceding backslashes. (Bug#11663)
6817
6818 2012-06-09 Chong Yidong <cyd@gnu.org>
6819
6820 * term.c: Support italics in capable terminals (Bug#9652).
6821 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6822 (turn_on_face): Output using TS_enter_italic_mode if available.
6823 Don't handle unused blinking and alt-charset cases.
6824 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6825 and tty_alt_charset_p cases.
6826 (tty_capable_p, init_tty): Support italics.
6827
6828 * termchar.h (struct tty_display_info): Add field for italics.
6829 Remove unused blink field.
6830
6831 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6832 Handle slant.
6833
6834 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6835 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6836 tty_alt_charset_p. Add tty_italic_p.
6837
6838 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
6839
6840 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6841 dbus_type_is_basic if available.
6842 (xd_extract_signed, xd_extract_unsigned): Rename from
6843 extract_signed and extract_unsigned, respectively. Adapt callers.
6844
6845 2012-06-09 Chong Yidong <cyd@gnu.org>
6846
6847 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6848
6849 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6850 case (Bug#9752).
6851
6852 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6853
6854 * xdisp.c (vmessage): Treat frame message as multibyte.
6855 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6856 would generate the diagnostic "Making \302\247 buffer-local while
6857 let-bound!".
6858
6859 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6860
6861 * dispnew.c (showing_window_margins_p): Undo last change, which
6862 was done due to an inadvertent commit.
6863 (adjust_frame_glyphs_for_frame_redisplay): Do call
6864 showing_window_margins_p.
6865
6866 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6867
6868 * eval.c (Fmake_var_non_special): New primitive.
6869 (syms_of_eval): Defsubr it.
6870 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6871
6872 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
6873
6874 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6875 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6876
6877 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6878
6879 * alloc.c (allocate_vectorlike): Fix last change.
6880
6881 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6882
6883 Block-based vector allocation of small vectors.
6884 * lisp.h (struct vectorlike_header): New field `nbytes',
6885 adjust comment accordingly.
6886 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6887 to denote vector blocks. Adjust users (live_vector_p,
6888 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6889 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6890 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6891 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6892 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6893 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6894 (roundup_size): New constant.
6895 (struct vector_block): New data type.
6896 (vector_blocks, vector_free_lists, zero_vector): New variables.
6897 (all_vectors): Rename to `large_vectors'.
6898 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6899 (sweep_vectors): New functions.
6900 (allocate_vectorlike): Return `zero_vector' as the only vector of
6901 0 items. Allocate new vector from block if vector size is less than
6902 or equal to VBLOCK_BYTES_MAX.
6903 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6904 (init_alloc_once): Add call to init_vectors.
6905
6906 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6907
6908 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6909
6910 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6911
6912 * doprnt.c (doprnt): Truncate multibyte char correctly.
6913 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6914 would mishandle a string argument "Xc" if X was a multibyte
6915 character of length 2: it would truncate after X's first byte
6916 rather than including all of X.
6917
6918 2012-06-06 Chong Yidong <cyd@gnu.org>
6919
6920 * buffer.c (word_wrap): Doc fix.
6921
6922 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6923
6924 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6925
6926 2012-06-03 Glenn Morris <rgm@gnu.org>
6927
6928 * xdisp.c (tool-bar-style): Doc fix.
6929
6930 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6931
6932 * Makefile.in (PAXCTL): Define.
6933 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6934 binary via PaX flags if the paxctl utility is available.
6935 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6936 Restore PaX flags to their default. (Bug#11398)
6937
6938 2012-06-03 Chong Yidong <cyd@gnu.org>
6939
6940 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6941 buffer (Bug#11226).
6942
6943 2012-06-03 Chong Yidong <cyd@gnu.org>
6944
6945 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6946 (note_mode_line_or_margin_highlight): If there is no help echo,
6947 use mode-line-default-help-echo. Handle the case where the mouse
6948 position is past the end of the mode line string.
6949
6950 * buffer.c (buffer_local_value_1): New function, split from
6951 Fbuffer_local_value; can return Qunbound.
6952 (Fbuffer_local_value): Use it.
6953 (Vmode_line_format): Docstring tweaks.
6954
6955 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6956
6957 * sysdep.c (system_process_attributes): Improve comment.
6958
6959 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6960
6961 * keyboard.c: Export real-this-command to Elisp.
6962 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6963 and DEFVAR it. Update all users.
6964
6965 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6966
6967 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6968
6969 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6970 Convert pctcpu and pctmem to Lisp float properly.
6971 Let the compiler fold better, as 100.0/0x8000 is exact.
6972
6973 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6974
6975 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6976 cons_block.
6977
6978 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6979
6980 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6981
6982 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6983
6984 For a 'struct window', replace some Lisp_Object fields to
6985 bitfields where appropriate, remove unused fields.
6986 * window.h (struct window): Remove unused 'last_mark_x' and
6987 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6988 change it's type from Lisp_Object to bitfield.
6989 Change type of 'force_start', 'optional_new_start',
6990 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6991 fields from Lisp_Object to bitfield. Adjust users accordingly.
6992
6993 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6994
6995 Pacify gcc -Wdouble-precision when using Xaw.
6996 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6997 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6998 Use 'float' consistently, rather than 'float' in most places
6999 and 'double' in a couple of places.
7000
7001 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7002
7003 * xdisp.c (handle_stop): Detect whether we have overlay strings
7004 loaded by testing it->current.overlay_string_index to be
7005 non-negative, instead of checking whether n_overlay_strings is
7006 positive. (Bug#11587)
7007
7008 2012-05-31 Chong Yidong <cyd@gnu.org>
7009
7010 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7011
7012 * doc.c (Fsubstitute_command_keys): Doc fix.
7013
7014 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7015
7016 * search.c (search_buffer): Remove calls to
7017 r_alloc_inhibit_buffer_relocation, as it is now called by
7018 maybe_unify_char, which was the cause of relocation of buffer text
7019 in bug#11519.
7020
7021 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7022
7023 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7024 for the duration of call to load_charset, to avoid problems with
7025 callers of maybe_unify_char that access buffer text through C
7026 pointers.
7027
7028 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7029 decrement the inhibition flag, instead of just setting or
7030 resetting it.
7031
7032 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7033
7034 Remove obsolete '#define static' cruft.
7035 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7036 This #undef was "temporary" in 2000; it is no longer needed
7037 now that '#define static' has gone away.
7038 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7039 (gray_bitmap_bits): Remove; no longer needed.
7040 All uses replaced with definiens.
7041 * xterm.c: Include "bitmaps/gray.xbm".
7042
7043 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7044
7045 Clean up __executable_start, monstartup when --enable-profiling.
7046 The following changes affect the code only when profiling.
7047 * dispnew.c (__executable_start): Rename from safe_bcopy.
7048 Define only on platforms that need it.
7049 * emacs.c: Include <sys/gmon.h> when profiling.
7050 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7051 (__executable_start): Remove decl, since lisp.h does it now.
7052 (safe_bcopy): Remove decl; no longer has that name.
7053 (main): Coalesce #if into single bit of code, for simplicity.
7054 Cast pointers to uintptr_t, since standard libraries want integers
7055 and not pointers.
7056 * lisp.h (__executable_start): New decl.
7057
7058 2012-05-31 Glenn Morris <rgm@gnu.org>
7059
7060 * image.c (Fimagemagick_types): Doc fix.
7061
7062 2012-05-30 Jim Meyering <meyering@redhat.com>
7063
7064 * callproc.c (Fcall_process_region): Include directory component
7065 in mkstemp error message (Bug#11586).
7066
7067 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7068
7069 * alloc.c, lisp.h (make_pure_vector): Now static.
7070
7071 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7072
7073 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7074 Move to byte-run.el.
7075 (Fautoload): Do the hash-doc more carefully.
7076 * data.c (Fdefalias): Purify definition, except for keymaps.
7077 (Qdefun): Move from eval.c.
7078 * lisp.h (Qdefun): Remove.
7079 * lread.c (read1): Tiny simplification.
7080
7081 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
7082
7083 Do not create empty overlays with the evaporate property (Bug#9642).
7084 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7085 Bug#9642, but explicitly check that the buffer the overlay would
7086 be moved to is live and rearrange lines to make sure that errors
7087 will not put the overlay in an inconsistent state.
7088 (Fdelete_overlay): Cosmetics.
7089
7090 2012-05-28 Eli Zaretskii <eliz@gnu.org>
7091
7092 * w32term.c (my_bring_window_to_top): New function.
7093 (x_raise_frame): Use handle returned by DeferWindowPos, which
7094 could be different from the original one.
7095 Call my_bring_window_to_top instead of my_set_foreground_window.
7096 (Bug#11513)
7097
7098 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7099 by calling BringWindowToTop.
7100
7101 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7102 (WM_EMACS_END): Increase by one.
7103
7104 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7105
7106 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7107 This avoids undefined behavior that might cause the eassert
7108 to not catch an out-of-range value.
7109
7110 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
7111
7112 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7113 Update dependencies.
7114
7115 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7116
7117 * bidi.c (bidi_mirror_char): Fix last change.
7118
7119 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7120
7121 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7122 when referring to sectname field in printf format.
7123
7124 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7125
7126 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7127 Only r_alloc_inhibit_buffer_relocation needed to be added;
7128 the others were already declared.
7129
7130 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7131 before checking whether it's out of range. Put the check inside
7132 eassert. See
7133 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7134
7135 2012-05-27 Ken Brown <kbrown@cornell.edu>
7136
7137 * callproc.c (Fcall_process): Restore a line that was accidentally
7138 commented out in the 2011-02-13 change (bug#11547).
7139
7140 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7141
7142 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7143 defined on ralloc.c.
7144
7145 * buffer.c [REL_ALLOC]: Remove prototypes of
7146 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7147 they are now on lisp.h.
7148
7149 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7150
7151 * search.c (search_buffer): Use it to inhibit relocation of buffer
7152 text while re_search_2 is doing its job, because re_search_2 is
7153 passed C pointers to buffer text. (Bug#11519)
7154
7155 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7156 Update value to 24.
7157
7158 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7159 state after an additional call to move_it_in_display_line_to, keep
7160 the values of it->max_ascent and it->max_descent found for the
7161 entire line.
7162 (pos_visible_p): Revert the comparison against bottom_y to what it
7163 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7164 (Bug#11464)
7165
7166 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7167
7168 Fix coding-related core dumps with gcc -ftrapv.
7169 The code was computing A - B, where A and B are pointers, and B is
7170 random garbage. This can lead to core dumps on platforms that
7171 have special pointer registers, and it also leads to core dumps on
7172 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7173 A - B only when B is initialized properly.
7174 * coding.c (coding_set_source, coding_set_destination): Return void.
7175 (coding_change_source, coding_change_destinations): New functions,
7176 with the old behaviors of coding_set_source and coding_set_destination.
7177 All callers that need an offset changed to use these new functions.
7178
7179 2012-05-26 Glenn Morris <rgm@gnu.org>
7180
7181 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7182
7183 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7184
7185 Extend mouse support on W32 text-mode console.
7186 * xdisp.c (draw_row_with_mouse_face):
7187 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7188
7189 * w32console.c: Include window.h.
7190 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7191 New functions.
7192 (initialize_w32_display): Initialize mouse-highlight data.
7193
7194 * w32inevt.c: Include termchar.h and window.h.
7195 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7196 moves, call note_mouse_highlight. If help_echo changed, call
7197 gen_help_event to produce help-echo message in the echo area.
7198 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7199 highlight info.
7200
7201 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7202
7203 * lread.c (read1): Simplify slightly to avoid an overflow warning
7204 with GCC 4.7.0 on x86-64.
7205
7206 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7207
7208 * bidi.c (bidi_mirror_char): Revert last change: an int is
7209 definitely wide enough here.
7210
7211 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
7212
7213 Fix integer width and related bugs (Bug#9874).
7214 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7215 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7216 (string_bytes, check_sblock, allocate_string_data):
7217 (compact_small_strings, Fmake_bool_vector, make_string)
7218 (make_unibyte_string, make_multibyte_string)
7219 (make_string_from_bytes, make_specified_string)
7220 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7221 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7222 (mark_vectorlike):
7223 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7224 (allocate_pseudovector):
7225 Use int, not EMACS_INT, where int is wide enough.
7226 (inhibit_garbage_collection, Fgarbage_collect):
7227 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7228 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7229 int might not be wide enough.
7230 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7231 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7232 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7233 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7234 (bidi_level_of_next_char, bidi_move_to_visually_next):
7235 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7236 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7237 (Fkill_buffer, Fset_buffer_major_mode)
7238 (advance_to_char_boundary, Fbuffer_swap_text)
7239 (Fset_buffer_multibyte, overlays_at, overlays_in)
7240 (overlay_touches_p, struct sortvec, record_overlay_string)
7241 (overlay_strings, recenter_overlay_lists)
7242 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7243 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7244 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7245 (Foverlay_recenter, last_overlay_modification_hooks_used)
7246 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7247 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7248 (validate_region): Omit unnecessary test for b <= e,
7249 since that's guaranteed by the previous test.
7250 (adjust_overlays_for_delete): Avoid pos + length overflow.
7251 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7252 (report_overlay_modification):
7253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7254 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7255 Omit pointer cast, which isn't needed anyway, and doesn't work
7256 after the EMACS_INT -> ptrdiff_t change.
7257 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7258 * buffer.h: Adjust decls to match defn changes elsewhere.
7259 (struct buffer_text, struct buffer):
7260 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7261 Use EMACS_INT, not int, where int might not be wide enough.
7262 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7263 not int, to avoid needless 32-bit limit on 64-bit hosts.
7264 (exec_byte_code): Use tighter memory-full test, one that checks
7265 for alloca overflow. Don't compute the address of the object just
7266 before an array, as that's not portable. Use EMACS_INT, not
7267 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7268 * callint.c (Fcall_interactively):
7269 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7270 * callproc.c (call_process_kill, Fcall_process):
7271 Don't assume pid_t fits into an Emacs fixnum.
7272 (call_process_cleanup, Fcall_process, child_setup):
7273 Don't assume pid_t fits into int.
7274 (call_process_cleanup, Fcall_process, delete_temp_file)
7275 (Fcall_process_region):
7276 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7277 (Fcall_process): Simplify handling of volatile integers.
7278 Use int, not EMACS_INT, where int will do.
7279 * casefiddle.c (casify_object, casify_region, operate_on_word)
7280 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7281 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7282 (casify_object): Avoid integer overflow when overallocating buffer.
7283 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7284 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
7285 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7286 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7287 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7288 integers are now checked earlier. All uses replaced with XINT.
7289 (ccl_driver):
7290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7291 For CCL_MapSingle, check that content and value are in int range.
7292 (ccl_driver, Fregister_code_conversion_map):
7293 Check that Vcode_version_map_vector is a vector.
7294 (resolve_symbol_ccl_program): Check that vector header is in range.
7295 Always copy the vector, so that we can check its contents reliably
7296 now rather than having to recheck each instruction as it's being
7297 executed. Check that vector words fit in 'int'.
7298 (ccl_get_compiled_code, Fregister_ccl_program)
7299 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7300 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7301 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7302 contents are in range.
7303 (Fccl_execute_on_string): Check that status is in range.
7304 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7305 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7306 Accept and return EMACS_INT, not int, because callers can pass values
7307 out of 'int' range.
7308 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7309 (multibyte_chars_in_text, parse_str_as_multibyte)
7310 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7311 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7312 (string_escape_byte8, Fget_byte):
7313 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7314 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7315 avoid mishandling large integers.
7316 * character.h: Adjust decls to match defn changes elsewhere.
7317 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7318 (Ffind_charset_region):
7319 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7320 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7321 (load_charset_map_from_vector, Fdefine_charset_internal):
7322 Don't assume fixnum fits in int.
7323 (load_charset_map_from_vector, Fmap_charset_chars):
7324 Remove now-unnecessary CHECK_NATNUMs.
7325 (Fdefine_charset_internal): Check ranges here, more carefully.
7326 Don't rely on undefined behavior with signed left shift overflow.
7327 Don't assume unsigned int fits into fixnum, or that fixnum fits
7328 into unsigned int. Don't require max_code to be a valid fixnum;
7329 that's not true for gb10830 4-byte on a 32-bit host. Allow
7330 invalid_code to be a cons, for the same reason. Require code_offset
7331 to be a character. Avoid int overflow if max_char is close
7332 to INT_MAX.
7333 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7334 this is intended anyway and avoids some undefined behavior.
7335 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7336 INDEX_TO_CODE_POINT, as that's what it expects.
7337 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
7338 * charset.h (DECODE_CHAR): Return int, not unsigned;
7339 this is what was intended anyway, and it avoids undefined behavior.
7340 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7341 integer-overflow issues.
7342 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7343 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7344 where the argument is EMACS_INT, and this behavior is not intended.
7345 * chartab.c (Fmake_char_table, Fset_char_table_range)
7346 (uniprop_get_decoder, uniprop_get_encoder):
7347 Don't assume fixnum fits in int.
7348 * cmds.c (move_point): New function, that does the gist of
7349 Fforward_char and Fbackward_char, but does so while checking
7350 for integer overflow more accurately.
7351 (Fforward_char, Fbackward_char): Use it.
7352 (Fforward_line, Fend_of_line, internal_self_insert)
7353 (internal_self_insert):
7354 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7355 Fix a FIXME, by checking for integer overflow when calculating
7356 target_clm and actual_clm.
7357 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
7358 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
7359 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7360 (coding_alloc_by_making_gap, alloc_destination)
7361 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7362 (encode_coding_utf_16, detect_coding_emacs_mule)
7363 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7364 (detect_coding_iso_2022, decode_coding_iso_2022)
7365 (encode_invocation_designation, encode_designation_at_bol)
7366 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7367 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7368 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7369 (encode_coding_ccl, encode_coding_raw_text)
7370 (detect_coding_charset, decode_coding_charset)
7371 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7372 (produce_composition, produce_charset, produce_annotation)
7373 (decode_coding, handle_composition_annotation)
7374 (handle_charset_annotation, consume_chars, decode_coding_gap)
7375 (decode_coding_object, encode_coding_object, detect_coding_system)
7376 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7377 (code_convert_region, code_convert_string)
7378 (Fdefine_coding_system_internal)
7379 (coding_set_source, coding_set_destination):
7380 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7381 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7382 (Fdefine_coding_system_internal):
7383 Don't assume fixnums fit in int.
7384 (decode_coding_gap, decode_coding_object, encode_coding_object)
7385 (Fread_coding_system, Fdetect_coding_region)
7386 (Funencodable_char_position, Fcheck_coding_systems_region)
7387 (get_translation, handle_composition_annotation, consume_chars):
7388 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7389 (consume_chars): Rewrite to not calculate an address outside buffer.
7390 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7391 Don't access memory outside of the args array.
7392 (Fdefine_coding_system_internal): Check for charset-id overflow.
7393 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7394 result of ENCODE_CHAR.
7395 * coding.h: Adjust decls to match defn changes elsewhere.
7396 (struct coding_system):
7397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7398 * composite.c (get_composition_id, find_composition)
7399 (run_composition_function, update_compositions)
7400 (compose_text, composition_gstring_put_cache)
7401 (composition_gstring_p, composition_gstring_width)
7402 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7403 (composition_compute_stop_pos, composition_reseat_it)
7404 (composition_update_it, struct position_record)
7405 (find_automatic_composition, composition_adjust_point)
7406 (Fcomposition_get_gstring, Ffind_composition_internal):
7407 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7408 (update_compositions):
7409 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7410 * composite.h: Adjust decls to match defn changes elsewhere.
7411 (struct composition):
7412 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7413 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7414 Do not attempt to compute the address of the object just before a
7415 buffer; this is not portable.
7416 (Faref, Faset):
7417 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7418 (Faset): Use int, not EMACS_INT, where int is wide enough.
7419 (Fstring_to_number): Don't assume fixnums fit in int.
7420 (Frem): Don't assume arg is nonnegative.
7421 * dbusbind.c (xd_append_arg): Check for integers out of range.
7422 (Fdbus_call_method): Don't overflow the timeout int.
7423 (extract_signed, extract_unsigned): New functions.
7424 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7425 (xd_get_connection_references): Return ptrdiff_t, not int.
7426 All uses changed.
7427 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7428 (xd_read_message_1):
7429 Use int, not unsigned, where the dbus API uses int.
7430 (Fdbus_message_internal): Don't overflow mtype.
7431 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7432 * dired.c (directory_files_internal, file_name_completion, scmp)
7433 (file_name_completion_stat):
7434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7435 (file_name_completion): Don't overflow matchcount.
7436 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7437 * dispextern.h: Adjust decls to match defn changes elsewhere.
7438 (struct text_pos, struct glyph, struct bidi_saved_info)
7439 (struct bidi_string_data, struct bidi_it, struct composition_it)
7440 (struct it):
7441 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7442 (struct display_pos, struct composition_it, struct it):
7443 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7444 * dispnew.c (increment_matrix_positions)
7445 (increment_row_positions, mode_line_string)
7446 (marginal_area_string):
7447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7448 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7449 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7450 (duration_to_sec_usec): New function, to check for overflow better.
7451 (Fsleep_for, sit_for): Use it.
7452 * doc.c (get_doc_string, store_function_docstring):
7453 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7454 (get_doc_string, Fsnarf_documentation):
7455 Use int, not EMACS_INT, where int is wide enough.
7456 (get_doc_string):
7457 Use SAFE_ALLOCA, not alloca.
7458 Check for overflow when converting EMACS_INT to off_t.
7459 * doprnt.c (doprnt):
7460 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7461 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7462 Don't assume uid_t fits into fixnum.
7463 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7464 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7465 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7466 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7467 (general_insert_function)
7468 (Finsert_char, make_buffer_string, make_buffer_string_both)
7469 (update_buffer_properties, Fbuffer_substring)
7470 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7471 (Fsubst_char_in_region, check_translation)
7472 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7473 (transpose_markers, Ftranspose_regions):
7474 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7475 (clip_to_bounds): Move to lisp.h as an inline function).
7476 (Fconstrain_to_field): Don't assume integers are nonnegative.
7477 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7478 (Fsubst_char_in_region, Fsave_restriction):
7479 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7480 (Femacs_pid): Don't assume pid_t fits into fixnum.
7481 (lo_time): Use int, not EMACS_INT, when int suffices.
7482 (lisp_time_argument): Check for usec out of range.
7483 (Fencode_time): Don't assume fixnum fits in int.
7484 (Fuser_login_name, Fuser_full_name): Signal an error
7485 if a uid argument is out of range, rather than relying on
7486 undefined behavior.
7487 (Fformat_time_string): Remove now-unnecessary check.
7488 lisp_time_argument checks for out-of-range usec now.
7489 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7490 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7491 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7492 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7493 (init_cmdargs, Fdump_emacs):
7494 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7495 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7496 the bottom (typically) 32 bits of the fixnum.
7497 * eval.c (specpdl_size, call_debugger):
7498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7499 (when_entered_debugger, Fbacktrace_debug):
7500 Don't assume fixnum can fit in int.
7501 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7502 the object just before a buffer; this is not portable.
7503 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7504 (grow_specpdl, unbind_to):
7505 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7506 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7507 (grow_specpdl): Simplify allocation by using xpalloc.
7508 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7509 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7510 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7511 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7512 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7513 (a_write, e_write):
7514 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7515 (Fcopy_file, non_regular_nbytes, read_non_regular)
7516 (Finsert_file_contents):
7517 Use int, not EMACS_INT, where int is wide enough.
7518 (READ_BUF_SIZE): Verify that it fits in int.
7519 (Finsert_file_contents): Check that counts are in proper range,
7520 rather than assuming fixnums fit into ptrdiff_t etc.
7521 Don't assume fixnums fit into int.
7522 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7523 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7524 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7525 (string_char_to_byte, string_byte_to_char)
7526 (string_make_multibyte, string_to_multibyte)
7527 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7528 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7529 (substring_both, Fdelete, internal_equal, Ffillarray)
7530 (Fclear_string, mapcar1)
7531 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7532 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7533 (larger_vector, make_hash_table, maybe_resize_hash_table)
7534 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7535 (Fmaphash, secure_hash):
7536 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7537 (concat): Check for string index and length overflow.
7538 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7539 (Frequire):
7540 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7541 (larger_vector): New API (vec, incr_min, size_max) replaces old
7542 one (vec, new_size, init). This catches size overflow.
7543 INIT was removed because it was always Qnil.
7544 All callers changed.
7545 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7546 the upper bound on a hash table index size.
7547 (make_hash_table, maybe_resize_hash_table): Use it.
7548 (secure_hash): Computer start_byte and end_byte only after
7549 they're known to be in ptrdiff_t range.
7550 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7551 (Ffont_get_glyphs, Ffont_at):
7552 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7553 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7554 (Flist_fonts, Fopen_font):
7555 Don't assume fixnum can fit in int.
7556 (check_gstring): Don't assume index can fit in int.
7557 (font_match_p): Check that fixnum is a character, not a nonnegative
7558 fixnum, since the later code needs to stuff it into an int.
7559 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7560 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7561 conversion overflow issues.
7562 (Fopen_font): Check for integer out of range.
7563 (Ffont_get_glyphs): Don't assume index can fit in int.
7564 * font.h: Adjust decls to match defn changes elsewhere.
7565 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7566 integer overflow.
7567 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7568 printmax_t, where ptrdiff_t is wide enough.
7569 (Finternal_char_font):
7570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7571 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7572 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7573 (Fset_frame_position, x_set_frame_parameters)
7574 (x_set_line_spacing, x_set_border_width)
7575 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7576 Check that fixnums are in proper range for system types.
7577 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7579 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7580 Use SAFE_ALLOCA_LISP, not alloca.
7581 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7582 intptr_t is wide enough.
7583 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7584 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7585 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7586 Check for fixnum out of range.
7587 * ftfont.c (ftfont_list): Don't assume index fits in int.
7588 Check that fixnums are in proper range for system types.
7589 (ftfont_shape_by_flt):
7590 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7591 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7592 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7593 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7594 Check that fixnums are in proper range for system types.
7595 * gnutls.h: Adjust decls to match defn changes elsewhere.
7596 * gtkutil.c (xg_dialog_run):
7597 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7598 (update_frame_tool_bar):
7599 Check that fixnums are in proper range for system types.
7600 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7601 (lookup_image): Check that fixnums are in range for system types.
7602 * indent.c (last_known_column, last_known_column_point):
7603 (current_column_bol_cache):
7604 (skip_invisible, current_column, check_display_width):
7605 (check_display_width, scan_for_column, current_column_1)
7606 (Findent_to, Fcurrent_indentation, position_indentation)
7607 (indented_beyond_p, Fmove_to_column, compute_motion):
7608 (Fcompute_motion, Fvertical_motion):
7609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7610 (last_known_column_modified): Use EMACS_INT, not int.
7611 (check_display_width):
7612 (Fcompute_motion):
7613 Check that fixnums and floats are in proper range for system types.
7614 (compute_motion): Don't assume index or fixnum fits in int.
7615 (compute_motion, Fcompute_motion):
7616 Use int, not EMACS_INT, when it is wide enough.
7617 (vmotion): Omit local var start_hpos that is always 0; that way
7618 we don't need to worry about overflow in expressions involving it.
7619 * indent.h: Adjust decls to match defn changes elsewhere.
7620 (struct position):
7621 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7622 Use int, not EMACS_INT, where int is wide enough.
7623 Remove unused members ovstring_chars_done and tab_offset;
7624 all uses removed.
7625 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7626 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7627 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7628 (make_gap, copy_text, insert, insert_and_inherit)
7629 (insert_before_markers, insert_before_markers_and_inherit)
7630 (insert_1, count_combining_before, count_combining_after)
7631 (insert_1_both, insert_from_string)
7632 (insert_from_string_before_markers, insert_from_string_1)
7633 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7634 (adjust_after_replace, adjust_after_insert, replace_range)
7635 (replace_range_2, del_range, del_range_1, del_range_byte)
7636 (del_range_both, del_range_2, modify_region)
7637 (prepare_to_modify_buffer, signal_before_change)
7638 (signal_after_change, Fcombine_after_change_execute):
7639 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7640 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7641 (balance_an_interval, split_interval_right, split_interval_left)
7642 (find_interval, next_interval, update_interval)
7643 (adjust_intervals_for_insertion, delete_node, delete_interval)
7644 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7645 (static_offset_intervals, offset_intervals)
7646 (merge_interval_right, merge_interval_left, make_new_interval)
7647 (graft_intervals_into_buffer, temp_set_point_both)
7648 (temp_set_point, set_point, adjust_for_invis_intang)
7649 (set_point_both, move_if_not_intangible, get_property_and_range)
7650 (get_local_map, copy_intervals, copy_intervals_to_string)
7651 (compare_string_intervals, set_intervals_multibyte_1):
7652 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7653 * intervals.h: Adjust decls to match defn changes elsewhere.
7654 (struct interval):
7655 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7656 * keyboard.c (this_command_key_count, this_single_command_key_start)
7657 (before_command_key_count, before_command_echo_length, echo_now)
7658 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7659 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7660 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7661 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7662 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7663 (last_non_minibuf_size, last_point_position, echo_truncate)
7664 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7665 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7666 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7667 (stuff_buffered_input):
7668 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7669 (last_auto_save, command_loop_1, read_char):
7670 Use EMACS_INT, not int, to avoid integer overflow.
7671 (record_char): Avoid overflow in total_keys computation.
7672 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7673 * keyboard.h: Adjust decls to match defn changes elsewhere.
7674 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7675 (Fkey_description, Fdescribe_vector, Flookup_key):
7676 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7677 (click_position): New function, to check that positions are in range.
7678 (Fcurrent_active_maps):
7679 (describe_command):
7680 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7681 (Faccessible_keymaps, Fkey_description):
7682 (preferred_sequence_p):
7683 Don't assume fixnum can fit into int.
7684 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7685 Check for integer overflow in size calculations.
7686 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7687 avoid mishandling large integers.
7688 * lisp.h: Adjust decls to match defn changes elsewhere.
7689 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7690 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7691 (struct Lisp_Marker):
7692 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7693 (clip_to_bounds): Now an inline function, moved here from editfns.c.
7694 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7695 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7696 All callers changed.
7697 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7698 Assume the arg has valid form, since it always does.
7699 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7700 unsigned integer system type.
7701 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7702 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7703 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7704 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7705 (duration_to_sec_usec): New decl.
7706 * lread.c (read_from_string_index, read_from_string_index_byte)
7707 (read_from_string_limit, readchar, unreadchar, openp)
7708 (read_internal_start, read1, oblookup):
7709 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7710 (Fload, readevalloop, Feval_buffer, Feval_region):
7711 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7712 (openp): Check for out-of-range argument to 'access'.
7713 (read1): Use int, not EMACS_INT, where int is wide enough.
7714 Don't assume fixnum fits into int.
7715 Fix off-by-one error that can read outside a buffer.
7716 (read_filtered_event): Use duration_to_sec_usec
7717 to do proper overflow checking on durations.
7718 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7719 in size calculation.
7720 (Fexecute_kbd_macro):
7721 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7722 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7723 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7724 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7725 (set_marker_both, set_marker_restricted_both, marker_position)
7726 (marker_byte_position, Fbuffer_has_markers_at):
7727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7728 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7729 * menu.c (ensure_menu_items): Rename from grow_menu_items.
7730 It now merely ensures that the menu is large enough, without
7731 necessarily growing it, as this avoids some integer overflow issues.
7732 All callers changed.
7733 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7734 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7735 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7736 Use SAFE_ALLOCA_LISP, not alloca.
7737 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7738 to EMACS_INT. Check that fixnums are in proper range for system types.
7739 * minibuf.c (minibuf_prompt_width, string_to_object)
7740 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7741 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7742 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7743 (get_minibuffer, read_minibuf_unwind):
7744 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7745 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7746 this simplifies overflow checking. All callers changed.
7747 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7748 (Ftest_completion):
7749 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7750 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7751 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7752 Check that fixnums are in proper range for system types.
7753 (Fx_create_frame, Fx_show_tip):
7754 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7755 * nsfont.m (ns_findfonts, nsfont_list_family):
7756 Don't assume fixnum fits in long.
7757 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7759 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7760 wide enough.
7761 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7762 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7763 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7764 (PRINTDECLARE, PRINTPREPARE):
7765 (strout, print_string):
7766 (print, print_preprocess, print_check_string_charset_prop)
7767 (print_object):
7768 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7769 (PRINTDECLARE):
7770 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7771 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7772 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7773 (printchar, strout): Use xpalloc to catch size calculation overflow.
7774 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7775 (print_error_message): Use SAFE_ALLOCA, not alloca.
7776 (print_object): Use int, not EMACS_INT, where int is wide enough.
7777 (print_depth, new_backquote_output, print_number_index):
7778 Use ptrdiff_t, not int, where int might not be wide enough.
7779 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7780 (Fset_process_window_size, Fformat_network_address)
7781 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7782 (sigchld_handler):
7783 Check that fixnums are in proper range for system types.
7784 (Fsignal_process): Simplify by avoiding a goto.
7785 Check for process-ids out of pid_t range rather than relying on
7786 undefined behavior.
7787 (process_tick, update_tick): Use EMACS_INT, not int.
7788 (Fformat_network_address, read_process_output, send_process)
7789 (Fprocess_send_region, status_notify):
7790 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7791 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7792 (wait_reading_process_output, read_process_output, exec_sentinel):
7793 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7794 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7795 (Faccept_process_output): Use duration_to_sec_usec to do proper
7796 overflow checking on durations.
7797 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7798 Don't assume pid_t fits in int.
7799 * process.h (struct Lisp_Process): Members tick and update_tick
7800 are now of type EMACS_INT, not int.
7801 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7802 configured --with-wide-int.
7803 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7804 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7805 * search.c (looking_at_1, string_match_1):
7806 (fast_string_match, fast_c_string_match_ignore_case)
7807 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7808 (scan_newline, find_before_next_newline, search_command)
7809 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7810 (set_search_regs, wordify):
7811 (Freplace_match):
7812 (Fmatch_data):
7813 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7814 (string_match_1, search_buffer, set_search_regs):
7815 (Fmatch_data):
7816 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7817 (wordify): Check for overflow in size calculation.
7818 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7819 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7820 Check that fixnums are in proper range for system types.
7821 * sound.c (struct sound_device)
7822 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7824 (Fplay_sound_internal):
7825 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7826 * syntax.c (struct lisp_parse_state, find_start_modiff)
7827 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7828 (Fparse_partial_sexp):
7829 Don't assume fixnums can fit in int.
7830 (struct lisp_parse_state, find_start_pos, find_start_value)
7831 (find_start_value_byte, find_start_begv)
7832 (update_syntax_table, char_quoted, dec_bytepos)
7833 (find_defun_start, prev_char_comend_first, back_comment):
7834 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7835 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7836 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7837 (Finternal_describe_syntax_value): Check that match_lisp is a
7838 character, not an integer, since the code stuffs it into int.
7839 (scan_words, scan_sexps_forward):
7840 Check that fixnums are in proper range for system types.
7841 (Fforward_word):
7842 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7843 (scan_sexps_forward):
7844 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7845 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7846 * syntax.h: Adjust decls to match defn changes elsewhere.
7847 (struct gl_state_s):
7848 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7849 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7850 MOST_POSITIVE_FIXNUM.
7851 * sysdep.c (wait_for_termination_1, wait_for_termination)
7852 (interruptible_wait_for_termination, mkdir):
7853 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7854 (emacs_read, emacs_write):
7855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7856 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7857 and double all fit in int.
7858 * term.c (set_tty_color_mode):
7859 Check that fixnums are in proper range for system types.
7860 * termhooks.h (struct input_event):
7861 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7862 * textprop.c (validate_interval_range, interval_of)
7863 (Fadd_text_properties, set_text_properties_1)
7864 (Fremove_text_properties, Fremove_list_of_text_properties)
7865 (Ftext_property_any, Ftext_property_not_all)
7866 (copy_text_properties, text_property_list, extend_property_ranges)
7867 (verify_interval_modification):
7868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7869 (Fnext_single_char_property_change)
7870 (Fprevious_single_char_property_change):
7871 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7872 (copy_text_properties):
7873 Check for integer overflow in index calculation.
7874 * undo.c (last_boundary_position, record_point, record_insert)
7875 (record_delete, record_marker_adjustment, record_change)
7876 (record_property_change):
7877 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7878 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7879 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7880 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7881 (Fx_hide_tip, Fx_file_dialog):
7882 * w32menu.c (set_frame_menubar):
7883 Use ptrdiff_t, not int, for consistency with rest of code.
7884 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7885 (select_window, Fdelete_other_windows_internal)
7886 (window_scroll_pixel_based, window_scroll_line_based)
7887 (Frecenter, Fset_window_configuration):
7888 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7889 (Fset_window_hscroll, run_window_configuration_change_hook)
7890 (set_window_buffer, temp_output_buffer_show, scroll_command)
7891 (Fscroll_other_window, Frecenter):
7892 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7893 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7894 Don't assume fixnum fits in int.
7895 (Fset_window_scroll_bars):
7896 Check that fixnums are in proper range for system types.
7897 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7898 (string_pos, c_string_pos, number_of_chars, init_iterator)
7899 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7900 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7901 (compute_display_string_end, handle_face_prop)
7902 (face_before_or_after_it_pos, handle_invisible_prop)
7903 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7904 (display_prop_intangible_p, string_buffer_position_lim)
7905 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7906 (get_overlay_strings_1, get_overlay_strings)
7907 (iterate_out_of_display_property, forward_to_next_line_start)
7908 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7909 (get_next_display_element, set_iterator_to_next)
7910 (get_visually_first_element, compute_stop_pos_backwards)
7911 (handle_stop_backwards, next_element_from_buffer)
7912 (move_it_in_display_line_to, move_it_in_display_line)
7913 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7914 (add_to_log, message_dolog, message_log_check_duplicate)
7915 (message2, message2_nolog, message3, message3_nolog
7916 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7917 (current_message_1, truncate_echo_area, truncate_message_1)
7918 (set_message, set_message_1, store_mode_line_noprop)
7919 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7920 (text_outside_line_unchanged_p, check_point_in_composition)
7921 (reconsider_clip_changes)
7922 (redisplay_internal, set_cursor_from_row, try_scrolling)
7923 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7924 (redisplay_window, find_last_unchanged_at_beg_row)
7925 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7926 (trailing_whitespace_p, find_row_edges, display_line)
7927 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7928 (display_mode_element, store_mode_line_string)
7929 (pint2str, pint2hrstr, decode_mode_spec)
7930 (display_count_lines, display_string, draw_glyphs)
7931 (x_produce_glyphs, x_insert_glyphs)
7932 (rows_from_pos_range, mouse_face_from_buffer_pos)
7933 (fast_find_string_pos, mouse_face_from_string_pos)
7934 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7935 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7936 (safe_call, init_from_display_pos, handle_fontified_prop)
7937 (handle_single_display_spec, load_overlay_strings)
7938 (with_echo_area_buffer, setup_echo_area_for_printing)
7939 (display_echo_area, echo_area_display)
7940 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7941 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7942 (redisplay_window, dump_glyph_row, display_mode_line)
7943 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7944 (handle_display_spec, display_prop_string_p):
7945 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7946 (handle_single_display_spec, build_desired_tool_bar_string)
7947 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7948 (get_specified_cursor_type):
7949 Check that fixnums are in proper range for system types.
7950 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7951 (Flookup_image_map):
7952 Don't assume fixnums fit in int.
7953 (compare_overlay_entries):
7954 Avoid mishandling comparisons due to subtraction overflow.
7955 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7956 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7957 (handle_tool_bar_click):
7958 Use int, not unsigned, since we prefer signed and the signedness
7959 doesn't matter here.
7960 (get_next_display_element, next_element_from_display_vector):
7961 Use int, not EMACS_INT, when int is wide enough.
7962 (start_hourglass): Use duration_to_sec_usec to do proper
7963 overflow checking on durations.
7964 * xfaces.c (Fbitmap_spec_p):
7965 Check that fixnums are in proper range for system types.
7966 (compare_fonts_by_sort_order):
7967 Avoid mishandling comparisons due to subtraction overflow.
7968 (Fx_family_fonts, realize_basic_faces):
7969 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7970 (Fx_family_fonts):
7971 Don't assume fixnum fits in int.
7972 Use SAFE_ALLOCA_LISP, not alloca.
7973 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7974 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7975 (face_at_buffer_position, face_for_overlay_string)
7976 (face_at_string_position):
7977 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7978 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7979 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7980 (Fx_show_tip):
7981 Check that fixnums are in proper range for system types.
7982 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7983 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7984 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7985 (Fx_change_window_property): Don't assume fixnums fit in int.
7986 * xfont.c (xfont_chars_supported):
7987 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7988 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7989 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7990 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7991 * xml.c (parse_region):
7992 * xrdb.c (magic_file_p):
7993 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7994 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7995 (x_get_local_selection, x_reply_selection_request)
7996 (x_handle_selection_request, wait_for_property_change):
7997 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7998 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7999 short is wide enough.
8000 (x_send_client_event): Don't assume fixnum fits in int.
8001 * xterm.c (x_x_to_emacs_modifiers):
8002 Don't assume EMACS_INT overflows nicely into int.
8003 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8004 may come from Lisp.
8005 (handle_one_xevent): NATNUMP can eval its arg twice.
8006 (x_connection_closed):
8007 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8008 * xterm.h: Adjust decls to match defn changes elsewhere.
8009 (struct scroll_bar): Use struct vectorlike_header
8010 rather than rolling our own approximation.
8011 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8012
8013 2012-05-25 Glenn Morris <rgm@gnu.org>
8014
8015 * lisp.mk (lisp): Update for more files being compiled now.
8016
8017 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8018
8019 * lread.c: Remove `read_pure' which makes no difference.
8020 (read_pure): Remove var.
8021 (unreadpure): Remove function.
8022 (readevalloop): Don't call read_list with -1 flag.
8023 (read1, read_vector): Don't test read_pure any more.
8024 (read_list): Simplify.
8025
8026 * fileio.c, character.h: Minor style tweaks.
8027
8028 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8029
8030 * window.h (clip_changed): Remove useless declaration.
8031
8032 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8033
8034 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8035 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8036
8037 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8038
8039 Remove src/m/*.
8040 This directory predates autoconf and is no longer needed nowadays.
8041 Move its few remaining bits of functionality to where they're needed.
8042 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8043 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8044 * m/template.h: Remove.
8045 * Makefile.in (M_FILE): Remove. All uses removed.
8046 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8047 * lisp.h (USE_LSB_TAG):
8048 * mem-limits.h (EXCEEDS_LISP_PTR):
8049 Use VAL_MAX, not VALBITS, in #if.
8050 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8051 (EMACS_UINT): Define unconditionally now.
8052 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8053 (BITS_PER_EMACS_INT): New constants, replacing
8054 what used to be in config.h, but not useful in #if.
8055 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8056 define them any more.
8057 (VAL_MAX): New macro.
8058 (VALMASK): Use it.
8059 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8060 BITS_PER_EMACS_INT, in #if.
8061 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8062 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8063 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8064 * s/ms-w32.h (DATA_START):
8065 Move here from removed file m/intel386.h.
8066 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8067 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8068
8069 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8070
8071 Assume C89 or later.
8072 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8073 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8074 (xrealloc):
8075 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8076 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8077 * textprop.c, tparam.c (NULL): Remove.
8078 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8079 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8080 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8081 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8082 * xterm.c (input_signal_count): Assume volatile works.
8083
8084 2012-05-21 Ken Brown <kbrown@cornell.edu>
8085
8086 * xgselect.c (xg_select): Fix first argument in call to 'select'
8087 (bug#11508).
8088
8089 2012-05-20 Ken Brown <kbrown@cornell.edu>
8090
8091 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8092 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8093
8094 2012-05-19 Ken Brown <kbrown@cornell.edu>
8095
8096 * xfns.c (x_in_use): Remove `static' qualifier.
8097 * xterm.h (x_in_use): Declare.
8098 * xgselect.c: Include xterm.h.
8099 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8100 and `display_arg' (bug#9754).
8101
8102 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8103
8104 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8105
8106 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8107 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8108
8109 2012-05-18 Eli Zaretskii <eliz@gnu.org>
8110
8111 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8112
8113 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8114 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8115
8116 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8117 reference to image_cache->refcount.
8118 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8119
8120 2012-05-17 Juri Linkov <juri@jurta.org>
8121
8122 * search.c (Fword_search_regexp, Fword_search_backward)
8123 (Fword_search_forward, Fword_search_backward_lax)
8124 (Fword_search_forward_lax): Move functions to isearch.el
8125 (bug#10145, bug#11381).
8126
8127 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8128
8129 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8130
8131 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8132
8133 * lread.c (init_obarray): Declare Qt and Qnil as special.
8134
8135 2012-05-14 Glenn Morris <rgm@gnu.org>
8136
8137 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8138 Put "libexec" before "bin", for the sake of init_callproc_1.
8139
8140 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8141
8142 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8143
8144 * unexaix.c: Port to more-recent AIX compilers.
8145 (report_error, report_error_1, make_hdr, copy_sym)
8146 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8147 Make arguments const char *, not char *, to avoid violations of C
8148 standard and to fix some AIX warnings reported by Gilles Pion.
8149
8150 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8151
8152 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8153 already have overlays loaded.
8154 (handle_single_display_spec): Before returning without displaying
8155 fringe bitmap, synchronize the bidi iterator with the main display
8156 iterator, by calling iterate_out_of_display_property.
8157 (iterate_out_of_display_property): Detect buffer iteration by
8158 testing that it->string is a Lisp string.
8159 (get_next_display_element): When the current object is exhausted,
8160 and there's something on it->stack, call set_iterator_to_next to
8161 proceed with what's on the stack, instead of returning zero.
8162 (set_iterator_to_next): If called at the end of a Lisp string,
8163 proceed to consider_string_end without incrementing string
8164 position. Don't increment display vector index past the end of
8165 the display vector. (Bug#11417)
8166 (pos_visible_p): Don't report a position visible when move_it_to
8167 stopped at the last line of window, which happens to be scanned
8168 backwards by the bidi iteration. (Bug#11464)
8169
8170 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8171
8172 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8173 and right-margin display specs even if the spec is invalid or we
8174 are on a TTY, and thus unable to display on the fringes.
8175 That's because the text with the property will not be displayed anyway,
8176 so we need to signal to the caller that this is a "replacing"
8177 display spec. This fixes display when the spec is invalid or we
8178 are on a TTY.
8179
8180 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8181
8182 * unexaix.c (make_hdr): Fix typo in prototype.
8183 This bug broke the build on AIX. Problem reported by Gilles Pion.
8184
8185 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
8186
8187 * keyboard.c (kbd_buffer_get_event): Read special events also in
8188 batch mode. (Bug#11415)
8189
8190 2012-05-12 Glenn Morris <rgm@gnu.org>
8191
8192 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8193
8194 2012-05-12 Eli Zaretskii <eliz@gnu.org>
8195
8196 * lisp.mk (lisp): Add newcomment.elc.
8197
8198 2012-05-12 Glenn Morris <rgm@gnu.org>
8199
8200 * Makefile.in (MKDIR_P): New, set by configure.
8201 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8202
8203 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8204
8205 Remove unused function hourglass_started.
8206 * dispextern.h (hourglass_started):
8207 * w32fns.c (hourglass_started):
8208 * xdisp.c (hourglass_started): Remove.
8209
8210 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
8211
8212 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8213 Update dependencies.
8214
8215 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8216
8217 * xgselect.c (xg_select): Put maxfds+1 into a var.
8218 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8219
8220 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8221
8222 2012-05-10 Dave Abrahams <dave@boostpro.com>
8223
8224 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8225 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8226
8227 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
8228
8229 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8230 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8231 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8232 Initialize xd_registered_buses.
8233
8234 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8235
8236 Untag more efficiently if USE_LSB_TAG.
8237 This is based on a proposal by YAMAMOTO Mitsuharu in
8238 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8239 For an admittedly artificial (nth 8000 longlist) benchmark on
8240 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8241 Emacs's overall text size by 1%.
8242 * lisp.h (XUNTAG): New macro.
8243 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8244 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8245 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8246 * eval.c (Fautoload):
8247 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8248 * frame.h (XFRAME): Use XUNTAG.
8249
8250 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8251 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8252 Remove unportable assumptions about print widths of types like
8253 dbus_uint32_t.
8254 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8255 intptr_t when converting between pointer and integer, to avoid GCC
8256 warnings about wrong width.
8257
8258 2012-05-09 Eli Zaretskii <eliz@gnu.org>
8259
8260 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8261 stack for each reader_thread, instead of defaulting to 8MB
8262 determined by the linker. This avoids failures in creating
8263 subprocesses on Windows 7, see the discussion in this thread:
8264 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8265
8266 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8267
8268 Fix up display of the *Minibuf-0* buffer in the mini window.
8269 * keyboard.c (read_char): Don't clear the echo area if there's no
8270 message to clear.
8271 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8272 contents of *Minibuf-0*) if there's no message displayed in its stead.
8273
8274 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
8275
8276 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8277 batch mode.
8278
8279 2012-05-06 Chong Yidong <cyd@gnu.org>
8280
8281 * lisp.mk (lisp): Update.
8282
8283 2012-05-05 Jim Meyering <meyering@redhat.com>
8284
8285 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8286
8287 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8288
8289 * data.c (PUT_ERROR): New macro.
8290 (syms_of_data): Use it. Add new error type `user-error'.
8291 * undo.c (user_error): New function.
8292 (Fprimitive_undo): Use it.
8293 * print.c (print_error_message): Adjust print style for `user-error'.
8294 * keyboard.c (user_error): New function.
8295 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8296
8297 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8298
8299 Do not limit current-time-string to years 1000..9999.
8300 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8301 (Fcurrent_time_string): Support any year that is supported by the
8302 underlying localtime representation. Don't use asctime, as it
8303 has undefined behavior for years outside the range -999..9999.
8304
8305 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8306
8307 Fix race conditions involving setenv, gmtime, localtime, asctime.
8308 Without this fix, interrupts could mess up code that uses these
8309 nonreentrant functions, since setting TZ invalidates existing
8310 tm_zone or tzname values, and since most of these functions return
8311 pointers to static storage.
8312 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8313 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8314 Grow the critical sections to include not just invoking
8315 localtime/gmtime, but also accessing these functions' results
8316 including their tm_zone values if any, and any related TZ setting.
8317 (format_time_string): Last arg is now struct tm *, not struct tm **,
8318 so that the struct tm is saved in the critical section.
8319 All callers changed. Simplify allocation of initial buffer, partly
8320 motivated by the fact that memory allocation needs to be outside
8321 the critical section.
8322
8323 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8324
8325 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8326 with RESET_INTERVAL.
8327
8328 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8329 Remove duplicated buffer name initialization.
8330
8331 2012-05-02 Jim Meyering <jim@meyering.net>
8332
8333 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8334
8335 * xfns.c (x_window): Use xstrdup (Bug#11375).
8336
8337 2012-05-02 Eli Zaretskii <eliz@gnu.org>
8338
8339 * xdisp.c (pos_visible_p): If already at a newline from the
8340 display string before the 'while' loop, don't walk back the glyphs
8341 from it3.glyph_row. Solves assertion violation when the display
8342 string begins with a newline (egg.el). (Bug#11367)
8343
8344 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8345
8346 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8347 Move to simple.el.
8348
8349 2012-05-01 Glenn Morris <rgm@gnu.org>
8350
8351 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8352 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8353 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8354 All were removed before 23.1.
8355
8356 * dispnew.c: Remove HAVE_LIBNCURSES test;
8357 it is always true on relevant platforms.
8358
8359 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8360 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8361
8362 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8363
8364 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8365
8366 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8367 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8368 Remove.
8369
8370 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8371
8372 Do not avoid creating empty evaporating overlays (Bug#9642).
8373 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8374 That is, do not delete an evaporating overlay if it becomes
8375 empty after its bounds are adjusted to fit within its buffer.
8376 This fix caused other problems, and I'm reverting it until we get
8377 to the bottom of them.
8378
8379 2012-04-27 Chong Yidong <cyd@gnu.org>
8380
8381 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8382
8383 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8384
8385 * xdisp.c (pos_visible_p): If the window start position is beyond
8386 ZV, start the display from buffer beginning. Prevents assertion
8387 violation in init_iterator when the minibuffer window is scrolled
8388 via the scroll bar.
8389
8390 * window.c (window_scroll_pixel_based): Likewise.
8391
8392 2012-04-27 Chong Yidong <cyd@gnu.org>
8393
8394 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8395
8396 2012-04-27 Glenn Morris <rgm@gnu.org>
8397
8398 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8399 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8400
8401 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8402
8403 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8404 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
8405
8406 2012-04-26 Eli Zaretskii <eliz@gnu.org>
8407
8408 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8409 display element, check also the underlying string or buffer
8410 character. (Bug#11341)
8411
8412 * w32menu.c: Include w32heap.h.
8413 (add_menu_item): If the call to AppendMenuW (via
8414 unicode_append_menu) fails, disable Unicode menus only if we are
8415 running on Windows 9X/Me.
8416
8417 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8418
8419 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8420 (xgetint): Add missing shift for LSB tags.
8421
8422 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8423
8424 * keyboard.c (read_char): Don't wipe echo area for select window
8425 events: These might get delayed via `mouse-autoselect-window'
8426 (Bug#11304).
8427
8428 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8429
8430 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8431 manipulation of :loaded-from data.
8432
8433 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8434
8435 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8436 now a cons (bug#11311).
8437
8438 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8439
8440 Do not create empty overlays with the evaporate property (Bug#9642).
8441 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8442 if it becomes empty after its bounds are adjusted to fit within
8443 its buffer. Without this fix, in a nonempty buffer (let ((o
8444 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8445 yields an empty overlay that has the evaporate property, which is
8446 not supposed to happen.
8447
8448 Fix minor GTK3 problems found by static checking.
8449 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8450 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8451 (struct _EmacsFixedClass, emacs_fixed_get_type):
8452 Move decls here from emacsgtkfixed.h, since they needn't be public.
8453 (emacs_fixed_get_type): Now static.
8454 (emacs_fixed_class_init): Omit unused local.
8455 (emacs_fixed_child_type): Remove; unused.
8456 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8457 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8458 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8459 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8460 (EMACS_FIXED_GET_CLASS): Remove; unused.
8461 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8462
8463 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8464 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8465
8466 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8467
8468 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8469 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8470 (__malloc_size_t, __malloc_ptrdiff_t):
8471 Remove. All uses removed, replaced by the definiens if needed,
8472 since we can assume C89 or better now.
8473 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8474 (protect_malloc_state, align, get_contiguous_space)
8475 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8476 (malloc_atfork_handler_child, malloc_enable_thread)
8477 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8478 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8479 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8480 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8481 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8482 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8483 Define using prototypes, not old style.
8484 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8485 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8486 (align): Don't assume that signed integer overflow wraps around.
8487 Omit unused local var.
8488 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8489 (_free_internal_nolock, memalign, mallochook, reallochook):
8490 Omit no-longer-needed casts.
8491 (valloc): Use getpagesize, not __getpagesize.
8492 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8493 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8494
8495 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8496
8497 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
8498
8499 Move functions from C to Lisp. Make non-blocking method calls
8500 the default. Implement further D-Bus standard interfaces.
8501
8502 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8503 (QCdbus_request_name_allow_replacement)
8504 (QCdbus_request_name_replace_existing)
8505 (QCdbus_request_name_do_not_queue)
8506 (QCdbus_request_name_reply_primary_owner)
8507 (QCdbus_request_name_reply_in_queue)
8508 (QCdbus_request_name_reply_exists)
8509 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8510 (QCdbus_registered_serial, QCdbus_registered_method)
8511 (QCdbus_registered_signal): New Lisp objects.
8512 (XD_DEBUG_MESSAGE): Use sizeof.
8513 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8514 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8515 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8516 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8517 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8518 (xd_signature, xd_append_arg): Allow float for integer types.
8519 (xd_get_connection_references): New function.
8520 (xd_get_connection_address): Rename from xd_initialize.
8521 Return cached address.
8522 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8523 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8524 level.
8525 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8526 Return number of refcounts.
8527 (Fdbus_get_unique_name): Make stronger parameter check.
8528 (Fdbus_message_internal): New defun.
8529 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8530 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8531 (Fdbus_send_signal, Fdbus_register_service)
8532 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8533 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8534 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8535 (Vdbus_compiled_version, Vdbus_runtime_version)
8536 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8537 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8538 (Vdbus_message_type_signal): New defvars.
8539 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8540 Adapt docstring.
8541
8542 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8543
8544 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8545 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8546 Do not assume ptrdiff_t is the same width as 'int'.
8547
8548 * alloc.c: Handle unusual debugging option combinations.
8549 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8550 since the two debugging options are incompatible.
8551 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8552 is defined.
8553 (mem_init, mem_insert, mem_insert_fixup):
8554 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8555 (NEED_MEM_INSERT): Remove; no longer needed.
8556
8557 2012-04-22 Leo Liu <sdl.web@gmail.com>
8558
8559 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8560
8561 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8562
8563 * sysdep.c [__FreeBSD__]: Minor cleanups.
8564 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8565 Use Emacs indenting style more consistently. Avoid some casts.
8566 Use 'double' consistently rather than mixing 'float' and 'double'.
8567
8568 2012-04-21 Eduard Wiebe <usenet@pusto.de>
8569
8570 * sysdep.c (list_system_processes, system_process_attributes):
8571 Add implementation for FreeBSD (Bug#5243).
8572
8573 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8574
8575 * lisp.mk (lisp): Update.
8576
8577 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8578
8579 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8580 It is never used otherwise.
8581
8582 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8583
8584 * print.c (print_preprocess): Only check print_depth if print-circle
8585 is nil.
8586 (print_object): Check for cycles even when print-circle is nil and
8587 print-gensym is t, but only check print_depth if print-circle is nil.
8588
8589 2012-04-20 Chong Yidong <cyd@gnu.org>
8590
8591 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8592 set the status to "failed" and ensure that sentinel is run.
8593
8594 2012-04-20 Glenn Morris <rgm@gnu.org>
8595
8596 * process.c (Fset_process_inherit_coding_system_flag)
8597 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8598 (Fmake_network_process, Fmake_serial_process): Doc fix.
8599
8600 2012-04-20 Eli Zaretskii <eliz@gnu.org>
8601
8602 * xdisp.c (string_buffer_position_lim): Limit starting position to
8603 BEGV.
8604 (set_cursor_from_row): If called for a mode-line or header-line
8605 row, return zero immediately.
8606 (try_cursor_movement): If inside continuation line, don't back up
8607 farther than the first row after the header line, if any.
8608 Don't consider the header-line row as "partially visible", even if
8609 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8610
8611 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8612
8613 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8614 (bug#11238).
8615
8616 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
8617 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
8618
8619 configure: new option --enable-gcc-warnings (Bug#11207)
8620 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8621 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8622 (ALL_CFLAGS): Use new macros rather than old.
8623 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8624 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8625 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8626 -Wunused-result, -Wunused-variable. This should go away once
8627 the Emacs and Gnulib regex code is merged.
8628 (xmalloc, xrealloc): Now static.
8629
8630 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8631
8632 * dired.c (Fsystem_groups): Remove unused local.
8633
8634 2012-04-17 Glenn Morris <rgm@gnu.org>
8635
8636 * dired.c (Fsystem_users): Doc fix.
8637
8638 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8639
8640 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8641 (syms_of_dired): Add them.
8642
8643 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8644
8645 Fix minor alloc.c problems found by static checking.
8646 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8647 New extern decls, to avoid calling undeclared functions.
8648 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8649 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8650 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8651 (NEED_MEM_INSERT): New macro.
8652 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8653 Remove one incorrect comment and fix another.
8654
8655 Fix minor ralloc.c problems found by static checking.
8656 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8657 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8658 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8659 (r_alloc_sbrk): Now static.
8660
8661 Improve ralloc.c interface checking.
8662 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8663 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8664 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8665 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8666 [REL_ALLOC]: ... to here, to check interface.
8667 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8668 Remove decls. This fixes an "It stinks!".
8669
8670 * alloc.c (which_symbols): Fix alignment issue / type clash.
8671
8672 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8673
8674 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8675 (struct Lisp_Misc_Any): Likewise.
8676 (struct Lisp_Free): Likewise.
8677 * alloc.c (union aligned_Lisp_Symbol): Define.
8678 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8679 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8680 (union aligned_Lisp_Misc): Define.
8681 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8682 aligned_Lisp_Misc instead of union Lisp_Misc.
8683 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8684
8685 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8686
8687 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8688 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8689 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8690 * s/netbsd.h, s/sol2-6.h:
8691 Remove definition of GC_MARK_STACK, since the default now works.
8692 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8693 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8694 no longer the default.
8695 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8696
8697 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8698
8699 * lread.c (lisp_file_lexically_bound_p):
8700 Fix hang at ";-*-\n" (bug#11238).
8701
8702 2012-04-14 Eli Zaretskii <eliz@gnu.org>
8703
8704 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8705 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8706
8707 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8708
8709 * nsterm.m (constrainFrameRect): Always constrain when there is only
8710 one screen (Bug#10962).
8711
8712 2012-04-13 Ken Brown <kbrown@cornell.edu>
8713
8714 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8715
8716 2012-04-13 Reuben Thomas <rrt@sc3d.org>
8717
8718 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8719
8720 2012-04-11 Daniel Colascione <dancol@dancol.org>
8721
8722 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8723 against is gone. It's better to use vfork now so that when Cygwin
8724 gains a new, working vfork, we use it automatically (bug#10398).
8725
8726 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8727
8728 * window.c (save_window_save): Obey window-point-insertion-type.
8729
8730 2012-04-11 Glenn Morris <rgm@gnu.org>
8731
8732 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8733
8734 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8735
8736 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8737
8738 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
8739
8740 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8741 (force_quit_count): New var.
8742 (handle_interrupt): Use it.
8743
8744 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
8745
8746 * w32.c (w32_delayed_load): Record the full path of the library
8747 being loaded (bug#10424).
8748
8749 2012-04-09 Glenn Morris <rgm@gnu.org>
8750
8751 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8752 not just in the obarray, before snarfing them. (Bug#11036)
8753
8754 * Makefile.in ($(leimdir)/leim-list.el):
8755 Pass EMACS rather than BUILT_EMACS.
8756
8757 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8758
8759 * process.c (make_process):
8760 * process.h: Add integer `gnutls_handshakes_tried' member to
8761 process struct.
8762
8763 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8764 Add convenience `GNUTLS_LOG2i' macro.
8765
8766 * gnutls.c (gnutls_log_function2i): Convenience log function.
8767 (emacs_gnutls_read): Use new log functions,
8768 `gnutls_handshakes_tried' process member, and
8769 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8770 attempts per process (connection).
8771
8772 2012-04-09 Chong Yidong <cyd@gnu.org>
8773
8774 * eval.c (Fuser_variable_p, user_variable_p_eh)
8775 (lisp_indirect_variable): Functions deleted.
8776 (Fdefvar): Caller changed.
8777
8778 * callint.c (Finteractive, Fcall_interactively):
8779 * minibuf.c (Fread_variable): Callers changed.
8780
8781 2012-04-09 Eli Zaretskii <eliz@gnu.org>
8782
8783 * xdisp.c (set_cursor_from_row): If the display string appears in
8784 the buffer at position that is closer to point than the position
8785 after the display string, display the cursor on the first glyph of
8786 the display string. Fixes cursor display when a 'display' text
8787 property immediately follows invisible text. (Bug#11094)
8788
8789 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8790
8791 composite.c: use 'double' consistently
8792 * composite.c (get_composition_id): Use 'double' consistently
8793 instead of converting 'float' to 'double' and vice versa; this is
8794 easier to understand and avoids a GCC warning.
8795
8796 2012-04-09 Glenn Morris <rgm@gnu.org>
8797
8798 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8799 preparation for dumping it with emacs. (Bug#4789)
8800 (leimdir): New variable.
8801 ($(leimdir)/leim-list.el): New rule.
8802 (emacs$(EXEEXT)): Depend on leim-list.el.
8803
8804 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8805 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8806 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8807
8808 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8809
8810 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8811 proper alignment.
8812
8813 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
8814
8815 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8816 Remove unused local variable.
8817
8818 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8819
8820 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8821 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8822 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8823 objects, as mark_maybe_pointer will catch them otherwise.
8824 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8825 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8826
8827 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8828
8829 Fix typo that broke non-Windows builds.
8830 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8831
8832 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8833
8834 Support building on MS-Windows with libxml2.
8835
8836 * makefile.w32-in (OBJ2): Add xml.$(O).
8837 (GLOBAL_SOURCES): Add xml.c.
8838 ($(BLD)/xml.$(O)): New dependency list.
8839
8840 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8841 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8842 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8843 [!WINDOWSNT]: New macros.
8844 (init_libxml2_functions, libxml2_loaded_p): New functions.
8845 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8846 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8847 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8848 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8849 linked in).
8850 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8851 Call init_libxml2_functions before calling libxml2 functions.
8852 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8853
8854 * emacs.c: Don't include libxml/parser.h.
8855 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8856 xmlCleanupParser directly.
8857
8858 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8859
8860 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8861
8862 * indent.c (Fvertical_motion): If there is a display string at
8863 point, use it.vpos to compute how many lines to backtrack after
8864 move_it_to point. (Bug#11133)
8865
8866 2012-04-06 Eli Zaretskii <eliz@gnu.org>
8867
8868 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8869 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8870 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8871 macros related to unification of CJK characters. For the details,
8872 see the discussion following the message here:
8873 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8874
8875 2012-04-04 Chong Yidong <cyd@gnu.org>
8876
8877 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8878
8879 2012-04-01 Eli Zaretskii <eliz@gnu.org>
8880
8881 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8882 instead of alloca. (Bug#11138)
8883
8884 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8885
8886 * w32menu.c (is_simple_dialog): Properly check lisp types.
8887 (Bug#11141)
8888
8889 2012-03-31 Eli Zaretskii <eliz@gnu.org>
8890
8891 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8892 position we get to after a call to move_it_to fails the
8893 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8894 only if we wind up in a string from display property. (Bug#11063)
8895
8896 * window.c (Fdelete_other_windows_internal): Invalidate the row
8897 and column information about mouse highlight, so that redisplay
8898 restores it after reallocating the glyph matrices. (Bug#7464)
8899
8900 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8901 string comes from a `display' text property, use the buffer
8902 position of that property as if we actually saw that position in
8903 the row's glyphs.
8904 (move_it_by_lines): Remove the assertion that
8905 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8906 violated when there's a before-string at the beginning of a line.
8907 (Bug#11063)
8908
8909 2012-03-30 Eli Zaretskii <eliz@gnu.org>
8910
8911 * xdisp.c (append_space_for_newline): If the default face was
8912 remapped, use the remapped face for the appended newline.
8913 (extend_face_to_end_of_line): Use the remapped default face for
8914 extending the face to the end of the line.
8915 (display_line): Call extend_face_to_end_of_line when the default
8916 face was remapped. (Bug#11068)
8917
8918 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8919
8920 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8921
8922 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8923
8924 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8925
8926 2012-03-27 Glenn Morris <rgm@gnu.org>
8927
8928 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8929 Doc fixes.
8930
8931 2012-03-26 Kenichi Handa <handa@m17n.org>
8932
8933 * dispextern.h (struct glyph): Fix previous change. Change the
8934 bit length of glyphless.ch to 25 (Bug#11082).
8935
8936 2012-03-26 Chong Yidong <cyd@gnu.org>
8937
8938 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8939 (command_loop_1): Use it; inhibit selection update for
8940 handle-select-window too (Bug#8996).
8941
8942 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8943
8944 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8945
8946 2012-03-25 Kenichi Handa <handa@m17n.org>
8947
8948 * dispextern.h (struct glyph): Change the bit length of
8949 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8950
8951 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8952
8953 * s/ms-w32.h (tzname): Include time.h before redirecting to
8954 _tzname. Fixes the MSVC build. (Bug#9960)
8955
8956 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8957
8958 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8959 characters.
8960
8961 * xterm.c (XTread_socket): Only modify handling_signal if
8962 !SYNC_INPUT. (Bug#11080)
8963
8964 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8965
8966 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8967 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8968 when fetching a multibyte character consumes more bytes than
8969 CHAR_BYTES returns, due to unification of CJK characters in
8970 string_char. (Bug#11073)
8971
8972 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8973
8974 * process.c (wait_reading_process_output): Handle pty disconnect
8975 by refraining from sending oneself a SIGCHLD (bug#10933).
8976
8977 2012-03-22 Chong Yidong <cyd@gnu.org>
8978
8979 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8980
8981 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8982 Mark string as coming from a prefix property.
8983 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8984 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8985
8986 2012-03-21 Chong Yidong <cyd@gnu.org>
8987
8988 * xfaces.c (Vface_remapping_alist): Doc fix.
8989
8990 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8991
8992 * w32proc.c (Fw32_set_console_codepage)
8993 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8994 Doc fixes.
8995
8996 2012-03-20 Chong Yidong <cyd@gnu.org>
8997
8998 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8999 to reflect default non-nil value of redisplay-dont-pause.
9000
9001 2012-03-19 Kenichi Handa <handa@m17n.org>
9002
9003 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9004 it fit in a valid range (Bug#11003).
9005
9006 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9007
9008 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9009 that is not from display property, accept the row as a "cursor
9010 row" if one of the string's character has a non-nil `cursor'
9011 property. Fixes cursor positioning when there are newlines in
9012 overlay strings, e.g. in icomplete.el. (Bug#11035)
9013
9014 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9015
9016 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9017
9018 2012-03-12 Chong Yidong <cyd@gnu.org>
9019
9020 * eval.c (inhibit_lisp_code): Rename from
9021 inhibit_window_configuration_change_hook; move from window.c.
9022
9023 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9024 * window.c (run_window_configuration_change_hook)
9025 (syms_of_window): Callers changed.
9026
9027 2012-03-11 Chong Yidong <cyd@gnu.org>
9028
9029 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9030
9031 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9032
9033 2012-03-10 Chong Yidong <cyd@gnu.org>
9034
9035 * frame.c (other_visible_frames): Don't assume the selected frame
9036 is visible (Bug#10955).
9037
9038 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9039
9040 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9041
9042 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9043
9044 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9045 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9046 zero (Bug#10954).
9047
9048 2012-03-03 Glenn Morris <rgm@gnu.org>
9049
9050 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9051
9052 2012-03-02 Eli Zaretskii <eliz@gnu.org>
9053
9054 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9055 position past the first glyph_row that ends at ZV. (Bug#10902)
9056 (redisplay_window, next_element_from_string): Fix typos in
9057 comments.
9058 (redisplay_window): Pass to move_it_vertically the margin in
9059 pixels, not in screen lines.
9060
9061 2012-03-02 Glenn Morris <rgm@gnu.org>
9062
9063 * buffer.c (buffer-list-update-hook): Doc fix.
9064
9065 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9066
9067 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9068 push_it before setting up the iterator for the first overlay
9069 string, even if we have an empty string loaded.
9070 (next_overlay_string): If there's an empty string on the iterator
9071 stack, pop the stack. (Bug#10903)
9072
9073 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9074
9075 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9076 Suggested by Stefan Monnier in
9077 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9078 * alloc.c (widen_to_Lisp_Object): New static function.
9079 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9080 and widening them to Lisp_Objects. This would work even if
9081 USE_LSB_TAG is defined and wide integers are used, which might
9082 happen in a future version of Emacs.
9083
9084 2012-02-25 Chong Yidong <cyd@gnu.org>
9085
9086 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9087 Doc fix.
9088
9089 * xselect.c (Fx_selection_exists_p): Doc fix.
9090 (x_clipboard_manager_save_all): Print an informative message
9091 before saving to clipboard manager.
9092
9093 2012-02-24 Chong Yidong <cyd@gnu.org>
9094
9095 * keyboard.c (process_special_events): Handle all X selection
9096 requests in kbd_buffer, not just the next one (Bug#8869).
9097
9098 2012-02-23 Chong Yidong <cyd@gnu.org>
9099
9100 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9101 call when setting menu-bar-lines and tool-bar-lines parameters.
9102 (unwind_create_frame_1): New helper function.
9103
9104 * window.c (inhibit_window_configuration_change_hook): New var.
9105 (run_window_configuration_change_hook): Obey it.
9106 (syms_of_window): Initialize it.
9107
9108 2012-02-22 Chong Yidong <cyd@gnu.org>
9109
9110 * xterm.c (x_draw_image_relief): Add missing type check for
9111 Vtool_bar_button_margin (Bug#10743).
9112
9113 2012-02-21 Chong Yidong <cyd@gnu.org>
9114
9115 * fileio.c (Vfile_name_handler_alist): Doc fix.
9116
9117 * buffer.c (Fget_file_buffer): Protect against invalid file
9118 handler return value.
9119
9120 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9121
9122 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9123 when computing $valmask.
9124
9125 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9126 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9127 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9128 It's useless in that case, and it can cause problems on hosts
9129 that allocate halves of EMACS_INT values separately.
9130 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9131 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9132 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9133 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9134 it avoids undefined behavior on hosts where shifting right by more
9135 than the word width has undefined behavior.
9136
9137 2012-02-19 Chong Yidong <cyd@gnu.org>
9138
9139 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9140 (Funhandled_file_name_directory, Ffile_name_as_directory)
9141 (Fdirectory_file_name, Fexpand_file_name)
9142 (Fsubstitute_in_file_name): Protect against invalid file handler
9143 return values (Bug#10845).
9144
9145 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9146
9147 * .gdbinit (pitx): Fix incorrect references to fields of the
9148 iterator stack.
9149
9150 2012-02-17 Chong Yidong <cyd@gnu.org>
9151
9152 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9153
9154 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9155
9156 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9157 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9158
9159 2012-02-15 Chong Yidong <cyd@gnu.org>
9160
9161 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9162 marked as special. Also, starting docstrings with * is obsolete.
9163
9164 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9165
9166 * gnutls.c (emacs_gnutls_write): Fix last change.
9167
9168 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9169
9170 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9171 send_process.
9172
9173 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9174
9175 * keymap.c (Fsingle_key_description): Handle char ranges.
9176
9177 2012-02-12 Chong Yidong <cyd@gnu.org>
9178
9179 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9180 as that creates a dangerous corner case.
9181
9182 * window.c (Fdelete_window_internal): Invalidate the mouse
9183 highlight (Bug#9904).
9184
9185 2012-02-12 Glenn Morris <rgm@gnu.org>
9186
9187 * xselect.c (Fx_own_selection_internal)
9188 (Fx_get_selection_internal, Fx_disown_selection_internal)
9189 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9190 * nsselect.m (Fx_own_selection_internal)
9191 (Fx_disown_selection_internal, Fx_selection_exists_p)
9192 (Fx_selection_owner_p, Fx_get_selection_internal):
9193 Sync docs and argument specs with the xselect.c versions.
9194
9195 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9196
9197 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9198
9199 2012-02-11 Eli Zaretskii <eliz@gnu.org>
9200
9201 * w32select.c (Fx_selection_exists_p): Sync doc string and
9202 argument list with xselect.c. (Bug#10783)
9203
9204 * w16select.c (Fx_selection_exists_p): Sync doc string and
9205 argument list with xselect.c. (Bug#10783)
9206
9207 2012-02-10 Glenn Morris <rgm@gnu.org>
9208
9209 * fns.c (Fsecure_hash): Doc fix.
9210
9211 2012-02-09 Kenichi Handa <handa@m17n.org>
9212
9213 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9214
9215 2012-02-07 Chong Yidong <cyd@gnu.org>
9216
9217 * buffer.c (Fbuffer_local_variables)
9218 (buffer_lisp_local_variables): Handle unbound vars correctly;
9219 don't let Qunbound leak into Lisp.
9220
9221 2012-02-07 Glenn Morris <rgm@gnu.org>
9222
9223 * image.c (Fimagemagick_types): Doc fix.
9224
9225 * image.c (imagemagick-render-type): Change it from a lisp object
9226 to an integer. Move the doc here from the lisp manual.
9227 Treat all values not equal to 0 the same.
9228
9229 2012-02-06 Chong Yidong <cyd@gnu.org>
9230
9231 * doc.c (store_function_docstring): Avoid applying docstring of
9232 alias to base function (Bug#2603).
9233
9234 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9235
9236 * .gdbinit (pp1, pv1): Remove redundant defines.
9237 (pr): Use pp.
9238
9239 2012-02-04 Chong Yidong <cyd@gnu.org>
9240
9241 * nsterm.m: Declare a global (Bug#10694).
9242
9243 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9244
9245 * w32.c (get_emacs_configuration_options):
9246 Include --enable-checking, if specified, in the return value.
9247
9248 2012-02-04 Martin Rudalics <rudalics@gmx.at>
9249
9250 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9251 after rounding frame sizes. (Bug#9723)
9252
9253 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9254
9255 * keyboard.c (adjust_point_for_property): Don't position point
9256 before BEGV. (Bug#10696)
9257
9258 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9259
9260 Handle overflow when computing char display width (Bug#9496).
9261 * character.c (char_width): Return EMACS_INT, not int.
9262 (char_width, c_string_width): Check for overflow when
9263 computing the width; this is possible now that individual
9264 characters can have unbounded width. Problem introduced
9265 by merge from Emacs 23 on 2012-01-19.
9266
9267 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
9268
9269 * dbusbind.c (Fdbus_register_method): Mention the return value
9270 :ignore in the docstring.
9271
9272 2012-02-02 Glenn Morris <rgm@gnu.org>
9273
9274 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9275
9276 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9277 Unconditionally set to t. (Bug#10673)
9278 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9279 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9280 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9281
9282 2012-02-02 Kenichi Handa <handa@m17n.org>
9283
9284 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9285 0, do not call append_composite_glyph.
9286
9287 2012-02-02 Kenichi Handa <handa@m17n.org>
9288
9289 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9290 NULL (Bug#6988).
9291 (x_produce_glyphs): If the component of a composition is a null
9292 string, set it->pixel_width to 1 to avoid zero-width glyph.
9293
9294 2012-02-01 Eli Zaretskii <eliz@gnu.org>
9295
9296 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9297 first 2 arguments are identical. This makes inserting large
9298 output from a subprocess an order of magnitude faster on
9299 MS-Windows, where all sbrk'ed memory is always contiguous.
9300
9301 2012-01-31 Glenn Morris <rgm@gnu.org>
9302
9303 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9304 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9305 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9306
9307 2012-01-29 Glenn Morris <rgm@gnu.org>
9308
9309 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9310
9311 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9312
9313 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9314
9315 2012-01-28 Chong Yidong <cyd@gnu.org>
9316
9317 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9318
9319 2012-01-26 Chong Yidong <cyd@gnu.org>
9320
9321 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9322
9323 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9324 repeat counts (Bug#10507).
9325
9326 2012-01-26 Glenn Morris <rgm@gnu.org>
9327
9328 * lread.c (syms_of_lread): Doc fix.
9329
9330 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9331
9332 * coding.c (encode_designation_at_bol): Change return value to
9333 EMACS_INT.
9334
9335 2012-01-25 Chong Yidong <cyd@gnu.org>
9336
9337 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9338
9339 2012-01-21 Chong Yidong <cyd@gnu.org>
9340
9341 * floatfns.c (Fcopysign): Make the second argument non-optional,
9342 since nil is not allowed anyway.
9343
9344 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9345
9346 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9347 (send_process): Likewise.
9348
9349 2012-01-19 Martin Rudalics <rudalics@gmx.at>
9350
9351 * window.c (save_window_save, Fcurrent_window_configuration)
9352 (Vwindow_persistent_parameters): Do not use Qstate.
9353 Rewrite doc-strings.
9354
9355 2012-01-19 Kenichi Handa <handa@m17n.org>
9356
9357 * character.c (char_width): New function.
9358 (Fchar_width, c_string_width, lisp_string_width):
9359 Use char_width (Bug#9496).
9360
9361 2012-01-16 Martin Rudalics <rudalics@gmx.at>
9362
9363 * window.c (Vwindow_persistent_parameters): New variable.
9364 (Fset_window_configuration, save_window_save): Handle persistent
9365 window parameters.
9366
9367 2012-01-14 Eli Zaretskii <eliz@gnu.org>
9368
9369 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9370 thrashing the stack of the thread. (Bug#9087)
9371
9372 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9373
9374 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9375
9376 2012-01-11 Eli Zaretskii <eliz@gnu.org>
9377
9378 * xdisp.c (rows_from_pos_range): Handle the case where the
9379 highlight ends on a newline. (Bug#10464)
9380 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9381 he end column for display of highlight that ends on a newline
9382 before a R2L line.
9383
9384 2012-01-11 Glenn Morris <rgm@gnu.org>
9385
9386 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9387 from load-path also when installation-directory is nil. (Bug#10208)
9388
9389 2012-01-10 Glenn Morris <rgm@gnu.org>
9390
9391 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9392
9393 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9394 Update template values to be closer to their typical values these days.
9395
9396 2012-01-09 Eli Zaretskii <eliz@gnu.org>
9397
9398 * xdisp.c (rows_from_pos_range): Accept additional argument
9399 DISP_STRING, and accept any glyph in a row whose object is that
9400 string as eligible for mouse highlight. Fixes mouse highlight of
9401 display strings from overlays. (Bug#10464)
9402
9403 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
9404
9405 emacs: fix an auto-save permissions race condition (Bug#10400)
9406 * fileio.c (auto_saving_dir_umask): New static var.
9407 (Fmake_directory_internal): Use it.
9408 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9409 creating the directory. The old code temporarily assigns
9410 too-generous permissions to the directory.
9411 (do_auto_save_eh): Clear it.
9412 (Fdo_auto_save): Catch all errors, not just file errors, so
9413 that the var is always cleared.
9414
9415 2012-01-07 Eli Zaretskii <eliz@gnu.org>
9416
9417 * search.c (scan_buffer): Pass character positions to
9418 know_region_cache, not byte positions. (Bug#6540)
9419
9420 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
9421
9422 * w32.c (sys_rename): Report EXDEV when rename of a directory
9423 fails because the target is on another logical disk. (Bug#10284)
9424
9425 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9426
9427 * xterm.c (x_embed_request_focus): New function.
9428
9429 * xterm.h: Add prototype.
9430
9431 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9432
9433 2012-01-05 Glenn Morris <rgm@gnu.org>
9434
9435 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9436
9437 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9438
9439 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9440 Load gnutls_transport_set_lowat only if GnuTLS version is below
9441 2.11.1.
9442 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9443 GnuTLS versions below 2.11.1.
9444
9445 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9446
9447 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9448 to the doc string advising against its use for altering the way
9449 windows are scrolled.
9450
9451 2011-12-28 Kenichi Handa <handa@m17n.org>
9452
9453 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9454 coding-system ASCII compatible only when it does not produce BOM
9455 on encoding (Bug#10383).
9456
9457 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9458
9459 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9460 can scroll.
9461 (create_and_show_popup_menu): Always use menu_position_func for
9462 Gtk3 (Bug#10361).
9463
9464 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9465
9466 * callint.c (Fcall_interactively): Don't truncate prompt string.
9467
9468 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9469
9470 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9471 property that ends at ZV, so that the bidi iteration could be
9472 resumed from there (after widening). (Bug#10360)
9473
9474 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9475
9476 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9477
9478 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9479
9480 * nsterm.m (x_free_frame_resources):
9481 Release f->output_data.ns->miniimage.
9482 (ns_index_color): Fix indentation. Do not retain
9483 color_table->colors[i].
9484
9485 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9486 before returning.
9487
9488 * nsfns.m (x_set_background_color): Assign return value from
9489 ns_index_color to face-background instead of NSColor*.
9490 (ns_implicitly_set_icon_type): Fix indentation.
9491 Change assignment in for loop to comparison.
9492
9493 * emacs.c (ns_pool): New variable.
9494 (main): Assign ns_pool.
9495 (Fkill_emacs): Call ns_release_autorelease_pool.
9496
9497 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9498 autorelease fdesc, release fdAttrs and tdict.
9499 (ns_get_covering_families): Release charset.
9500 (ns_findfonts): Release NSFontDescriptor created with new.
9501 (ns_uni_to_glyphs): Fix indentation.
9502 (setString): Release attrStr before assigning new value.
9503
9504 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9505
9506 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9507 and NS_IMPL_COCOA.
9508 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9509 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9510
9511 2011-12-18 David Reitter <reitter@cmu.edu>
9512
9513 * nsterm.m (ns_term_init): Subscribe for notifications
9514 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9515 to method trackingNotification in EmacsMenu.
9516
9517 * nsmenu.m (trackingMenu): New variable.
9518 (trackingNotification): New method (from Aquamacs).
9519 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9520 from Aquamacs (Bug#7030).
9521
9522 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9523
9524 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9525 (symbol_to_nsstring): Fix indentation.
9526 (ns_symbol_to_pb): New function.
9527 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9528 (Fns_rotate_cut_buffers_internal): Remove.
9529 (Fns_store_selection_internal): Rename from
9530 Fns_store_cut_buffer_internal.
9531 (ns_get_foreign_selection, Fx_own_selection_internal)
9532 (Fx_disown_selection_internal, Fx_selection_exists_p)
9533 (Fns_get_selection_internal, Fns_store_selection_internal):
9534 Use ns_symbol_to_pb and check if return value is nil.
9535 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9536 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9537 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9538 renamed to Sns_store_selection_internal.
9539 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9540 and remove this function.
9541 (ns_handle_selection_clear): Remove, never used.
9542 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9543 here.
9544
9545 2011-12-17 Ken Brown <kbrown@cornell.edu>
9546
9547 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9548 GID is unknown (Bug#10257).
9549
9550 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9551
9552 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9553 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9554 which caused a build failure on GNU/Linux IA-64. This problem was
9555 introduced by my 2011-10-07 patch.
9556
9557 2011-12-15 Juri Linkov <juri@jurta.org>
9558
9559 * image.c (imagemagick_error): New function. (Bug#10112)
9560 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9561 Use `imagemagick_error' where ImageMagick functions return
9562 `MagickFalse'.
9563 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9564 proper order.
9565
9566 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9567
9568 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9569 fill background (Bug#8992).
9570
9571 2011-12-13 Martin Rudalics <rudalics@gmx.at>
9572
9573 * window.c (Vwindow_combination_resize)
9574 (Vwindow_combination_limit): Use t instead of non-nil in
9575 doc-strings.
9576 (Vrecenter_redisplay): Add first sentence of doc-string on
9577 separate line.
9578 (Frecenter): Fix doc-string typo.
9579
9580 2011-12-11 Kenichi Handa <handa@m17n.org>
9581
9582 * coding.c (Funencodable_char_position): Pay attention to the
9583 buffer text relocation (Bug#9389).
9584
9585 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9586
9587 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9588 gtk_init (Bug#10100).
9589
9590 2011-12-10 Eli Zaretskii <eliz@gnu.org>
9591
9592 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9593 IT->string is nil. (Bug#10263)
9594
9595 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9596
9597 * nsterm.h (x_free_frame_resources): Declare.
9598
9599 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9600 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9601
9602 * nsterm.h (ns_get_defaults_value): Declare.
9603
9604 * nsterm.m (ns_default): Call ns_get_defaults_value.
9605
9606 2011-12-09 Eli Zaretskii <eliz@gnu.org>
9607
9608 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9609 (Bug#10170)
9610
9611 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9612
9613 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9614 that where the value of an _OBJC_* symbol points to is in the .bss
9615 section (Bug#10240).
9616
9617 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9618
9619 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9620 after the loop to call ccl_driver at least once (Bug#8619).
9621
9622 2011-12-08 Kenichi Handa <handa@m17n.org>
9623
9624 * ftfont.c (get_adstyle_property): Fix previous change
9625 (Bug#10233).
9626
9627 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
9628
9629 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9630 dirs from the default value of EMACSLOADPATH (bug#10208).
9631
9632 2011-12-07 Glenn Morris <rgm@gnu.org>
9633
9634 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9635 installation and source directories as well. (Bug#10208)
9636
9637 2011-12-06 Chong Yidong <cyd@gnu.org>
9638
9639 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9640
9641 2011-12-06 Glenn Morris <rgm@gnu.org>
9642
9643 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9644 as an error, not just -1. (Bug#10217)
9645
9646 2011-12-05 Chong Yidong <cyd@gnu.org>
9647
9648 * keyboard.c (process_special_events): New function.
9649 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9650
9651 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9652
9653 * coding.c (encode_designation_at_bol): Don't use uninitialized
9654 local variable (Bug#9318).
9655
9656 2011-12-05 Kenichi Handa <handa@m17n.org>
9657
9658 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9659 return Qnil (Bug#8046, Bug#10193).
9660
9661 2011-12-05 Kenichi Handa <handa@m17n.org>
9662
9663 * coding.c (encode_designation_at_bol): New args charbuf_end and
9664 dst. Return the number of produced bytes. Callers changed.
9665 (coding_set_source): Return how many bytes coding->source was
9666 relocated.
9667 (coding_set_destination): Return how many bytes
9668 coding->destination was relocated.
9669 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9670 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9671
9672 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9673
9674 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9675 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9676 macro (Bug#9318).
9677
9678 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9679
9680 The following changes are to fix Bug#9318.
9681
9682 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9683 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9684 (encode_coding_iso_2022, encode_coding_sjis)
9685 (encode_coding_big5, encode_coding_charset): Use the above macros.
9686
9687 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
9688
9689 * lisp.h (process_quit_flag): Fix external declaration.
9690
9691 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9692
9693 Don't macro-inline non-performance-critical code.
9694 * eval.c (process_quit_flag): New function.
9695 * lisp.h (QUIT): Use it.
9696
9697 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9698
9699 * nsfns.m (get_geometry_from_preferences): New function.
9700 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9701
9702 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9703
9704 * emacs.c (Qkill_emacs): Define.
9705 (syms_of_emacs): Initialize it.
9706 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9707 Qquit_flag to `kill-emacs' instead.
9708 (quit_throw_to_read_char): Add parameter `from_signal'.
9709 All callers changed. Call Fkill_emacs if requested and safe.
9710 * lisp.h (QUIT): Call Fkill_emacs if requested.
9711
9712 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9713
9714 * widget.c (update_wm_hints): Return if wmshell is null.
9715 (widget_update_wm_size_hints): New function.
9716
9717 * widget.h (widget_update_wm_size_hints): Declare.
9718
9719 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9720 widget_update_wm_size_hints (Bug#10104).
9721
9722 2011-12-03 Eli Zaretskii <eliz@gnu.org>
9723
9724 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9725 before a newline, prepare the bidi iterator for consuming the
9726 newline, and keep the current paragraph direction. (Bug#10183)
9727 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9728
9729 2011-12-02 Juri Linkov <juri@jurta.org>
9730
9731 * search.c (Fword_search_regexp): New Lisp function created from
9732 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9733 (Fword_search_backward, Fword_search_forward)
9734 (Fword_search_backward_lax, Fword_search_forward_lax):
9735 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9736 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9737
9738 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9739
9740 * fileio.c (Finsert_file_contents): Move after-change-function call
9741 to before the "handled:" label, since all "goto handled" appear in
9742 cases where the *-change-functions have already been properly called
9743 (bug#10117).
9744
9745 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9746
9747 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9748 waiting for input. (Bug#10169)
9749
9750 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9751
9752 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9753 verifies glyph row's hash code--we have just reallocated the
9754 glyphs, so their contents can be complete garbage. (Bug#10164)
9755
9756 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
9757
9758 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9759
9760 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9761
9762 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9763 attributes are tested _before_ calling verify_row_hash, to protect
9764 against GCC re-ordering of the tests. (Bug#10164)
9765
9766 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9767
9768 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9769
9770 * xterm.c (handle_one_xevent): Only set async_visible and friends
9771 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9772 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9773 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9774
9775 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9776
9777 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9778 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9779 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9780 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9781 All uses changed to use GCPRO1 etc.
9782 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9783 Revert to old implementation (i.e., before 2011-03-11).
9784
9785 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9786
9787 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9788 of scroll runs so as to avoid assigning disabled bogus rows and
9789 unnecessary graphics copy operations.
9790
9791 2011-11-27 Eli Zaretskii <eliz@gnu.org>
9792
9793 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9794 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9795 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9796 (malloc, free, realloc, calloc): Redirect to e_* only when
9797 compiling Emacs.
9798
9799 * lisp.h (GCTYPEBITS): Move before first use.
9800 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9801 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9802 this macro definition.
9803
9804 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9805 _MSC_VER.
9806
9807 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9808
9809 * gtkutil.c (xg_create_frame_widgets):
9810 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9811 present with Gtk+ 2.0.
9812
9813 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9814
9815 * fileio.c (Finsert_file_contents): Undo previous change; see
9816 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9817
9818 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9819
9820 Rename locals to avoid shadowing.
9821 * fileio.c (Finsert_file_contents):
9822 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9823 * process.c (wait_reading_process_output):
9824 Rename inner 'proc' to 'p' to avoid shadowing.
9825 Indent for consistency with usual Emacs style.
9826
9827 2011-11-25 Eli Zaretskii <eliz@gnu.org>
9828
9829 * xdisp.c (redisplay_window): If cursor row is not fully visible
9830 after recentering, and scroll-conservatively is set to a large
9831 number, scroll window by a few more lines to make the cursor fully
9832 visible and out of scroll-margin. (Bug#10105)
9833 (start_display): Don't move to the next line if the display should
9834 start at a newline that is part of a display vector or an overlay
9835 string. (Bug#10119)
9836
9837 2011-11-24 Juri Linkov <juri@jurta.org>
9838
9839 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9840 after the `MagickPingImage' call. (Bug#10112)
9841
9842 2011-11-23 Chong Yidong <cyd@gnu.org>
9843
9844 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9845
9846 2011-11-23 Martin Rudalics <rudalics@gmx.at>
9847
9848 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9849 making another buffer current. (Bug#10114)
9850
9851 2011-11-23 Glenn Morris <rgm@gnu.org>
9852
9853 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9854
9855 2011-11-23 Chong Yidong <cyd@gnu.org>
9856
9857 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9858 using it (Bug#5984).
9859
9860 2011-11-22 Eli Zaretskii <eliz@gnu.org>
9861
9862 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9863 and header-lines, as they don't have one computed for them.
9864 (Bug#10098)
9865
9866 * .gdbinit (prow): Make displayed values more self-explaining.
9867 Add row's hash code.
9868
9869 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9870
9871 * process.c (wait_reading_process_output): Fix asynchrounous
9872 GnuTLS socket handling on some versions of the GnuTLS library.
9873 (wait_reading_process_output): Add comment and URL.
9874
9875 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9876
9877 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9878
9879 2011-11-21 Chong Yidong <cyd@gnu.org>
9880
9881 * window.c (Fnext_window, Fprevious_window): Doc fix.
9882
9883 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9884
9885 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9886
9887 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9888
9889 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9890
9891 2011-11-20 Martin Rudalics <rudalics@gmx.at>
9892
9893 * window.c (Fset_window_combination_limit): Rename argument
9894 STATUS to LIMIT.
9895 (Vwindow_combination_limit): Remove "status" from doc-string.
9896
9897 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9898
9899 * m/ibms390.h: Remove.
9900 * m/ibms390x.h: Don't include "ibms390.h".
9901
9902 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9903
9904 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9905 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9906
9907 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9908
9909 * casetab.c (Fset_case_table):
9910 * charset.c (Fcharset_after): Fix typos.
9911
9912 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9913
9914 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9915 Otherwise, valgrind does not work on some platforms.
9916 Problem reported by Andreas Schwab in
9917 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9918 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9919 is set, removing the need for VIRT_ADDRESS_VARIES.
9920 (PURE_P): Use a more-efficient implementation that needs just one
9921 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9922 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9923 to 4 (xorl, subq, cmpq, setbe).
9924 * alloc.c (pure): Always extern now, since that's the
9925 VIRT_ADDR_VARIES behavior.
9926 (PURE_POINTER_P): Use a single comparison, not two, for
9927 consistency with the new puresize.h.
9928 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9929 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9930 Remove VIRT_ADDR_VARIES no longer needed.
9931
9932 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9933
9934 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9935 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9936 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9937 behave as if the cursor position were at the window margin.
9938
9939 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9940 and the cursor position is out of bounds, behave as if the cursor
9941 position were at the window margin. (Bug#10075)
9942
9943 2011-11-18 Chong Yidong <cyd@gnu.org>
9944
9945 * window.c (Fwindow_combination_limit): Make first argument
9946 non-optional, since it is meaningless for live windows like the
9947 selected window.
9948
9949 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9950
9951 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9952
9953 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9954
9955 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9956 (graft_intervals_into_buffer): Simplify.
9957
9958 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9959
9960 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9961 hash values of the two rows.
9962 (copy_row_except_pointers): Preserve the used[] arrays and the
9963 hash values of the two rows. (Bug#10035)
9964 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9965
9966 * xdisp.c (row_hash): New function, body extracted from
9967 compute_line_metrics.
9968 (compute_line_metrics): Call row_hash, instead of computing the
9969 hash code inline.
9970
9971 * dispnew.c (verify_row_hash): Call row_hash for computing the
9972 hash code of a row, instead of duplicating code from xdisp.c.
9973
9974 * dispextern.h (row_hash): Add prototype.
9975
9976 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9977
9978 * frame.c (delete_frame): Don't delete the terminal when the last
9979 X frame is closed if emacs is built with GTK toolkit.
9980
9981 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9982
9983 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9984
9985 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9986
9987 * window.c (Vwindow_splits): Rename to
9988 Vwindow_combination_resize. Suggested by Juri Linkov.
9989 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9990 of Vwindow_splits.
9991
9992 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9993
9994 * nsfns.m (Fns_font_name):
9995 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9996
9997 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9998
9999 * window.h (window): Rename slot "nest" to "combination_limit".
10000 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10001 (Fset_window_nest): Rename to Fset_window_combination_limit.
10002 (Vwindow_nest): Rename to Vwindow_combination_limit.
10003 (recombine_windows, make_parent_window, make_window)
10004 (Fsplit_window_internal, saved_window)
10005 (Fset_window_configuration, save_window_save): Rename all
10006 occurrences of window_nest to window_combination_limit.
10007
10008 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10009
10010 * image.c (imagemagick_load_image): Fix typo.
10011
10012 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10013
10014 * xdisp.c (display_line): Move the call to
10015 highlight_trailing_whitespace before the call to
10016 compute_line_metrics, since the latter needs to see the final
10017 faces of all the glyphs to compute ROW's hash value.
10018 Fixes assertion violations in row_equal_p. (Bug#10035)
10019
10020 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10021
10022 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10023 just return (bug#10044).
10024
10025 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10026
10027 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10028 with user-defined heap size. Bump the default size of the temacs
10029 heap to 27MB, to avoid memory warning when running temacs.
10030 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10031
10032 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10033 current_matrix and desired_matrix. (Bug#9990)
10034 (verify_row_hash) [XASSERTS]: New function.
10035 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10036 that the hash value of glyph rows is correct.
10037
10038 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10039
10040 * window.h (window): Remove splits slot.
10041 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10042 (Fdelete_other_windows_internal, make_parent_window)
10043 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10044 (Fset_window_configuration, save_window_save): Don't deal with
10045 split status of windows.
10046 (saved_window): Remove splits slot.
10047 (Vwindow_splits): Rewrite doc-string.
10048
10049 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10050
10051 * xfns.c (unwind_create_frame):
10052 * nsfns.m (unwind_create_frame):
10053 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10054 Vframe_list (Bug#9999).
10055
10056 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10057
10058 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10059
10060 2011-11-11 Kenichi Handa <handa@m17n.org>
10061
10062 * callproc.c (Fcall_process): Set the member dst_multibyte of
10063 process_coding.
10064
10065 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10066
10067 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10068 avoid a crash (bug#9496).
10069
10070 2011-11-09 Chong Yidong <cyd@gnu.org>
10071
10072 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10073 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10074
10075 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10076
10077 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10078
10079 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10080
10081 Avoid some portability problems by eschewing 'extern inline' functions.
10082 The trivial performance wins aren't worth the portability hassles; see
10083 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10084 et seq.
10085 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10086 (window_box_width, window_box_left, window_box_left_offset)
10087 (window_box_right, window_box_right_offset): Undo previous change,
10088 by removing the "extern"s.
10089 * intervals.c (adjust_intervals_for_insertion)
10090 (adjust_intervals_for_deletion): Undo previous change,
10091 making these static again.
10092 (offset_intervals, temp_set_point_both, temp_set_point)
10093 (copy_intervals_to_string): No longer inline.
10094 * xdisp.c (window_text_bottom_y, window_box_width)
10095 (window_box_height, window_box_left_offset)
10096 (window_box_right_offset, window_box_left, window_box_right)
10097 (window_box): No longer inline.
10098
10099 2011-11-08 Chong Yidong <cyd@gnu.org>
10100
10101 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10102 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10103 Signal an error if not a live window.
10104 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10105 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10106
10107 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
10108
10109 * lisp.h (syms_of_abbrev): Remove declaration.
10110 Reported by CHENG Gao <chenggao@royau.me>.
10111
10112 2011-11-07 Eli Zaretskii <eliz@gnu.org>
10113
10114 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10115 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10116 of temacs in GUI mode.
10117
10118 2011-11-07 Martin Rudalics <rudalics@gmx.at>
10119
10120 * window.h: Declare delete_all_child_windows instead of
10121 delete_all_subwindows.
10122 * window.c (Fwindow_nest, Fset_window_nest)
10123 (Fset_window_new_total, Fset_window_new_normal)
10124 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10125 (delete_all_subwindows): Rename to delete_all_child_windows.
10126 (Fdelete_other_windows_internal, Fset_window_configuration):
10127 Call delete_all_child_windows instead of delete_all_subwindows.
10128 * frame.c (delete_frame): Call delete_all_child_windows instead
10129 of delete_all_subwindows.
10130
10131 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10132
10133 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10134 This is also needed for porting to any host where GC_MARK_STACK is
10135 not GC_MAKE_GCPROS_NOOPS.
10136 (which_symbols): Use it.
10137
10138 2011-11-07 Kenichi Handa <handa@m17n.org>
10139
10140 * coding.c (coding_set_destination): Check coding->src_pos only
10141 when coding->src_object is a buffer (bug#9910).
10142
10143 * process.c (send_process): Set the member src_multibyte of coding
10144 to 0 (bug#9911) when sending a unibyte text.
10145
10146 * callproc.c (Fcall_process): Set the member src_multibyte of
10147 process_coding to 0 (bug#9912).
10148
10149 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10150
10151 * xmenu.c (cleanup_widget_value_tree): New function.
10152 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10153 calling free_menubar_widget_value_tree directly (Bug#9830).
10154
10155 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10156
10157 Fix some portability problems with 'inline'.
10158 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10159 (window_box_width, window_box_left, window_box_left_offset)
10160 (window_box_right, window_box_right_offset): Declare extern.
10161 Otherwise, these inline functions do not conform to C99 and
10162 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10163 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10164 * intervals.c (adjust_intervals_for_insertion)
10165 (adjust_intervals_for_deletion): Now extern, because otherwise the
10166 extern inline functions 'offset_intervals' couldn't refer to it.
10167 (static_offset_intervals): Remove.
10168 (offset_intervals): Rewrite using the old contents of
10169 static_offset_intervals. The old version didn't conform to C99
10170 because an extern inline function contained a reference to an
10171 identifier with static linkage.
10172
10173 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10174
10175 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10176 GC.
10177
10178 2011-11-06 Eli Zaretskii <eliz@gnu.org>
10179
10180 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10181 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10182 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10183 return Qleft_to_right.
10184
10185 2011-11-06 Chong Yidong <cyd@gnu.org>
10186
10187 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10188 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10189 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10190 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10191 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10192 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10193 (Fwindow_vscroll): Doc fix.
10194 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10195 argument, since it makes no sense to pass a live window and for
10196 consistency with window-child.
10197
10198 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10199
10200 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10201 support MSVC.
10202
10203 2011-11-05 Jason Rumney <jasonr@gnu.org>
10204
10205 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10206 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10207 fonts (Bug#6029).
10208 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10209 bitwise arithmetic preventing use of unicode-sip and non-truetype
10210 opentype fonts.
10211
10212 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10213
10214 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10215 "emacs"-only part.
10216
10217 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10218 initialization code to keep similarity to xfns.c after changes
10219 from 2011-11-05.
10220
10221 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10222
10223 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10224 (unwind_create_frame): New function (Bug#9943).
10225 (Fx_create_frame): Restructure code to be more similar to the one in
10226 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10227 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10228 Move terminal->reference_count++ just before making the frame official
10229 (Bug#9943).
10230
10231 * nsterm.m (x_free_frame_resources): New function.
10232 (x_destroy_window): Move code to x_free_frame_resources.
10233
10234 * xfns.c (unwind_create_frame): Fix comment.
10235 (Fx_create_frame, x_create_tip_frame):
10236 Move terminal->reference_count++ just before making the frame
10237 official. Move initialization of image_cache_refcount and
10238 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10239
10240 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10241
10242 Support MSVC build with newer versions of Visual Studio.
10243 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10244 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10245 nt/gmake.defs.
10246
10247 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10248 which are not supported by MSVC.
10249 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10250 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10251 bitfields.
10252 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10253 types in bitfields.
10254 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10255
10256 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10257
10258 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
10259
10260 Support MSVC build with newer versions of Visual Studio.
10261 * w32.c: Don't include w32api.h for MSVC.
10262 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10263
10264 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10265 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10266 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10267 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10268 e_* cousins.
10269 (alloca) [_MSC_VER]: Define to _alloca.
10270
10271 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10272
10273 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10274
10275 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10276
10277 * xdisp.c (note_mouse_highlight): If either of
10278 previous/next-single-property-change returns nil, treat that as
10279 the beginning or the end of the buffer. (Bug#9955)
10280
10281 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10282
10283 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10284 label is not null (Bug#9951).
10285 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10286 may be NULL.
10287
10288 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10289
10290 * window.c (Fwindow_body_size): Mention in the doc string that the
10291 return value is in frame's canonical units. (Bug#9949)
10292
10293 2011-11-03 Eli Zaretskii <eliz@gnu.org>
10294
10295 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10296
10297 * w32fns.c (unwind_create_frame): If needed, free the glyph
10298 matrices of the partially constructed frame. (Bug#9943)
10299 * xfns.c (unwind_create_frame): Likewise.
10300
10301 2011-11-01 Eli Zaretskii <eliz@gnu.org>
10302
10303 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10304 Don't stop backward scan on the continuation glyph, even though
10305 its CHARPOS is positive.
10306 (mouse_face_from_buffer_pos, note_mouse_highlight):
10307 Rename cover_string to disp_string.
10308
10309 2011-11-01 Martin Rudalics <rudalics@gmx.at>
10310
10311 * window.c (temp_output_buffer_show): Don't use
10312 Vtemp_buffer_show_specifiers.
10313 (Vtemp_buffer_show_specifiers): Remove unused variable.
10314
10315 2011-10-30 Eli Zaretskii <eliz@gnu.org>
10316
10317 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10318 past the beginning of the current glyph matrix.
10319
10320 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
10321
10322 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10323 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10324 HAVE_GTK3 (Bug#9869).
10325
10326 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10327 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10328
10329 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10330
10331 * xterm.c: Declare x_handle_net_wm_state to return int.
10332 (handle_one_xevent): Check if we are iconified but don't have
10333 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10334 (get_current_wm_state): Return non-zero if not hidden,
10335 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10336 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10337 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10338 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10339
10340 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10341
10342 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10343 so that this new function doesn't get optimized away by a
10344 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10345
10346 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10347
10348 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10349
10350 2011-10-29 Eli Zaretskii <eliz@gnu.org>
10351
10352 Fix the `xbytecode' command.
10353 * .gdbinit (xprintbytestr): New command.
10354 (xwhichsymbols): Rename from `which'; all callers changed.
10355 (xbytecode): Print the byte-code string as well.
10356
10357 2011-10-29 Kim Storm <storm@cua.dk>
10358
10359 * alloc.c (which_symbols): New function.
10360
10361 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10362
10363 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10364 line. (Bug#9903)
10365
10366 2011-10-29 Glenn Morris <rgm@gnu.org>
10367
10368 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10369 Not clear what it was for, and it causes various bugs. (Bug#9839)
10370
10371 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10372
10373 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10374 possible random value that matches one of those tested as
10375 condition to clear the mouse face.
10376
10377 2011-10-28 Chong Yidong <cyd@gnu.org>
10378
10379 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10380
10381 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10382
10383 * window.c (make_window): Initialize phys_cursor_on_p.
10384
10385 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10386
10387 * lisp.h (struct Lisp_Symbol): Update comments.
10388
10389 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
10390
10391 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10392
10393 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10394
10395 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10396 <oslsachem@gmail.com> for helping to debug this.
10397
10398 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10399 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10400 (g_b_init_get_glyph_outline_w): New static variables.
10401 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10402 (GetGlyphOutlineW_Proc): New typedefs.
10403 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10404 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10405 New functions.
10406 (w32font_open_internal, compute_metrics):
10407 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10408 instead of calling the "wide" APIs directly.
10409
10410 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10411
10412 * w32.h (syms_of_w32font): Add prototype.
10413
10414 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10415
10416 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10417 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10418 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10419 (Fmove_to_window_line): Doc fix.
10420
10421 2011-10-27 Chong Yidong <cyd@gnu.org>
10422
10423 * process.c (make_process): Set gnutls_state to NULL.
10424
10425 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10426 non-NULL, regardless of GNUTLS_INITSTAGE.
10427 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10428 an error. Set process slots as soon as we allocate them.
10429
10430 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10431
10432 2011-10-27 Chong Yidong <cyd@gnu.org>
10433
10434 * gnutls.c (emacs_gnutls_deinit): New function.
10435 Deallocate credentials structures as well as calling gnutls_deinit.
10436 (Fgnutls_deinit, Fgnutls_boot): Use it.
10437
10438 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10439 (deactivate_process): Call emacs_gnutls_deinit.
10440
10441 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10442
10443 * image.c (x_create_x_image_and_pixmap):
10444 * w32.c (sys_rename, w32_delayed_load):
10445 * w32font.c (fill_in_logfont):
10446 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10447
10448 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10449
10450 * w32fns.c (w32_default_color_map): New function,
10451 extracted from Fw32_default_color_map.
10452 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10453
10454 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10455
10456 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10457
10458 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10459
10460 * keyboard.c (test_undefined): New function (bug#9751).
10461 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10462
10463 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10464
10465 * sysdep.c (init_sys_modes): Fix the check for the controlling
10466 terminal (Bug#6649).
10467
10468 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10469
10470 * dispextern.h (struct bidi_it): New member next_en_type.
10471
10472 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10473 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10474 current character, check also for next_en_type being WEAK_EN.
10475 (bidi_resolve_weak): Don't enter the expensive loop if the current
10476 position is before next_en_pos. Record the bidi type of the first
10477 non-ET, non-BN character we find, in addition to its position.
10478 (bidi_level_of_next_char): Invalidate next_en_type when
10479 next_en_pos is over-stepped.
10480
10481 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10482
10483 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10484 * editfns.c: Rewrite current-time-zone so that it invokes
10485 the equivalent of (format-time-string "%Z") to get the time zone name.
10486 This fixes a bug when the time zone name contains characters that
10487 need converting from the system time locale to Emacs internal format.
10488 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10489 that patch fixed format-time-string to do the conversion, but
10490 I forgot to fix current-time-zone.
10491 (format_time_string): New function, containing most of
10492 what Fformat_time_string used to contain.
10493 (Fformat_time_string): Rewrite in terms of format_time_string.
10494 This doesn't change this function's behavior.
10495 (current-time-zone): Rewrite to use format_time_string.
10496 This fixes the bug reported by Michael Schierl in
10497 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10498 Jason Rumney's 2007-06-07 change worked around this bug, but
10499 didn't fix it.
10500 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10501
10502 2011-10-19 Eli Zaretskii <eliz@gnu.org>
10503
10504 * xdisp.c (start_display): If the character at POS is displayed
10505 via a display vector, reset IT->current.dpvec_index to zero.
10506 (try_window_reusing_current_matrix): If a line ends in a display
10507 vector or the next line starts in a display vector, continue
10508 redrawing the window even though the character position of
10509 start_row was reached.
10510 (Bug#9771, part 2)
10511
10512 2011-10-18 Chong Yidong <cyd@gnu.org>
10513
10514 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10515 with nobreak-char-display too.
10516
10517 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10518
10519 Fix part 3 of bug#9771.
10520 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10521 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10522 non-neutral characters if the current character is a paragraph
10523 separator (a.k.a. Newline). This avoids running the same
10524 expensive loop twice, once when we consume the preceding newline
10525 and the other time when the line actually needs to be displayed.
10526 Avoid the loop when we see neutrals on the base embedding level
10527 following a character whose directionality is the same as the
10528 paragraph's. This avoids running the expensive loop when a line
10529 ends in a long sequence of neutrals, like control characters.
10530 Add assertion against STRONG_AL type. Slightly rearrange code
10531 that determines the type of a neutral given the first non-neutral
10532 that follows it.
10533 (bidi_level_of_next_char): Set next_en_pos to zero when
10534 invalidating its info.
10535
10536 2011-10-17 Eli Zaretskii <eliz@gnu.org>
10537
10538 * xdisp.c (push_display_prop): Determine whether to record string
10539 or buffer position by IT->string, not by IT->method. Allow
10540 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10541 (move_it_vertically_backward): Don't look for character position
10542 immediately after the newline when in a continuation line.
10543 (Bug#9771, part 1)
10544
10545 2011-10-15 Martin Rudalics <rudalics@gmx.at>
10546
10547 * window.c (coordinates_in_window): Rewrite and delabelize
10548 vertical border check. (Bug#5357) (Bug#9618)
10549
10550 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10551
10552 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10553 errors in XSetWindowBorder (bug#9310).
10554
10555 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10556
10557 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10558 avoid crash when xmalloc overrun checking is enabled.
10559
10560 2011-10-13 Eli Zaretskii <eliz@gnu.org>
10561
10562 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10563 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10564 cursor motion with <left> and <right> arrow keys.
10565
10566 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10567 some callers set that themselves.
10568
10569 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10570
10571 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10572 display string and the previous row comes from the same string and
10573 is empty. (Bug#9739) (Bug#9738)
10574
10575 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10576
10577 * doc.c (get_doc_string): Encode file name (bug#9735).
10578
10579 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10580
10581 * bidi.c (bidi_level_of_next_char):
10582 * xdisp.c (get_visually_first_element): Remove old incorrect
10583 comments regarding the Unicode Line Separator character.
10584
10585 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10586
10587 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10588
10589 * alloc.c (Fgc_status): Do not access beyond zombies array
10590 boundary if nzombies > MAX_ZOMBIES.
10591 * alloc.c (dump_zombies): Add missing format specifier.
10592
10593 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10594
10595 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10596 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10597
10598 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10599 Some packages use them to denote characters with modifiers.
10600
10601 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10602
10603 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10604 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10605 matching a pp-number. Rename parameter var to var1.
10606
10607 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10608
10609 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10610
10611 2011-10-08 Glenn Morris <rgm@gnu.org>
10612
10613 * callint.c (Fcall_interactively): Give a more explicit error for the
10614 'c' case with a non-character input. (Bug#8479)
10615
10616 2011-10-08 Eli Zaretskii <eliz@gnu.org>
10617
10618 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10619 lines.
10620 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10621 lines that are hscrolled on the left.
10622
10623 * dispnew.c (buffer_posn_from_coords): Account for a possible
10624 presence of header-line. (Bug#4426)
10625
10626 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10627
10628 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10629 Don't advertise functionality which we discourage or doesn't work.
10630
10631 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10632
10633 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10634 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10635 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10636 this makes Emacs dump core during garbage collection on rare
10637 occasions. sizeof is obviously inferior to offsetof here, so
10638 stick with offsetof.
10639 (GC_POINTER_ALIGNMENT): New macro.
10640 (mark_memory): Omit 3rd (offset) arg; caller changed.
10641 Don't assume EMACS_INT alignment is the same as pointer alignment.
10642
10643 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10644
10645 * keyboard.c (read_key_sequence_remapped): New var.
10646 (read_key_sequence): Compute remapping in the right buffer.
10647 (command_loop_1): Use read_key_sequence's remapping directly.
10648
10649 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10650
10651 * dired.c (file_name_completion): Don't expand file name.
10652 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10653 before checking file name handler.
10654
10655 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10656 they've been requested explicitly (bug#9591).
10657
10658 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
10659
10660 * keymap.c (Fsingle_key_description): Use make_specified_string
10661 instead of build_string to build string from push_key_description.
10662 (Bug#5193)
10663
10664 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10665
10666 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10667 This fixes a Y2038 bug on 64-bit hosts.
10668 * buffer.c (reset_buffer):
10669 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10670 (Fclear_buffer_auto_save_failure):
10671 Use 0, not -1, to represent an unset failure time, since time_t
10672 might not be signed.
10673
10674 Remove dependency on glibc malloc internals.
10675 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10676 Move back here from lisp.h, but with their new implementations.
10677 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10678 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10679 * charset.c (charset_table_init): New static var.
10680 (syms_of_charset): Use it instead of xmalloc. This removes a
10681 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10682 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10683 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10684 Move back to alloc.c.
10685 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10686 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10687
10688 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10689
10690 * nsterm.m (windowDidResize): Call x_set_window_size only when
10691 ns_in_resize is true. Otherwise set pixelwidth/height and
10692 call change_frame_size (Bug#9628).
10693
10694 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10695
10696 Port --enable-checking=all to Fedora 14 x86-64.
10697 * charset.c (syms_of_charset): Also account for glibc malloc's
10698 internal overhead when calculating the initial malloc maximum.
10699
10700 Port --enable-checking=all to Fedora 14 x86.
10701 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10702 Move to lisp.h.
10703 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10704 (overrun_check_realloc, overrun_check_free):
10705 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10706 That way, xmalloc returns a properly-aligned pointer even if
10707 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10708 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10709 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10710 into account when calculating the initial malloc maximum.
10711 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10712 Move here from alloc.c, so that charset.c can use it too.
10713 Properly align; the old code wasn't right for common 32-bit hosts
10714 when configured with --enable-checking=all.
10715 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10716 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10717
10718 2011-09-29 Eli Zaretskii <eliz@gnu.org>
10719
10720 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10721 use EDOM.
10722
10723 2011-09-28 Eli Zaretskii <eliz@gnu.org>
10724
10725 * xdisp.c (compute_display_string_end): If there's no display
10726 string at CHARPOS, return -1.
10727
10728 * bidi.c (bidi_fetch_char): When compute_display_string_end
10729 returns a negative value, treat the character as a normal
10730 character not covered by a display string. (Bug#9624)
10731
10732 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
10733
10734 * lread.c (Fread_from_string): Fix typo in docstring.
10735
10736 2011-09-27 Eli Zaretskii <eliz@gnu.org>
10737
10738 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10739 newline, reseat the iterator instead of bidi-iterating there one
10740 character at a time. (Bug#9610)
10741 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10742 TO_CHARPOS if the bidi iterator is at base embedding level.
10743
10744 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10745
10746 * lread.c (readevalloop): Use correct code for NBSP.
10747 (read1): Likewise. (Bug#9608)
10748
10749 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
10750
10751 * dbusbind.c (Fdbus_register_signal): When service is not
10752 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10753
10754 2011-09-25 Glenn Morris <rgm@gnu.org>
10755
10756 * buffer.c (truncate-lines): Doc fix.
10757
10758 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
10759
10760 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10761 (Fset_window_next_buffers): Doc fix.
10762
10763 2011-09-24 Glenn Morris <rgm@gnu.org>
10764
10765 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10766
10767 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10768
10769 Fix minor problems found by static checking.
10770 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10771 * indent.c (Fvertical_motion): Fix == vs = typo.
10772
10773 2011-09-24 Eli Zaretskii <eliz@gnu.org>
10774
10775 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10776 Default value is now t. Doc fix.
10777
10778 * indent.c (Fvertical_motion): Compute and apply the overshoot
10779 logic when moving up, not only when moving down. Fix the
10780 confusing name and values of the it_overshoot_expected variable;
10781 logic changes accordingly. (Bug#9254) (Bug#9549)
10782
10783 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10784 CHARPOS is covered by a display string which includes newlines.
10785 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10786 is covered by a display string with embedded newlines.
10787
10788 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
10789
10790 * dbusbind.c (Fdbus_register_signal): Add match rule to
10791 Vdbus_registered_objects_table. (Bug#9581)
10792 (Fdbus_register_method, Vdbus_registered_objects_table):
10793 Fix docstring.
10794
10795 2011-09-24 Jim Meyering <meyering@redhat.com>
10796
10797 do not ignore write error for any output size
10798 The previous change was incomplete.
10799 While it makes emacs --batch detect the vast majority of stdout
10800 write failures, errors were still ignored whenever the output size is
10801 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10802 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10803 && echo FAIL: ignored write error
10804 FAIL: ignored write error
10805 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10806 && echo FAIL: ignored write error
10807 FAIL: ignored write error
10808 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10809
10810 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10811
10812 * emacs.c (Fkill_emacs): In noninteractive mode exit
10813 non-successfully if a write error occurred on stdout. (Bug#9574)
10814
10815 2011-09-21 Eli Zaretskii <eliz@gnu.org>
10816
10817 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10818 the xassert test.
10819
10820 * dispextern.h (struct it): Update the comment documenting what
10821 can it->OBJECT be.
10822
10823 2011-09-20 Eli Zaretskii <eliz@gnu.org>
10824
10825 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10826 a display string, extend search for cursor position to end of row.
10827 (find_row_edges): If the row ends in a newline from a display
10828 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10829 Handle the case of a display string with multiple newlines.
10830 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10831 non-empty line. Fixes confusing cursor motion with arrow keys at
10832 the beginning of a line that starts with whitespace.
10833
10834 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10835
10836 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10837 (bug#9493).
10838
10839 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
10840
10841 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10842 boolean (Bug#9154).
10843
10844 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10845
10846 * xdisp.c (display_line): Record maximum and minimum buffer
10847 positions even if no glyphs were produced (e.g., by a zero-width
10848 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10849 buffer positions that will be removed from the glyph row because
10850 they don't fit.
10851 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10852 column is beyond frame width: don't subtract 1 "pixel" when
10853 computing width of the stretch.
10854 (reseat_at_next_visible_line_start): Undo the change made on
10855 2011-09-17 that saved paragraph information and restored it after
10856 the call to `reseat'. (Bug#9545)
10857
10858 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10859
10860 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10861 and turn window cursor on if cleared (Bug#9415).
10862
10863 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10864
10865 * search.c (boyer_moore): Take unibyte characters from pattern
10866 literally. (Bug#9458)
10867
10868 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10869
10870 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10871
10872 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10873
10874 Fix minor problem found by static checking.
10875 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10876 initialized, to pacify gcc -Wuninitialized.
10877
10878 * fileio.c: Report proper errno when syscall falls.
10879 (Finsert_file_contents): Save and restore errno,
10880 so that report_file_error outputs the correct diagnostic.
10881 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10882
10883 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10884
10885 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10886
10887 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10888
10889 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10890 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10891
10892 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10893
10894 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10895 about the current paragraph and restore it after the call to reseat.
10896
10897 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10898 (bidi_find_paragraph_start): Search back for paragraph beginning
10899 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10900 (bidi_move_to_visually_next): Only trigger paragraph-related
10901 computations when the last character is a newline or at EOB, not
10902 just any NEUTRAL_B. (Bug#9470)
10903
10904 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10905 truncated lines if point is covered by a display string. (Bug#9524)
10906
10907 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10908
10909 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10910 (cons_to_x_long): New function.
10911 (lisp_data_to_selection_data): Use it. Correct the test for
10912 short-versus-long data; it was negated. Break out of vector
10913 loop, for efficiency, when a long datum is discovered.
10914
10915 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10916
10917 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10918
10919 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10920
10921 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10922 GCC PR/17406) by declaring this function with external scope.
10923
10924 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10925
10926 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10927 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10928
10929 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10930
10931 * editfns.c (Fformat): Correctly handle text properties on "%%".
10932
10933 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10934
10935 * xterm.c (x_draw_composite_glyph_string_foreground):
10936 * w32term.c (x_draw_composite_glyph_string_foreground):
10937 * term.c (encode_terminal_code):
10938 * composite.c (composition_update_it, get_composition_id):
10939 * xdisp.c (get_next_display_element)
10940 (fill_composite_glyph_string): Add comments about special meaning
10941 of TAB characters in a composition.
10942
10943 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10944
10945 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10946 This occurs when processing a multibyte format.
10947 Problem reported by Wolfgang Jenker.
10948
10949 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10950
10951 * xdisp.c (try_cursor_movement): Only check for exact match if
10952 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10953
10954 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10955
10956 Remove unused external symbols.
10957 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10958 * xdisp.c (calc_pixel_width_or_height): Now static.
10959 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10960 * indent.c (check_display_width):
10961 * w32term.c: Fix comment to match code.
10962 * xterm.c, xterm.h (x_catching_errors): Remove.
10963
10964 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10965
10966 * xselect.c: Use signed conversions more consistently (Bug#9498).
10967 (selection_data_to_lisp_data): Assume incoming selection data are
10968 signed integers, not unsigned. This is to be consistent with
10969 outgoing selection data, which was modified to use signed integers
10970 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10971 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10972 expects long, not unsigned long.
10973
10974 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10975
10976 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10977 computation of loop end. Reported by Johan Bockgård
10978 <bojohan@gnu.org>.
10979
10980 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10981
10982 * frame.c (Fother_visible_frames_p): Function deleted.
10983
10984 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10985
10986 * indent.c (compute_motion): Process display vector front to back
10987 rather than the other way around. (Bug#2496)
10988
10989 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10990
10991 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10992
10993 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10994
10995 * minibuf.c (Fread_from_minibuffer): Doc fix.
10996
10997 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10998
10999 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11000 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11001
11002 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11003
11004 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11005 value for non-existent files.
11006
11007 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11008
11009 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11010 set its "size" to -1. This will set the modtime_size field of
11011 the corresponding buffer to -1, which is what
11012 verify-visited-file-modtime expects for files that do not exist.
11013 (Bug#9139)
11014
11015 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11016
11017 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11018 here ...
11019 * lisp.h: ... from here. push_key_description is no longer
11020 defined in keyboard.c, so its declaration should not be in
11021 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11022 logically belongs with push_key_description.
11023
11024 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11025
11026 * buffer.h: Include <sys/types.h> instead of <time.h>.
11027 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11028 Problem reported by Herbert J. Skuhra.
11029
11030 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11031
11032 * xml.c (parse_region): Make the parsing work for
11033 non-comment-starting XML files again (bug#9144).
11034
11035 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11036
11037 * image.c (gif_load): Fix calculation of bottom and right corner.
11038 (Bug#9468)
11039
11040 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11041
11042 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11043 redisplay in small windows.
11044
11045 2011-09-09 Eli Zaretskii <eliz@gnu.org>
11046
11047 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11048
11049 2011-09-08 Martin Rudalics <rudalics@gmx.at>
11050
11051 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11052 Operate on live windows only.
11053
11054 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
11055
11056 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11057
11058 2011-09-07 Eli Zaretskii <eliz@gnu.org>
11059
11060 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11061 only under bidi iteration.
11062
11063 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11064
11065 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11066
11067 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11068
11069 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11070 Without this fix, the command to link temacs failed due to an
11071 undefined symbol __builtin_isnan. This is because
11072 /usr/include/iso/math_c99.h #defines isnan(x) to
11073 __builtin_isnan(x), but the bundled gcc, which identifies itself
11074 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11075 a __builtin_isnan.
11076 * floatfns.c (isnan): #undef, and then #define to a clone of
11077 what's in data.c.
11078 (Fisnan): Always define, since it's always available now.
11079 (syms_of_floatfns): Always define isnan at the Lisp level.
11080
11081 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11082
11083 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11084
11085 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11086
11087 * fileio.c: Fix bugs with large file offsets (Bug#9428).
11088 The previous code assumed that file offsets (off_t values) fit in
11089 EMACS_INT variables, which is not true on typical 32-bit hosts.
11090 The code messed up by falsely reporting buffer overflow in cases
11091 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11092 when "big" contains more than 2**29 bytes, even though this
11093 inserts just one byte and does not overflow the buffer.
11094 (Finsert_file_contents): Store file offsets as off_t
11095 values, not as EMACS_INT values. Check for overflow when
11096 converting between EMACS_INT and off_t. When checking for
11097 buffer overflow or for overlap, take the offsets into account.
11098 Don't use EMACS_INT for small values where int suffices.
11099 When checking for overlap, fix a typo: ZV was used where
11100 ZV_BYTE was intended.
11101 (Fwrite_region): Don't assume off_t fits into 'long'.
11102 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11103
11104 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
11105
11106 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11107
11108 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11109
11110 sprintf-related integer and memory overflow issues (Bug#9412).
11111
11112 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11113 (esprintf, exprintf, evxprintf): New functions.
11114 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11115 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11116 (modify_event_symbol): Do not assume that the length of
11117 name_alist_or_stem is safe to alloca and fits in int.
11118 (Fexecute_extended_command): Likewise for function name and binding.
11119 (Frecursion_depth): Wrap around reliably on integer overflow.
11120 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11121 since some callers pass EMACS_INT values.
11122 (Fsingle_key_description): Don't crash if symbol name contains more
11123 than MAX_ALLOCA bytes.
11124 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11125 (get_minibuffer): Arg is now EMACS_INT, not int.
11126 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11127 (esprintf, exprintf, evxprintf): New decls.
11128 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11129
11130 * dbusbind.c (signature_cat): New function.
11131 (xd_signature, Fdbus_register_signal):
11132 Do not overrun buffer; instead, report string overflow.
11133
11134 * dispnew.c (add_window_display_history): Don't overrun buffer.
11135 Truncate instead; this is OK since it's just a log.
11136
11137 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11138 even if the time zone offset is outlandishly large.
11139 Don't mishandle offset == INT_MIN.
11140
11141 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11142 when creating daemon; the previous buffer-overflow check was incorrect.
11143
11144 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11145 which has the guts of the old verror function.
11146
11147 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11148 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11149
11150 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11151 (font_unparse_xlfd): Don't blindly alloca long strings.
11152 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11153 fits in int, when using sprintf. Use single snprintf to count
11154 length of string rather than counting it via multiple sprintfs;
11155 that's simpler and more reliable.
11156 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11157 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11158 sprintf, in case result does not fit in int.
11159
11160 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11161 (fontset_from_font): Print it.
11162
11163 * frame.c (tty_frame_count): Now printmax_t, not int.
11164 (make_terminal_frame, set_term_frame_name): Print it.
11165 (x_report_frame_params): In X, window IDs are unsigned long,
11166 not signed long, so print them as unsigned.
11167 (validate_x_resource_name): Check for implausibly long names,
11168 and don't assume name length fits in 'int'.
11169 (x_get_resource_string): Don't blindly alloca invocation name;
11170 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11171 not fit in int.
11172
11173 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11174 (xg_check_special_colors, xg_set_geometry):
11175 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11176
11177 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11178 Use esprintf, not sprintf, in case result does not fit in int.
11179
11180 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11181 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11182 it as a large positive number.
11183 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11184 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11185
11186 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11187 in case result does not fit in int.
11188
11189 * print.c (float_to_string): Detect width overflow more reliably.
11190 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11191 buffer overrun. Don't assume list length fits in 'int'. Treat
11192 print length of 0 as 0, not as infinity; to be consistent with other
11193 uses of print length in this function. Don't overflow print length
11194 index. Don't assume hash table size fits in 'long', or that
11195 vectorlike size fits in 'unsigned long'.
11196
11197 * process.c (make_process): Use printmax_t, not int, to format
11198 process-name gensyms.
11199
11200 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11201
11202 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11203 to avoid potential buffer overrun.
11204
11205 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11206 if X resource line is longer than 512 bytes.
11207
11208 * xfns.c (x_window): Make sprintf buffer a bit bigger
11209 to avoid potential buffer overrun.
11210
11211 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11212
11213 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11214
11215 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11216
11217 Integer overflow fixes for scrolling, etc.
11218 Without these, Emacs silently mishandles large integers sometimes.
11219 For example, "C-u 4294967297 M-x recenter" was treated as if
11220 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11221
11222 * xdisp.c (try_window_id): Check Emacs fixnum range before
11223 converting to 'int'.
11224
11225 * window.c (window_scroll_line_based, Frecenter):
11226 Check that an Emacs fixnum is in range before assigning it to 'int'.
11227 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11228 values converted from Emacs fixnums.
11229 (Frecenter): Don't wrap around a line count if it is out of 'int'
11230 range; instead, treat it as an extreme value.
11231 (Fset_window_configuration, compare_window_configurations):
11232 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11233
11234 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11235 that can exceed INT_MAX. Check that EMACS_INT value is in range
11236 before assigning it to the (possibly-narrower) index.
11237 (match_limit): Don't assume that a fixnum can fit in 'int'.
11238
11239 * print.c (print_object): Use ptrdiff_t, not int, for index that can
11240 exceed INT_MAX.
11241
11242 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11243 (Fvertical_motion): Don't wrap around LINES values that don't fit
11244 in 'int'. Instead, treat them as extreme values. This is good
11245 enough for windows, which can't have more than INT_MAX lines anyway.
11246
11247 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11248
11249 * Require libxml/parser.h to avoid compilation warning.
11250
11251 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11252
11253 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11254 since this reportedly can destroy thread storage.
11255
11256 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
11257
11258 * syntax.c (find_defun_start): Update all cache variables if
11259 exiting early (Bug#9401).
11260
11261 2011-08-30 Eli Zaretskii <eliz@gnu.org>
11262
11263 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11264
11265 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11266 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11267 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11268
11269 * term.c (tty_append_glyph): New function.
11270 (produce_stretch_glyph): Static function and its prototype deleted.
11271
11272 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11273 Add prototypes.
11274
11275 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11276
11277 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11278 when checking :margin (Bug#9390).
11279 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11280 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11281 so that the name doesn't mislead. All uses changed.
11282
11283 2011-08-28 Johan Bockgård <bojohan@gnu.org>
11284
11285 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11286 set_tty_hooks.
11287
11288 2011-08-27 Eli Zaretskii <eliz@gnu.org>
11289
11290 * xdisp.c (move_it_to): Don't bail out early when reaching
11291 position beyond to_charpos, if we are scanning backwards.
11292 (move_it_vertically_backward): When DY == 0, make sure we get to
11293 the first character in the line after the newline.
11294
11295 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11296
11297 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11298 (ccl_driver): Do not generate an out-of-range pointer.
11299 (Fccl_execute_on_string): Remove unnecessary check for
11300 integer overflow, noted by Stefan Monnier in
11301 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11302 Remove a FIXME that didn't need fixing.
11303 Simplify the newly-introduced buffer reallocation code.
11304
11305 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
11306
11307 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11308
11309 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
11310
11311 Integer and memory overflow issues (Bug#9196).
11312
11313 * doc.c (get_doc_string): Rework so that
11314 get_doc_string_buffer_size is the actual buffer size, rather than
11315 being 1 less than the actual buffer size; this makes xpalloc more
11316 convenient.
11317
11318 * image.c (x_allocate_bitmap_record, cache_image):
11319 * xselect.c (Fx_register_dnd_atom):
11320 Simplify previous changes by using xpalloc.
11321
11322 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11323 since either will do and ptrdiff_t is convenient with xpalloc.
11324
11325 * charset.c (charset_table_size)
11326 (struct charset_sort_data.priority): Now ptrdiff_t.
11327 (charset_compare): Don't overflow if priorities differ greatly.
11328 (Fsort_charsets): Don't assume list length fits in int.
11329 Check for size-calculation overflow when allocating sort data.
11330 (syms_of_charset): Allocate an initial charset table that is
11331 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11332
11333 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11334
11335 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11336 The actual value is always <= INT_MAX, and leaving it unsigned made
11337 overflow checking harder.
11338
11339 * dispextern.h (struct glyph_matrix.rows_allocated)
11340 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11341 with xpalloc. The values are still always <= INT_MAX.
11342
11343 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11344
11345 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11346 (SAFE_NALLOCA): New macro.
11347
11348 * region-cache.c (struct boundary.pos, find_cache_boundary)
11349 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11350 (set_cache_region, invalidate_region_cache)
11351 (revalidate_region_cache, know_region_cache, region_cache_forward)
11352 (region_cache_backward, pp_cache):
11353 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11354 so that ptrdiff_t * can be passed to xpalloc.
11355 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11356 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11357 (pp_cache): Don't assume cache_len fits in int.
11358 * region-cache.h: Adjust extern decls to match.
11359
11360 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11361 EMACS_INT, since either will do, for xpalloc.
11362
11363 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11364 (xnmalloc, xnrealloc, xpalloc): New functions.
11365
11366 * bidi.c (bidi_shelve_header_size): New constant.
11367 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11368 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11369
11370 * bidi.c (bidi_cache_shrink):
11371 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11372 (overlay_strings):
11373 Don't update size of array until after memory allocation succeeds,
11374 because xmalloc/xrealloc may not return.
11375 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11376 now that we have proper integer overflow checking.
11377 (record_overlay_string, overlay_strings): Catch overflows when
11378 calculating size of overlay_str_buf.
11379
11380 * callproc.c (Fcall_process): Check for size overflow when
11381 calculating size of args2.
11382 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11383 Normally we prefer signed values, but sticking with ptrdiff_t would
11384 require adding more-complicated checks.
11385
11386 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11387 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11388 Redo buffer-overflow calculations to avoid integer overflow.
11389 Add a FIXME comment where memory seems to be over-allocated.
11390
11391 * character.c (Fstring): Check for size-calculation overflow.
11392
11393 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11394 unnecessary integer overflow. Check for size overflow.
11395 (encode_coding_object): Don't update size until xmalloc succeeds.
11396
11397 * composite.c (get_composition_id): Check for overflow in glyph
11398 length calculations.
11399
11400 Integer and memory overflow fixes for display code.
11401 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11402 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11403 (scrolling_window): Check for overflow in size calculations.
11404 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11405 Don't assume glyph table len fits in int.
11406 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11407 (row_table_size): Now ptrdiff_t, not int.
11408 (scrolling_window): Avoid overflow in size calculations.
11409 Don't update size until allocation succeeds.
11410 * fns.c (concat): Check for overflow in size calculations.
11411 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11412 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11413 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11414
11415 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11416 (get_doc_string): Check for size calculation overflow.
11417 Don't update size until allocation succeeds.
11418 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11419 EMACS_INT, where ptrdiff_t will do.
11420 (Fsubstitute_command_keys): Check for string overflow.
11421
11422 * editfns.c (set_time_zone_rule): Don't assume environment length
11423 fits in int.
11424 (message_length): Now ptrdiff_t, not int.
11425 (Fmessage_box): Don't update size until allocation succeeds.
11426 Don't assume message length fits in int.
11427 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11428
11429 * emacs.c (main): Do not reallocate argv, since there is a null at
11430 the end that can be overwritten, and this way there's no need to
11431 worry about size-calculation overflow.
11432 (sort_args): Check for size-calculation overflow.
11433
11434 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11435 alloc succeeds.
11436 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11437
11438 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11439 (x_set_scroll_bar_width, x_figure_window_size):
11440 Check for integer overflow.
11441 (x_set_alpha): Do not assume XINT fits in int.
11442
11443 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11444 This is for the members text_lines, text_cols, total_lines, total_cols,
11445 where the system imposes an 'int' limit.
11446
11447 * fringe.c (Fdefine_fringe_bitmap):
11448 Don't update size until alloc works.
11449
11450 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11451 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11452
11453 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11454 Check for size-calculation overflow.
11455 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11456 do, as we prefer signed integers.
11457 (id_to_widget.max_size, id_to_widget.used)
11458 (xg_store_widget_in_map, xg_remove_widget_from_map)
11459 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11460 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11461 Use and return ptrdiff_t, not int.
11462 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11463 * gtkutil.h: Change prototypes to match the above.
11464
11465 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11466 are duplicate now that they've been promoted to lisp.h.
11467 (x_allocate_bitmap_record, x_alloc_image_color)
11468 (make_image_cache, cache_image, xpm_load):
11469 Don't update size until alloc is done.
11470 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11471 (x_detect_edges):
11472 Check for size calculation overflow.
11473 (ct_colors_allocated_max): New constant.
11474 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11475 overflow.
11476
11477 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11478 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11479 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11480 Use ptrdiff_t, not int, to count maps.
11481 (read_char_minibuf_menu_prompt): Check for overflow in size
11482 calculations. Don't update size until allocation succeeds.
11483 Redo calculations to avoid overflow.
11484 * keyboard.h: Change prototypes to match the above.
11485
11486 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11487 to count maps.
11488 (current_minor_maps): Check for size calculation overflow.
11489 * keymap.h: Change prototypes to match the above.
11490
11491 * lread.c (read1, init_obarray): Don't update size until alloc done.
11492
11493 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11494 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11495
11496 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11497 Now ptrdiff_t, not int.
11498 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11499 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11500
11501 * process.c (Fnetwork_interface_list): Check for overflow
11502 in size calculation.
11503
11504 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11505
11506 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11507 overflow. Don't bother calling xmalloc when xrealloc will do.
11508
11509 * search.c (Freplace_match): Check for size calculation overflow.
11510 (Fset_match_data): Don't assume list lengths fit in 'int'.
11511
11512 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11513 for command line length. Do not attempt to address one before the
11514 beginning of an array, as that's not portable.
11515
11516 * term.c (max_frame_lines): Remove; unused.
11517 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11518 not int.
11519 (encode_terminal_code, calculate_costs): Check for size
11520 calculation overflow.
11521 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11522 table lengths and related sizes. Don't update size until alloc
11523 done. Redo calculations to avoid overflow.
11524 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11525
11526 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11527 subtracting pointers.
11528 (gobble_line): Check for overflow more carefully. Don't update size
11529 until alloc done.
11530
11531 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11532 Don't update size until alloc done.
11533 Redo size calculations to avoid overflow.
11534 Check for size calculation overflow.
11535 (main) [DEBUG]: Fix typo in invoking tparam1.
11536
11537 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11538 Use ptrdiff_t, not int, for sizes.
11539 (store_mode_line_noprop_char): Don't update size until alloc done.
11540
11541 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11542 Use ptrdiff_t, not int, for sizes.
11543 (Finternal_make_lisp_face, cache_face):
11544 Check for size calculation overflow.
11545 (cache_face): Treat size calculation overflows as if they were
11546 memory exhaustion (the usual treatment), rather than aborting.
11547
11548 * xfns.c (x_encode_text, x_set_name_internal)
11549 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11550 sizes, since they can exceed INT_MAX in size. Check for size
11551 calculation overflow.
11552
11553 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11554 (xg_select): Check for size calculation overflow.
11555 Don't update size until alloc done.
11556
11557 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11558 as sprintf is limited to int lengths.
11559
11560 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11561 (X_LONG_MIN): New macros.
11562 Use them to make the following changes clearer.
11563 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11564 This change doesn't affect the value now, but it may help remind
11565 future maintainers not to raise the value too much later.
11566 (SELECTION_QUANTUM): Remove, replacing with ...
11567 (selection_quantum): ... new function, which avoids overflow.
11568 All uses changed.
11569 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11570 assumption that selection length fits in 'int'.
11571 (x_reply_selection_request, x_handle_selection_request)
11572 (x_get_window_property, receive_incremental_selection)
11573 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11574 (lisp_data_to_selection_data, clean_local_selection_data):
11575 Use ptrdiff_t, not int, to record length of selection.
11576 (x_reply_selection_request, x_get_window_property)
11577 (receive_incremental_selection, x_property_data_to_lisp):
11578 Redo calculations to avoid overflow.
11579 (x_reply_selection_request): When sending hint, ceiling it at
11580 X_LONG_MAX rather than relying on wraparound overflow to send
11581 something.
11582 (x_get_window_property, receive_incremental_selection)
11583 (lisp_data_to_selection_data, x_property_data_to_lisp):
11584 Check for size-calculation overflow.
11585 (x_get_window_property, receive_incremental_selection)
11586 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11587 Don't store size until memory allocation succeeds.
11588 (x_get_window_property): Plug memory leak on memory exhaustion.
11589 Don't double-block input; malloc is safe here. Don't assume 2**34
11590 - 4 fits in unsigned long. Add an xassert to check
11591 XGetWindowProperty overflow. Be more careful about overflow
11592 calculations, and distinguish size from memory overflow better.
11593 (receive_incremental_selection): When tracing, don't assume
11594 unsigned int is less than INT_MAX.
11595 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11596 harmful) conversions of unsigned short to int.
11597 (lisp_data_to_selection_data): Don't assume that integers
11598 in the range -65535 through -1 fit in an X unsigned short.
11599 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11600 result parameters unless successful. Rely on cons_to_unsigned
11601 to report problems with elements; the old code wasn't right anyway.
11602 (x_check_property_data): Check for int overflow; we cannot use
11603 a wider type due to X limits.
11604 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11605
11606 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11607
11608 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11609 (x_term_init): Check for size calculation overflow.
11610 (x_color_cells): Don't store size until memory allocation succeeds.
11611 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11612 Don't assume alloca size is less than MAX_ALLOCA.
11613 (x_term_init): Don't assume length fits in int (sprintf is limited
11614 to int size).
11615
11616 Use ptrdiff_t for composition IDs.
11617 * character.c (lisp_string_width):
11618 * composite.c (composition_table_size, n_compositions)
11619 (get_composition_id, composition_gstring_from_id):
11620 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11621 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11622 * window.c (Frecenter):
11623 Use ptrdiff_t, not int, for composition IDs.
11624 * composite.c (get_composition_id): Check for integer overflow.
11625 * composite.h: Adjust prototypes to match the above changes.
11626
11627 Use ptrdiff_t for hash table indexes.
11628 * category.c (hash_get_category_set):
11629 * ccl.c (ccl_driver):
11630 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11631 * coding.c (coding_system_charset_list, detect_coding_system):
11632 * coding.h (struct coding_system.id):
11633 * composite.c (get_composition_id, gstring_lookup_cache):
11634 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11635 * image.c (xpm_get_color_table_h):
11636 * lisp.h (hash_lookup, hash_put):
11637 * minibuf.c (Ftest_completion):
11638 Use ptrdiff_t for hash table indexes, not int (which is too
11639 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11640 32-bit --with-wide-int hosts).
11641
11642 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11643 Add a FIXME comment about memory leaks.
11644 (syms_of_charset): Don't assume xmalloc returns.
11645
11646 Don't assume that stated character widths fit in int.
11647 * character.c (Fchar_width, c_string_width, lisp_string_width):
11648 * character.h (CHAR_WIDTH):
11649 * indent.c (MULTIBYTE_BYTES_WIDTH):
11650 Use sanitize_char_width to avoid undefined and/or bad behavior
11651 with outlandish widths.
11652 * character.h (sanitize_tab_width): Rename from sanitize_width,
11653 now that we have two such functions. All uses changed.
11654 (sanitize_char_width): New inline function.
11655
11656 Don't assume that tab-width fits in int.
11657 * character.h (sanitize_width): New inline function.
11658 (SANE_TAB_WIDTH): New macro.
11659 (ASCII_CHAR_WIDTH): Use it.
11660 * indent.c (sane_tab_width): Remove. All uses replaced by
11661 SANE_TAB_WIDTH (current_buffer).
11662 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11663
11664 * fileio.c: Integer overflow issues with file modes.
11665 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11666
11667 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11668 Remove unreachable code.
11669 (read_hex, load_charset_map_from_file): Check for integer overflow.
11670
11671 * xterm.c: Don't go over XClientMessageEvent limit.
11672 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11673 (x_send_scroll_bar_event): Likewise. Check that the size does not
11674 exceed limits imposed by XClientMessageEvent, as well as the usual
11675 ptrdiff_t and size_t limits.
11676
11677 * keyboard.c: Overflow, signedness and related fixes.
11678 (make_lispy_movement): Use same integer type in forward decl
11679 that is used in the definition.
11680 (read_key_sequence, keyremap_step):
11681 Change bufsize argument back to int, undoing my 2011-03-30 change.
11682 We prefer signed types, and int is wide enough here.
11683 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11684 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11685 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11686 length, not size_t. Use ptrdiff_t for index, not int.
11687 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11688 possibility of integer overflow.
11689
11690 Overflow, signedness and related fixes for images.
11691
11692 * dispextern.h (struct it.stack[0].u.image.image_id)
11693 (struct_it.image_id, struct image.id, struct image_cache.size)
11694 (struct image_cache.used, struct image_cache.ref_count):
11695 * gtkutil.c (update_frame_tool_bar):
11696 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11697 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11698 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11699 * nsmenu.m (update_frame_tool_bar):
11700 * xdisp.c (calc_pixel_width_or_height):
11701 * xfns.c (image_cache_refcount):
11702 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11703 on typical 64-bit hosts.
11704
11705 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11706 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11707 Omit unnecessary casts to int.
11708 (parse_image_spec): Check that integers fall into 'int' range
11709 when the callers expect that.
11710 (image_ascent): Redo ascent calculation to avoid int overflow.
11711 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11712 (lookup_image): Remove unnecessary tests.
11713 (xbm_image_p): Locals are now of int, not EMACS_INT,
11714 since parse_image_check makes sure they fit into int.
11715 (png_load, gif_load, svg_load_image):
11716 Prefer int to unsigned where either will do.
11717 (tiff_handler): New function, combining the cores of the
11718 old tiff_error_handler and tiff_warning_handler.
11719 This function is rewritten to use vsnprintf and thereby avoid
11720 stack buffer overflows. It uses only the features of vsnprintf
11721 that are common to both POSIX and native Microsoft.
11722 (tiff_error_handler, tiff_warning_handler): Use it.
11723 (tiff_load, gif_load, imagemagick_load_image):
11724 Don't assume :index value fits in 'int'.
11725 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11726 (imagemagick_load_image): Check that crop parameters fit into
11727 the integer types that MagickCropImage accepts. Don't assume
11728 Vimagemagick_render_type has a nonnegative value. Don't assume
11729 size_t fits in 'long'.
11730 (gs_load): Use printmax_t to print the widest integers possible.
11731 Check for integer overflow when computing image height and width.
11732
11733 2011-08-26 Eli Zaretskii <eliz@gnu.org>
11734
11735 * xdisp.c (redisplay_window): Don't force window start if point
11736 will be invisible in the resulting window. (Bug#9324)
11737
11738 2011-08-25 Eli Zaretskii <eliz@gnu.org>
11739
11740 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11741 the display spec is of the form `(space ...)'.
11742 (handle_display_spec): Return the value returned by
11743 handle_single_display_spec, not just 1 or zero.
11744 (handle_single_display_spec): If the display spec is of the form
11745 `(space ...)', and specifies display in the text area, return 2
11746 rather than 1.
11747 (try_cursor_movement): Check for the need to scroll more
11748 accurately, and prefer exact match for point under bidi.
11749 Don't advance `row' beyond the last row of the window.
11750
11751 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11752 into disp_prop; all users changed.
11753
11754 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11755 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11756 for the text covered by the display property.
11757
11758 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
11759
11760 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11761 Change return value to nil.
11762 (Frecord_buffer): Delete unused function.
11763
11764 2011-08-24 Eli Zaretskii <eliz@gnu.org>
11765
11766 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11767 buffers, return left-to-right.
11768 (set_cursor_from_row): Consider candidate row a win if its glyph
11769 represents a newline and point is on that newline. Fixes cursor
11770 positioning on the newline at EOL of R2L text within L2R
11771 paragraph, and vice versa.
11772 (try_cursor_movement): Check continued rows, in addition to
11773 continuation rows. Fixes unwarranted scroll when point enters a
11774 continued line of R2L text within an L2R paragraph, or vice versa.
11775 (cursor_row_p): Consider the case of point being equal to
11776 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11777 from the end of a short line to the beginning of a continued line
11778 of R2L text within L2R paragraph.
11779 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11780 composed characters.
11781
11782 * bidi.c (bidi_check_type): Use xassert.
11783 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11784 members.
11785
11786 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11787
11788 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11789 a character.
11790
11791 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
11792
11793 * nsfont.m (ns_otf_to_script): Fix typo.
11794
11795 2011-08-22 Kenichi Handa <handa@m17n.org>
11796
11797 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11798 extra slot even if the purpose is char-code-property-table.
11799
11800 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11801
11802 * xdisp.c (redisplay_window): When computing centering_position,
11803 account for the height of the header line. (Bug#8874)
11804
11805 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11806 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11807 candidate is selected by the mouse, and that candidate has a
11808 composed character under the mouse.
11809
11810 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11811 coordinates reported by pos-visible-in-window-p for a composed
11812 character in column zero.
11813
11814 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11815
11816 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11817
11818 2011-08-22 Eli Zaretskii <eliz@gnu.org>
11819
11820 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11821 consider it a hit if to_charpos is anywhere in the range of the
11822 composed buffer positions.
11823
11824 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
11825
11826 * image.c (gif_load): Don't assume that each subimage has the same
11827 dimensions as the base image. Handle disposal method that is
11828 "undefined" by the gif spec (Bug#9335).
11829
11830 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
11831
11832 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11833 (Fcondition_case): Document `debug' symbol in error handler.
11834
11835 2011-08-19 Eli Zaretskii <eliz@gnu.org>
11836
11837 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11838 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11839 from an Org mode buffer to a Speedbar frame.
11840
11841 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11842 a composition, take its buffer position from IT->cmp_it.charpos.
11843 Fixes cursor positioning at the beginning of a line that begins
11844 with a composed character.
11845
11846 2011-08-18 Eli Zaretskii <eliz@gnu.org>
11847
11848 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11849 character bidirectional type, use STRONG_L instead. Fixes crashes
11850 in a buffer produced by `describe-categories'.
11851
11852 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11853 members before the level stack, so they would be saved and
11854 restored when copying iterator state. Fixes incorrect reordering
11855 around TABs covered by display properties.
11856
11857 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11858
11859 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11860
11861 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
11862
11863 * eval.c (internal_condition_case, internal_condition_case_1)
11864 (internal_condition_case_2, internal_condition_case_n):
11865 Remove unnecessary aborts (Bug#9081).
11866
11867 2011-08-17 Eli Zaretskii <eliz@gnu.org>
11868
11869 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11870 has no `load' handler, try opening the file locally. (Bug#9311)
11871
11872 2011-08-16 Ken Brown <kbrown@cornell.edu>
11873
11874 * gmalloc.c: Expand comment.
11875
11876 2011-08-16 Eli Zaretskii <eliz@gnu.org>
11877
11878 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11879 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11880
11881 2011-08-16 Ken Brown <kbrown@cornell.edu>
11882
11883 Fix memory allocation problems in Cygwin build (Bug#9273).
11884
11885 * unexcw.c ( __malloc_initialized): Declare external variable.
11886 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11887
11888 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11889 New variables.
11890 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11891 dumped emacs.
11892 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11893 in the static heap.
11894 [CYGWIN] (special_realloc): New function.
11895 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11896 requests to realloc storage in the static heap.
11897
11898 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11899
11900 * bidi.c (bidi_initialize): Remove unused local.
11901
11902 2011-08-15 Eli Zaretskii <eliz@gnu.org>
11903
11904 * bidimirror.h:
11905 * biditype.h: Remove file.
11906 * makefile.w32-in ($(BLD)/bidi.$(O)):
11907 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11908
11909 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11910
11911 * chartab.c: Improve commentary for the uniprop_table API.
11912
11913 * bidi.c (bidi_paragraph_init): Support zero value of
11914 bidi_ignore_explicit_marks_for_paragraph_level.
11915 (bidi_initialize): Use uniprop_table instead of including
11916 biditype.h and bidimirror.h.
11917
11918 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11919 coordinates of the iterator when restoring from ppos_it.
11920 (Bug#9296)
11921
11922 2011-08-14 Kenichi Handa <handa@m17n.org>
11923
11924 * process.c (create_process): Call setup_process_coding_systems
11925 after the pid of the process is set to -1 (Bug#8162).
11926
11927 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11928
11929 * xdisp.c (move_it_in_display_line_to): Don't invoke
11930 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11931 ppos_it. Fixes vertical cursor motion when line beginning is
11932 covered by an image. (Bug#9296)
11933
11934 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11935
11936 * nsterm.h (ns_run_ascript): Declare.
11937 (NSAPP_DATA2_RUNASSCRIPT): Define.
11938
11939 * nsfns.m (as_script, as_result, as_status): New static variables.
11940 (ns_run_ascript): New function.
11941 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11942 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11943 the event loop. Get status from as_status (Bug#7276).
11944
11945 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11946 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11947 the event loop (Bug#7276).
11948
11949 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11950
11951 * gnutls.c (QCgnutls_bootprop_priority)
11952 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11953 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11954 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11955 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11956 (QCgnutls_bootprop_verify_hostname_error)
11957 (QCgnutls_bootprop_callbacks_verify): Rename from
11958 Qgnutls_bootprop_..., all uses changed.
11959
11960 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11961 uses changed.
11962
11963 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11964
11965 * xfaces.c (Qframe_set_background_mode): Now static.
11966 * dispextern.h (Qframe_set_background_mode): Remove decl.
11967
11968 * process.c (Fnetwork_interface_info): Declare local only if needed.
11969
11970 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11971
11972 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11973 (Fnetwork_interface_list): Allocate in increments of bytes instead
11974 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11975 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11976 sockaddr.
11977 (struct ifflag_def): notrailers is smart on OSX.
11978 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11979 Get hardware address with getifaddrs if available.
11980
11981 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11982
11983 * xdisp.c (iterate_out_of_display_property): xassert that
11984 IT->position is set to within IT->object's boundaries. Break from
11985 the loop as soon as EOB is reached; avoids infloops in redisplay
11986 when IT->position is set up wrongly due to some bug.
11987 Set IT->current to match the bidi iterator unconditionally.
11988 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11989 entry. Force push_it to save on the stack the current
11990 buffer/string position, to be restored by pop_it. Fix flags in
11991 the iterator structure wrt the object coming from a display
11992 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11993 properties. (Bug#9284)
11994
11995 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11996
11997 * fontset.c (fontset_get_font_group): Add proper type checks.
11998 (Bug#9172)
11999
12000 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12001
12002 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12003 and LC_VERSION_MIN_MACOSX.
12004 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12005 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12006
12007 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12008
12009 * xdisp.c (forward_to_next_line_start): Allow to use the
12010 no-display-properties-and-no-overlays under bidi display.
12011 Set disp_pos in the bidi iterator to avoid searches for display
12012 properties and overlays.
12013
12014 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12015
12016 * editfns.c (Fset_time_zone_rule): Document relationship with the
12017 setenv function.
12018
12019 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12020 the font entity extracted from the cache (Bug#8109).
12021
12022 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12023
12024 * composite.c (autocmp_chars): Don't reset point. That is done by
12025 restore_point_unwind (Bug#5984).
12026
12027 2011-08-07 Juri Linkov <juri@jurta.org>
12028
12029 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12030 to show the arg `TIME' instead of `TIMEVAL'.
12031
12032 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12033
12034 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12035 display property strides EOL and includes a newline, as in
12036 longlines-mode. (Bug#9254)
12037 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12038 word-wrap under bidirectional display. (Bug#9224)
12039
12040 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12041 is non-zero, even if the data buffer is NULL. Fixes a crash in
12042 vertical-motion with longlines-mode. (Bug#9254)
12043
12044 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12045
12046 * bidi.c <bidi_cache_total_alloc>: Now static.
12047 (bidi_initialize): Initialize bidi_cache_total_alloc.
12048
12049 * xdisp.c (display_line): Release buffer allocated for shelved bidi
12050 cache. (Bug#9221)
12051
12052 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12053 amount allocated this far in `bidi_cache_total_alloc'.
12054 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12055 non-zero, only free the data buffer without restoring the cache
12056 contents. All callers changed.
12057
12058 * dispextern.h (bidi_unshelve_cache): Update prototype.
12059
12060 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12061 (move_it_in_display_line, move_it_to)
12062 (move_it_vertically_backward, move_it_by_lines): Replace the call
12063 to xfree to an equivalent call to bidi_unshelve_cache.
12064 (move_it_in_display_line_to): Fix logic of returning
12065 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12066
12067 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12068
12069 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12070 came from a string character with a `cursor' property. (Bug#9229)
12071
12072 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12073
12074 * Makefile.in (LIB_PTHREAD): New variable.
12075 (LIBES): Add LIB_PTHREAD (Bug#9216).
12076
12077 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12078 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12079
12080 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12081
12082 * regex.c (re_iswctype): Remove some redundant boolean conversions.
12083
12084 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12085
12086 * xterm.c (x_find_topmost_parent): New function.
12087 (x_set_frame_alpha): Find topmost parent window with
12088 x_find_topmost_parent and set the property there also (bug#9181).
12089 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12090
12091 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12092
12093 * callproc.c (Fcall_process): Avoid vfork clobbering
12094 the local vars buffer, coding_systems, current_dir.
12095
12096 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12097
12098 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12099
12100 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12101
12102 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12103 so that it is not optimized away.
12104
12105 * xdisp.c (compute_display_string_pos): Remove unused local.
12106
12107 2011-08-02 Eli Zaretskii <eliz@gnu.org>
12108
12109 Fix slow cursor motion and scrolling in large buffers with
12110 selective display, like Org Mode buffers. (Bug#9218)
12111
12112 * dispextern.h (struct bidi_it): New member disp_prop_p.
12113
12114 * xdisp.c: Remove one-slot cache of display string positions.
12115 (compute_display_string_pos): Accept an additional argument
12116 DISP_PROP_P; callers changed. Scan at most 5K characters forward
12117 for a display string or property. If found, set DISP_PROP_P
12118 non-zero.
12119
12120 * bidi.c (bidi_fetch_char): Accept an additional argument
12121 DISP_PROP_P, and pass it to compute_display_string_pos.
12122 Only handle text covered by a display string if DISP_PROP_P is returned
12123 non-zero. All callers of bidi_fetch_char changed.
12124
12125 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12126
12127 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12128
12129 2010-12-03 Don March <don@ohspite.net>
12130
12131 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12132 last character M-[char] is translated to ESC [char] (bug#7541).
12133
12134 2011-08-02 Kenichi Handa <handa@m17n.org>
12135
12136 * lisp.h (uniprop_table): Extern it.
12137
12138 * chartab.c (uniprop_table): Make it non-static.
12139
12140 2011-08-01 Eli Zaretskii <eliz@gnu.org>
12141
12142 * xdisp.c (forward_to_next_line_start): Accept additional argument
12143 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12144 on the newline.
12145 (reseat_at_next_visible_line_start): Use the bidi iterator state
12146 returned by forward_to_next_line_start to restore the state of
12147 it->bidi_it after backing up to previous newline. (Bug#9212)
12148
12149 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12150
12151 * regex.c (re_comp): Protoize.
12152 (re_exec): Fix return type.
12153 (regexec): Fix type of `ret'. (Bug#9203)
12154
12155 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12156
12157 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12158 This is needed if max-image-size is a floating-point number.
12159
12160 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12161
12162 * print.c (print_object): Print empty symbol as ##.
12163
12164 * lread.c (read1): Read ## as empty symbol.
12165
12166 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12167
12168 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12169 setting frame foreground color (Bug#9175).
12170 (x_set_background_color): Likewise.
12171
12172 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12173 contents (Bug#9176).
12174 (EmacsTooltip -init): Remove bezels and add shadows to
12175 tooltip windows.
12176
12177 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12178 or scroll bar (Bug#8470).
12179
12180 * nsfont.m (nsfont_open): Remove assignment to voffset and
12181 unnecessary vars hshink, expand, hd, full_height, min_height.
12182 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12183
12184 * nsterm.h (nsfont_info): Remove voffset field.
12185
12186 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12187
12188 Implement strike-through and overline on NextStep (Bug#8863).
12189
12190 * nsfont.m (nsfont_open): Use underline position provided by font,
12191 instead of hard-coded value of 2.
12192 (nsfont_draw): Call ns_draw_text_decoration instead.
12193
12194 * nsterm.h: Add declaration for ns_draw_text_decoration.
12195
12196 * nsterm.m (ns_draw_text_decoration): New function for drawing
12197 underline, overline, and strike-through.
12198 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12199 ns_draw_text_decoration. Change treatment of cursor drawing to
12200 accommodate underlining, etc.
12201
12202 2011-07-28 Eli Zaretskii <eliz@gnu.org>
12203
12204 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12205 default.
12206
12207 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12208
12209 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12210 Without this fix, if a signal arrives just after memory fills up,
12211 'malloc' might be invoked reentrantly.
12212
12213 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12214 In other words, assume that every image size is allowed, on non-X
12215 hosts. This assumption is probably wrong, but it lets Emacs compile.
12216
12217 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12218
12219 * regex.c (re_iswctype): Convert return values to boolean.
12220
12221 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12222
12223 * xdisp.c (compute_display_string_pos): Don't use cached display
12224 string position if the buffer had its restriction changed.
12225 (Bug#9184)
12226
12227 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12228
12229 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12230
12231 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12232
12233 Integer signedness and overflow and related fixes. (Bug#9079)
12234
12235 * bidi.c: Integer size and overflow fixes.
12236 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12237 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12238 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12239 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12240 (bidi_find_other_level_edge):
12241 Use ptrdiff_t instead of EMACS_INT where either will do.
12242 This works better on 32-bit hosts configured --with-wide-int.
12243 (bidi_cache_ensure_space): Check for size-calculation overflow.
12244 Use % rather than repeated addition, for better worst-case speed.
12245 Don't set bidi_cache_size until after xrealloc returns, because it
12246 might not return.
12247 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12248 (bidi_cache_ensure_space): Also check that the bidi cache size
12249 does not exceed that of the largest Lisp string or buffer. See Eli
12250 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12251
12252 * alloc.c (__malloc_size_t): Remove.
12253 All uses replaced by size_t. See Andreas Schwab's note
12254 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12255
12256 * image.c: Improve checking for integer overflow.
12257 (check_image_size): Assume that f is nonnull, since
12258 it is always nonnull in practice. This is one less thing to
12259 worry about when checking for integer overflow later.
12260 (x_check_image_size): New function, which checks for integer
12261 overflow issues inside X.
12262 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12263 This removes the need for a memory_full check.
12264 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12265 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12266 (xbm_read_bitmap_data): Change locals back to 'int', since
12267 their values must fit in 'int'.
12268 (xpm_load_image, png_load, tiff_load):
12269 Invoke x_create_x_image_and_pixmap earlier,
12270 to avoid much needless work if the image is too large.
12271 (tiff_load): Treat overly large images as if
12272 x_create_x_image_and_pixmap failed, not as malloc failures.
12273 (gs_load): Use x_check_image_size.
12274
12275 * gtkutil.c: Omit integer casts.
12276 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12277 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12278
12279 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12280
12281 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12282 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12283 would wrongly return t on a 64-bit host.
12284
12285 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12286 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12287 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12288 and therefore cause GCC to emit a bogus diagnostic in some cases.
12289
12290 * image.c: Integer signedness and overflow and related fixes.
12291 This is not an exhaustive set of fixes, but it's time to
12292 record what I've got.
12293 (lookup_pixel_color, check_image_size): Remove redundant decls.
12294 (check_image_size): Don't assume that arbitrary EMACS_INT values
12295 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12296 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12297 (tiff_load, imagemagick_load_image):
12298 Check for overflow in size calculations.
12299 (x_create_x_image_and_pixmap): Remove unnecessary test for
12300 xmalloc returning NULL; that can't happen.
12301 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12302 (xpm_color_bucket): Use better integer hashing function.
12303 (xpm_cache_color): Don't possibly over-allocate memory.
12304 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12305 (gif_memory_source):
12306 Use ptrdiff_t, not int or size_t, to record sizes.
12307 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12308 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12309 either works, as we prefer signed integers.
12310 (tiff_read_from_memory, tiff_write_from_memory):
12311 Return tsize_t, not size_t, since that's what the TIFF API wants.
12312 (tiff_read_from_memory): Don't fail simply because the read would
12313 go past EOF; instead, return a short read.
12314 (tiff_load): Omit no-longer-needed casts.
12315 (Fimagemagick_types): Don't assume size fits into 'int'.
12316
12317 Improve hashing quality when configured --with-wide-int.
12318 * fns.c (hash_string): New function, taken from sxhash_string.
12319 Do not discard information about ASCII character case; this
12320 discarding is no longer needed.
12321 (sxhash-string): Use it. Change sig to match it. Caller changed.
12322 * lisp.h: Declare it.
12323 * lread.c (hash_string): Remove, since we now use fns.c's version.
12324 The fns.c version returns a wider integer if --with-wide-int is
12325 specified, so this should help the quality of the hashing a bit.
12326
12327 * emacs.c: Integer overflow minor fix.
12328 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12329 Define only if GNU_LINUX.
12330 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12331
12332 * dispnew.c: Integer signedness and overflow fixes.
12333 Remove unnecessary forward decls, that were a maintenance hassle.
12334 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12335 All uses changed.
12336 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12337 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12338 (prepare_desired_row, line_draw_cost):
12339 Use int, not unsigned, where either works.
12340 (save_current_matrix, restore_current_matrix):
12341 Use ptrdiff_t, not size_t, where either works.
12342 (init_display): Check for overflow more accurately, and without
12343 relying on undefined behavior.
12344
12345 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12346 Remove, replacing with the new symbols in lisp.h. All uses changed.
12347 * fileio.c (make_temp_name):
12348 * filelock.c (lock_file_1, lock_file):
12349 * xdisp.c (message_dolog):
12350 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12351 Use pMd etc. instead.
12352 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12353 replacing the pWIDE etc. symbols removed from editfns.c.
12354
12355 * keyboard.h (num_input_events): Now uintmax_t.
12356 This is (very slightly) less likely to mess up due to wraparound.
12357 All uses changed.
12358
12359 * buffer.c: Integer signedness fixes.
12360 (alloc_buffer_text, enlarge_buffer_text):
12361 Use ptrdiff_t rather than size_t when either will do, as we prefer
12362 signed integers.
12363
12364 * alloc.c: Integer signedness and overflow fixes.
12365 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12366 (__malloc_size_t): Default to size_t, not to int.
12367 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12368 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12369 Prefer ptrdiff_t to size_t when either would do, as we prefer
12370 signed integers.
12371 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12372 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12373 Now const. Initialize with values that are in range even if char
12374 is signed.
12375 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12376 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12377 These functions do the right thing with sizes > 2**32.
12378 (check_depth): Now ptrdiff_t, not int.
12379 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12380 Adjust to new way of storing sizes. Check for size overflow bugs
12381 in rest of code.
12382 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12383 slightly wrong anyway, as it missed one instance of
12384 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12385 (refill_memory_reserve): Omit needless cast to size_t.
12386 (mark_object_loop_halt): Mark as externally visible.
12387
12388 * xselect.c: Integer signedness and overflow fixes.
12389 (Fx_register_dnd_atom, x_handle_dnd_message):
12390 Use ptrdiff_t, not size_t, since we prefer signed.
12391 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12392 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12393 x_dnd_atoms_size and x_dnd_atoms_length.
12394
12395 * doprnt.c: Prefer signed to unsigned when either works.
12396 * eval.c (verror):
12397 * doprnt.c (doprnt):
12398 * lisp.h (doprnt):
12399 * xdisp.c (vmessage):
12400 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12401 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12402 prefer signed arithmetic to avoid comparison confusion.
12403 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12404 but is a bit tricky.
12405
12406 Assume freestanding C89 headers, string.h, stdlib.h.
12407 * data.c, doprnt.c, floatfns.c, print.c:
12408 Include float.h unconditionally.
12409 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12410 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12411 * regex.c: Likewise for stddef.h, string.h.
12412 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12413 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12414 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12415 (STDC_HEADERS): Remove obsolete defines.
12416 * sysdep.c: Include limits.h unconditionally.
12417
12418 Assume support for memcmp, memcpy, memmove, memset.
12419 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12420 * regex.c (memcmp, memcpy):
12421 Remove; we assume C89 now.
12422
12423 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12424 (__malloc_safe_bcopy): Remove; no longer needed.
12425
12426 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12427 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12428 well either way, and we prefer signed to unsigned.
12429
12430 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12431
12432 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12433 closes the connection while we're reading (bug#9182).
12434
12435 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12436
12437 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12438 are specified (Bug#9168).
12439
12440 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12441
12442 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12443 Found by GCC static checking and --with-wide-int on a 32-bit host.
12444
12445 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12446
12447 * xdisp.c (compute_display_string_pos): Fix logic of caching
12448 previous display string position. Initialize cached_prev_pos to
12449 -1. Fixes slow-down at the beginning of a buffer.
12450
12451 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12452
12453 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12454 for attrs[LFACE_FONTSET_INDEX].
12455
12456 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12457
12458 * xml.c (parse_region): Remove unused local
12459 that was recently introduced.
12460
12461 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12462
12463 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12464 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12465
12466 * xdisp.c (move_it_in_display_line_to): Record the best matching
12467 position for TO_CHARPOS while scanning the line, and restore it on
12468 exit if none of the characters scanned was an exact match.
12469 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12470 when exact match is impossible due to invisible text, and the
12471 lines are truncated.
12472
12473 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12474
12475 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12476 for OSX >= 10.7.
12477
12478 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12479
12480 Fix a significant slow-down of cursor motion with C-n, C-p,
12481 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12482 auto-repeat under bidi redisplay in fontified buffers.
12483 * xdisp.c (compute_stop_pos_backwards): New function.
12484 (next_element_from_buffer): Call compute_stop_pos_backwards to
12485 find a suitable prev_stop when we find ourselves before
12486 base_level_stop.
12487 (reseat): Don't look for prev_stop, as that could mean a very long
12488 run.
12489 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12490 <cached_disp_overlay_modiff>: Cache for last found display string
12491 position.
12492 (compute_display_string_pos): Return the cached position if asked
12493 about the same buffer in the same area of character positions, and
12494 the buffer wasn't changed since the time the display string
12495 position was cached.
12496
12497 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12498
12499 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12500 is an integer, which is important for empty lines. (Bug#9149)
12501
12502 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
12503
12504 * frame.c (Fmodify_frame_parameters): In tty case, update the
12505 default face if necessary (Bug#4238).
12506
12507 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
12508
12509 * editfns.c (Fstring_to_char): No need to explain what a character
12510 is in the docstring (Bug#6576).
12511
12512 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12513
12514 * xml.c (parse_region): Make sure we always return a tree.
12515
12516 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12517
12518 * xml.c (parse_region): If a document contains only comments,
12519 return that, too.
12520
12521 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12522
12523 * xml.c (make_dom): Return comments, too.
12524
12525 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12526
12527 Port to OpenBSD.
12528 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12529 and the surrounding thread.
12530 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12531 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12532 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12533 timer goes off.
12534 * s/openbsd.h (BROKEN_SIGIO): Define.
12535 * unexelf.c (unexec) [__OpenBSD__]:
12536 Don't update the .mdebug section of the Alpha COFF symbol table.
12537
12538 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12539
12540 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12541 (bug#8460).
12542
12543 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12544
12545 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12546 This fixes some race conditions on the permissions of any newly
12547 created file.
12548
12549 * alloc.c (valid_pointer_p): Use pipe, not open.
12550 This fixes some permissions issues when debugging.
12551
12552 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12553 If fchown fails to set both uid and gid, try to set just gid,
12554 as that is sometimes allowed. Adjust the file's mode to eliminate
12555 setuid or setgid bits that are inappropriate if fchown fails.
12556
12557 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12558
12559 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12560 to compare Lisp_Objects.
12561 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12562 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12563 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12564
12565 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12566
12567 * lread.c (read_integer): Unread even EOF character.
12568 (read1): Likewise. Properly record start position of symbol.
12569
12570 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12571 symbol character follows.
12572
12573 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12574
12575 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12576 This works around a problem with the previous change to Fcopy_file.
12577 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12578 and without this change, GCC might complain about discarding
12579 fchown's return value.
12580
12581 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
12582
12583 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12584
12585 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12586
12587 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12588
12589 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12590
12591 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12592 it's used from the C level.
12593
12594 * process.c: Use the same condition for POLL_FOR_INPUT in both
12595 keyboard.c and process.c (bug#1858).
12596
12597 2011-07-09 Lawrence Mitchell <wence@gmx.li>
12598
12599 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12600 (Fgnutls_boot): Use it.
12601
12602 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12603
12604 * doc.c (Fsubstitute_command_keys): Revert last change.
12605
12606 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12607
12608 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12609 quotes the next character, and doesn't affect other longer
12610 sequences (bug#8935).
12611
12612 * lread.c (syms_of_lread): Clarify that is isn't only
12613 `eval-buffer' and `eval-defun' that's affected by
12614 `lexical-binding' (bug#8460).
12615
12616 2011-07-15 Eli Zaretskii <eliz@gnu.org>
12617
12618 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12619 bidi redisplay when a line includes both an image and is truncated.
12620
12621 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12622
12623 Fix minor problems found by static checking.
12624 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12625 (elsz): Now a signed constant, not a size_t var. We prefer signed
12626 types to unsigned, to avoid integer comparison confusion. Without
12627 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12628 "cannot optimize loop, the loop counter may overflow", a symptom
12629 of the confusion.
12630 * indent.c (Fvertical_motion): Mark locals as initialized.
12631 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12632
12633 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12634
12635 * search.c (Fre_search_backward): Mention `case-fold-search' in
12636 all the re_search_* functions (bug#8138).
12637
12638 * keyboard.c (Fopen_dribble_file): Document when the file is
12639 closed (bug#8056).
12640
12641 2011-07-14 Eli Zaretskii <eliz@gnu.org>
12642
12643 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12644 bidi_cache_idx.
12645
12646 Support bidi reordering of display and overlay strings.
12647 * xdisp.c (compute_display_string_pos)
12648 (compute_display_string_end): Accept additional argument STRING.
12649 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12650 (reseat_to_string): Initialize bidi_it->string.s and
12651 bidi_it->string.schars.
12652 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12653 NULL (avoids a crash in bidi_paragraph_init).
12654 Initialize itb.string.lstring.
12655 (init_iterator): Call bidi_init_it only of a valid
12656 buffer position was specified. Initialize paragraph_embedding to
12657 L2R.
12658 (reseat_to_string): Initialize the bidi iterator.
12659 (display_string): If we need to ignore text properties of
12660 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12661 original value of -1 will not work with bidi.)
12662 (compute_display_string_pos): First arg is now struct
12663 `text_pos *'; all callers changed. Support display properties on
12664 Lisp strings.
12665 (compute_display_string_end): Support display properties on Lisp
12666 strings.
12667 (init_iterator, reseat_1, reseat_to_string): Initialize the
12668 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12669 when iterating on a string not from display properties).
12670 (compute_display_string_pos, compute_display_string_end):
12671 Fix calculation of the object to scan. Fixes an error when using
12672 arrow keys.
12673 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12674 base_level_stop; instead, set base_level_stop to BEGV.
12675 Fixes crashes in vertical-motion.
12676 (next_element_from_buffer): Improve commentary for when
12677 the iterator is before prev_stop.
12678 (init_iterator): Initialize bidi_p from the default value of
12679 bidi-display-reordering, not from buffer-local value. Use the
12680 buffer-local value only if initializing for buffer iteration.
12681 (handle_invisible_prop): Support invisible properties on strings
12682 that are being bidi-reordered.
12683 (set_iterator_to_next): Support bidi reordering of C strings and
12684 Lisp strings.
12685 (next_element_from_string): Support bidi reordering of Lisp
12686 strings.
12687 (handle_stop_backwards): Support Lisp strings as well.
12688 (display_string): Support display of R2L glyph rows.
12689 Use IT_STRING_CHARPOS when displaying from a Lisp string.
12690 (init_iterator): Don't initialize it->bidi_p for strings
12691 here.
12692 (reseat_to_string): Initialize it->bidi_p for strings here.
12693 (next_element_from_string, next_element_from_c_string)
12694 (next_element_from_buffer): Add xassert's for correspondence
12695 between IT's object being iterated and it->bidi_it.string
12696 structure.
12697 (face_before_or_after_it_pos): Support bidi iteration.
12698 (next_element_from_c_string): Handle the case of the first string
12699 character that is not the first one in the visual order.
12700 (get_visually_first_element): New function, refactored from common
12701 parts of next_element_from_buffer, next_element_from_string, and
12702 next_element_from_c_string.
12703 (tool_bar_lines_needed, redisplay_tool_bar)
12704 (display_menu_bar): Force left-to-right direction. Add a FIXME
12705 comment for making that be controlled by a user option.
12706 (push_it, pop_it): Save and restore the state of the
12707 bidi iterator. Save and restore the bidi_p flag.
12708 (pop_it): Iterate out of display property for string iteration as
12709 well.
12710 (iterate_out_of_display_property): Support iteration over strings.
12711 (handle_single_display_spec): Set up it->bidi_it for iteration
12712 over a display string, and call bidi_init_it.
12713 (handle_single_display_spec, next_overlay_string)
12714 (get_overlay_strings_1, push_display_prop): Set up the bidi
12715 iterator for displaying display or overlay strings.
12716 (forward_to_next_line_start): Don't use the shortcut if
12717 bidi-iterating.
12718 (back_to_previous_visible_line_start): If handle_display_prop
12719 pushed the iterator stack, restore the internal state of the bidi
12720 iterator by calling bidi_pop_it same number of times.
12721 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12722 and we are bidi-iterating, don't decrement the iterator position;
12723 instead, set the first_elt flag in the bidi iterator, to produce
12724 the same effect.
12725 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12726 (push_display_prop): xassert that we are iterating a buffer.
12727 (push_it, pop_it): Save and restore paragraph_embedding member.
12728 (handle_single_display_spec, next_overlay_string)
12729 (get_overlay_strings_1, reseat_1, reseat_to_string)
12730 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12731 correctly. Don't assume unibyte strings are not bidi-reordered.
12732 (compute_display_string_pos)
12733 (compute_display_string_end): Fix handling the case of C string.
12734 (push_it, pop_it): Save and restore from_disp_prop_p.
12735 (handle_single_display_spec, push_display_prop): Set the
12736 from_disp_prop_p flag.
12737 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12738 (pop_it): Call iterate_out_of_display_property only if we are
12739 popping after iteration over a string that came from a display
12740 property. Fix a typo in popping stretch info. Add an assertion
12741 for verifying that the iterator position is in sync with the bidi
12742 iterator.
12743 (handle_single_display_spec, get_overlay_strings_1)
12744 (push_display_prop): Fix initialization of paragraph direction for
12745 string when that of the parent object is not yet determined.
12746 (reseat_1): Call bidi_init_it to resync the bidi
12747 iterator with IT's position. (Bug#7616)
12748 (find_row_edges): If ROW->start.pos gives position
12749 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12750 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12751 Reset the from_disp_prop_p flag.
12752 (SAVE_IT, RESTORE_IT): New macros.
12753 (pos_visible_p, face_before_or_after_it_pos)
12754 (back_to_previous_visible_line_start)
12755 (move_it_in_display_line_to, move_it_in_display_line)
12756 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12757 (try_scrolling, redisplay_window, display_line): Use them when
12758 saving a temporary copy of the iterator and restoring it back.
12759 (back_to_previous_visible_line_start, reseat_1)
12760 (init_iterator): Empty the bidi cache "stack".
12761 (move_it_in_display_line_to): If iterator ended up at
12762 EOL, but we never saw any buffer positions smaller than
12763 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12764 motion in bidi-reordered lines.
12765 (move_it_in_display_line_to): Record prev_method and prev_pos
12766 immediately before the call to set_iterator_to_next. Fixes cursor
12767 motion in bidi-reordered lines with stretch glyphs and strings
12768 displayed in margins. (Bug#8133) (Bug#8867)
12769 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12770 TO_CHARPOS.
12771 (pos_visible_p): Support positions in bidi-reordered lines.
12772 Save and restore bidi cache.
12773
12774 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12775 (bidi_paragraph_info): Delete unused struct.
12776 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12777 (bidi_cache_start): New variable.
12778 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12779 to zero.
12780 (bidi_cache_fetch_state, bidi_cache_search)
12781 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12782 (bidi_cache_find, bidi_peek_at_next_level)
12783 (bidi_level_of_next_char, bidi_find_other_level_edge)
12784 (bidi_move_to_visually_next): Compare cache index with
12785 bidi_cache_start rather than with zero.
12786 (bidi_fetch_char): Accept new argument STRING; all callers
12787 changed. Support iteration over a string. Support strings with
12788 display properties. Support unibyte strings. Fix the type of
12789 `len' according to what STRING_CHAR_AND_LENGTH expects.
12790 (bidi_paragraph_init, bidi_resolve_explicit_1)
12791 (bidi_resolve_explicit, bidi_resolve_weak)
12792 (bidi_level_of_next_char, bidi_move_to_visually_next):
12793 Support iteration over a string.
12794 (bidi_set_sor_type, bidi_resolve_explicit_1)
12795 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12796 can now be zero (for strings); special values 0 and -1 were
12797 changed to -1 and -2, respectively.
12798 (bidi_char_at_pos): New function.
12799 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12800 Call it instead of FETCH_MULTIBYTE_CHAR.
12801 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12802 initialized to valid values.
12803 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12804 values.
12805 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12806 the test for valid cached positions. Fix the logic for looking up
12807 the sentinel state in the cache. GCPRO the Lisp string we are
12808 iterating.
12809 (bidi_push_it, bidi_pop_it): New functions.
12810 (bidi_initialize): Initialize the bidi cache start stack pointer.
12811 (bidi_cache_ensure_space): New function, refactored from part of
12812 bidi_cache_iterator_state. Don't assume the required size is just
12813 one BIDI_CACHE_CHUNK away.
12814 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12815 (bidi_count_bytes, bidi_char_at_pos): New functions.
12816 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12817 always valid if bidi_cache_idx is valid.
12818 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12819 is valid if it's going to be used.
12820 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12821 (bidi_cache_fetch_state, bidi_cache_search)
12822 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12823 (bidi_cache_iterator_state, bidi_cache_find)
12824 (bidi_find_other_level_edge, bidi_cache_start_stack):
12825 All variables related to cache indices are now EMACS_INT.
12826
12827 * dispextern.h (struct bidi_string_data): New structure.
12828 (struct bidi_it): New member `string'. Make flag members be 1-bit
12829 fields, and put them last in the struct.
12830 (compute_display_string_pos, compute_display_string_end):
12831 Update prototypes.
12832 (bidi_push_it, bidi_pop_it): Add prototypes.
12833 (struct iterator_stack_entry): New members bidi_p,
12834 paragraph_embedding, and from_disp_prop_p.
12835 (struct it): Member bidi_p is now a bit field 1 bit wide.
12836 (bidi_shelve_cache, bidi_unshelve_cache):
12837 Declare prototypes.
12838
12839 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12840 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12841 and vector-like objects.
12842
12843 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12844 cache around display iteration.
12845
12846 * window.c (Fwindow_end, window_scroll_pixel_based)
12847 (displayed_window_lines, Frecenter): Save and restore the bidi
12848 cache around display iteration.
12849
12850 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12851
12852 * editfns.c (Fdelete_region): Clarify the use of the named
12853 parameters (bug#6788).
12854
12855 2011-07-14 Martin Rudalics <rudalics@gmx.at>
12856
12857 * indent.c (Fvertical_motion): Set and restore w->pointm when
12858 saving and restoring the window's buffer (Bug#9006).
12859
12860 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12861
12862 * editfns.c (Fstring_to_char): Clarify just what is returned
12863 (bug#6576). Text by Eli Zaretskii.
12864
12865 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
12866
12867 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12868
12869 2011-07-13 Eli Zaretskii <eliz@gnu.org>
12870
12871 * buffer.c (mmap_find): Fix a typo.
12872
12873 2011-07-13 Johan Bockgård <bojohan@gnu.org>
12874
12875 Fix execution of x selection hooks.
12876 * xselect.c (Qx_lost_selection_functions)
12877 (Qx_sent_selection_functions): New vars.
12878 (syms_of_xselect): DEFSYM them.
12879 (x_handle_selection_request): Pass Qx_sent_selection_functions
12880 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12881 (x_handle_selection_clear,x_clear_frame_selections):
12882 Pass Qx_lost_selection_functions rather than
12883 Vx_lost_selection_functions to Frun_hook_with_args.
12884
12885 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12886
12887 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12888 The old code sometimes used this field without initializing it.
12889
12890 * alloc.c (gc_sweep): Don't read past end of array.
12891 In theory, the old code could also have corrupted Emacs internals,
12892 though it'd be very unlikely.
12893
12894 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12895
12896 * character.c (Fcharacterp): Don't advertise optional ignored
12897 argument. (Bug#4026)
12898
12899 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12900
12901 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12902 key" (bug#4257).
12903
12904 * window.c (Fset_window_start): Doc fix (bug#4199).
12905 (Fset_window_hscroll): Ditto.
12906
12907 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12908
12909 Fix minor new problems caught by GCC 4.6.1.
12910 * term.c (init_tty): Remove unused local.
12911 * xsettings.c (store_monospaced_changed): Define this function only
12912 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12913 not used otherwise.
12914
12915 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
12916
12917 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12918
12919 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12920
12921 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12922 are the mini-buffer and the echo area (bug#3320).
12923
12924 * term.c (init_tty): Remove support for supdup, c10 and perq
12925 terminals, which are no longer supported (bug#1482).
12926
12927 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12928
12929 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12930
12931 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12932
12933 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12934 for non-popups (Bug#3642).
12935
12936 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12937
12938 * alloc.c (reset_malloc_hooks): Protoize.
12939 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12940 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12941 * cm.c (losecursor): Likewise.
12942 * data.c (fmod): Likewise.
12943 * dispnew.c (swap_glyphs_in_rows): Likewise.
12944 * emacs.c (memory_warning_signal): Likewise.
12945 * floatfns.c (float_error): Likewise.
12946 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12947 (otf_open, font_otf_capability, generate_otf_features)
12948 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12949 Likewise.
12950 * image.c (pbm_read_file): Likewise.
12951 * indent.c (string_display_width): Likewise.
12952 * intervals.c (check_for_interval, search_for_interval)
12953 (inc_interval_count, count_intervals, root_interval)
12954 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12955 * lread.c (defalias): Likewise.
12956 * ralloc.c (r_alloc_check): Likewise.
12957 * regex.c (set_image_of_range_1, set_image_of_range)
12958 (regex_grow_registers): Likewise.
12959 * sysdep.c (strerror): Likewise.
12960 * termcap.c (valid_filename_p, tprint, main): Likewise.
12961 * tparam.c (main): Likewise.
12962 * unexhp9k800.c (run_time_remap, save_data_space)
12963 (update_file_ptrs, read_header, write_header, calculate_checksum)
12964 (copy_file, copy_rest, display_header): Likewise.
12965 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12966 Likewise.
12967 * xdisp.c (check_it): Likewise.
12968 * xfaces.c (register_color, unregister_color, unregister_colors):
12969 Likewise.
12970 * xfns.c (print_fontset_result): Likewise.
12971 * xrdb.c (member, fatal, main): Likewise.
12972
12973 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12974
12975 Fix minor problems found by static checking (Bug#9031).
12976 * chartab.c (char_table_set_range, map_sub_char_table):
12977 Remove unused locals.
12978 (uniprop_table): Now static.
12979 * composite.c (_work_char): Remove unused static var.
12980
12981 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12982
12983 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12984
12985 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12986
12987 * gtkutil.c (qttip_cb): Remove code without function.
12988
12989 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12990
12991 * w32.c (pthread_sigmask): New stub.
12992
12993 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12994
12995 Use pthread_sigmask, not sigprocmask (Bug#9010).
12996 sigprocmask is portable only for single-threaded applications, and
12997 Emacs can be multi-threaded when it uses GTK.
12998 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12999 (LIBES): Use it.
13000 * callproc.c (Fcall_process):
13001 * process.c (create_process):
13002 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13003 Use pthread_sigmask, not sigprocmask.
13004
13005 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13006
13007 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13008 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13009 wrong (Bug#8591).
13010
13011 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13012
13013 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13014 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13015 (xg_hide_tooltip): Fix comment.
13016
13017 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13018 in registerServicesMenuSendTypes.
13019 (validRequestorForSendType): Don't check ns_return_types.
13020
13021 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13022 ns_return_type.
13023
13024 2011-07-08 Jason Rumney <jasonr@gnu.org>
13025
13026 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13027 SH_SHOW for hidden windows (Bug#5482).
13028
13029 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13030 frame struct members of non-existent frames (Bug#6284).
13031
13032 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13033
13034 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13035 variable firstTime not needed on OSX >= 10.6.
13036 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13037 >= 10.5. Use setKnobProportion, setDoubleValue.
13038
13039 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13040 (MAC_OS_X_VERSION_10_5): Define if not defined.
13041 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13042 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13043 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13044
13045 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13046 cString and lossyCString on OSX >= 10.4.
13047
13048 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13049 sizeToFit on OSX >= 10.2.
13050
13051 * nsimage.m (allocInitFromFile): Don't use deprecated method
13052 bestRepresentationForDevice on OSX >= 10.6.
13053
13054 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13055 to avoid warning.
13056
13057 * emacs.c: Declare unexec_init_emacs_zone.
13058
13059 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13060
13061 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13062
13063 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13064 on svcsMenu (Bug#8842).
13065
13066 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13067 ns_return_types.
13068 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13069
13070 * nsterm.m (QUTF8_STRING): Declare.
13071 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13072 (validRequestorForSendType): Return type is (id).
13073 Change indexOfObjectIdenticalTo to indexOfObject.
13074 Check if we have local selection before returning self (Bug#8842).
13075 (writeSelectionToPasteboard): Put local selection into paste board
13076 if we have a local selection (Bug#8842).
13077 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13078
13079 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13080 (ns_get_local_selection): Declare.
13081
13082 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13083
13084 * keymap.c (describe_map_tree): Don't insert a double newline at
13085 the end of the buffer (bug#1169) and return whether we inserted
13086 something.
13087
13088 * callint.c (Fcall_interactively): Change "reading args" to
13089 "providing args" to try to clarify what it does (bug#1010).
13090
13091 2011-07-07 Kenichi Handa <handa@m17n.org>
13092
13093 * composite.c (composition_compute_stop_pos): Ignore a static
13094 composition starting before CHARPOS (Bug#8915).
13095
13096 * xdisp.c (handle_composition_prop): Likewise.
13097
13098 2011-07-07 Eli Zaretskii <eliz@gnu.org>
13099
13100 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13101 (Bug#9015)
13102
13103 2011-07-07 Kenichi Handa <handa@m17n.org>
13104
13105 * character.h (unicode_category_t): New enum type.
13106
13107 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13108 (Qchar_code_property_table): New variable.
13109 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13110 (UNIPROP_COMPRESSED_FORM_P): New macros.
13111 (char_table_ascii): Uncompress the compressed values.
13112 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13113 Uncompress the compressed values.
13114 (sub_char_table_ref_and_range): Likewise.
13115 (char_table_ref_and_range): Uncompress the compressed values.
13116 (sub_char_table_set): New arg is_uniprop. Callers changed.
13117 Uncompress the compressed values.
13118 (sub_char_table_set_range): Args changed. Callers changed.
13119 (char_table_set_range): Adjuted for the above change.
13120 (map_sub_char_table): Delete args default_val and parent. Add arg
13121 top. Give decoded values to a Lisp function.
13122 (map_char_table): Adjust for the above change. Give decoded
13123 values to a Lisp function. Gcpro more variables.
13124 (uniprop_table_uncompress)
13125 (uniprop_decode_value_run_length): New functions.
13126 (uniprop_decoder, uniprop_decoder_count): New variables.
13127 (uniprop_get_decoder, uniprop_encode_value_character)
13128 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13129 New functions.
13130 (uniprop_encoder, uniprop_encoder_count): New variables.
13131 (uniprop_get_encoder, uniprop_table)
13132 (Funicode_property_table_internal, Fget_unicode_property_internal)
13133 (Fput_unicode_property_internal): New functions.
13134 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13135 Sunicode_property_table_internal, Sget_unicode_property_internal,
13136 and Sput_unicode_property_internal. Defvar_lisp
13137 char-code-property-alist.
13138
13139 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13140 Vunicode_category_table.
13141
13142 * font.c (font_range): Adjust for the change of
13143 Vunicode_category_table.
13144
13145 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13146
13147 * m/iris4d.h: Remove file, move contents ...
13148 * s/irix6-5.h: ... here.
13149
13150 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13151
13152 Remove unportable assumption about struct layout (Bug#8884).
13153 * alloc.c (mark_buffer):
13154 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13155 (clone_per_buffer_values): Don't assume that
13156 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13157 This isn't true in general, and it's particularly not true
13158 if Emacs is configured with --with-wide-int.
13159 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13160 New macros, used in the buffer.c change.
13161
13162 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13163
13164 * xsettings.c: Use both GConf and GSettings if both are available.
13165 (store_config_changed_event): Add comment.
13166 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13167 (store_tool_bar_style_changed): New functions.
13168 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
13169 (struct xsettings): Move font inside HAVE_XFT.
13170 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13171 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13172 Move inside HAVE_XFT.
13173 (something_changed_gsettingsCB): Rename from something_changedCB.
13174 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13175 also.
13176 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13177 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
13178 (something_changed_gconfCB): Rename from something_changedCB.
13179 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13180 (parse_settings): Move check for font inside HAVE_XFT.
13181 (read_settings, apply_xft_settings): Add comment.
13182 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13183 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13184 call store_font_name_changed.
13185 (xft_settings_event): Add comment.
13186 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13187 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13188 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13189 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13190 (xsettings_initialize): Call init_gsettings last.
13191 (xsettings_get_system_font, xsettings_get_system_normal_font):
13192 Add comment.
13193
13194 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13195
13196 Random fixes. E.g., (random) never returned negative values.
13197 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13198 subseconds part to the entropy, as that's a bit more random.
13199 Prefer signed to unsigned, since the signedness doesn't matter and
13200 in general we prefer signed. When given a limit, use a
13201 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13202 latter isn't right if USE_2_TAGS_FOR_INTS.
13203 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13204 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13205
13206 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13207
13208 * textprop.c (text_property_stickiness):
13209 Obey Vtext_property_default_nonsticky.
13210 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13211 * w32fns.c (syms_of_w32fns):
13212 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13213
13214 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13215
13216 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13217 This is more efficient than Ffile_directory_p and avoids a minor race.
13218
13219 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13220
13221 * buffer.c (Foverlay_put): Say what the return value is
13222 (bug#7835).
13223
13224 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13225 is a directory before asking whether to use the file name
13226 (bug#7564).
13227 (barf_or_query_if_file_exists): Make the "File is a directory"
13228 error be more correct.
13229
13230 * fns.c (Frequire): Remove the mention of the .gz files, since
13231 that's installation-specific, but keep the mention of
13232 `get-load-suffixes'.
13233
13234 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13235
13236 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13237 Report string overflow if the output is too long.
13238
13239 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
13240
13241 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13242 (syms_of_gnutls): Remove duplicate DEFSYM for
13243 Qgnutls_bootprop_verify_hostname_error, an error for
13244 Qgnutls_bootprop_verify_error (which is no longer used).
13245
13246 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13247 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13248 Also (re)move comments that are misplaced or no longer relevant.
13249
13250 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13251
13252 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13253
13254 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
13255
13256 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13257 and background color parameters if they have been changed.
13258
13259 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13260
13261 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13262
13263 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13264
13265 * xsettings.c (SYSTEM_FONT): Define only when used.
13266 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13267
13268 * keymap.c (access_keymap_1): Now static.
13269
13270 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
13271
13272 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13273 leave any prefix arg for the up event (Bug#1586).
13274
13275 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13276
13277 * lread.c (syms_of_lread): Mention single symbols defined by
13278 `defvar' or `defconst' (bug#7154).
13279
13280 * fns.c (Frequire): Mention .el.gz files (bug#7314).
13281 (Frequire): Mention get-load-suffixes.
13282
13283 2011-07-02 Martin Rudalics <rudalics@gmx.at>
13284
13285 * window.h (window): Remove clone_number slot.
13286 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13287 Remove.
13288 (make_parent_window, make_window, saved_window)
13289 (Fset_window_configuration, save_window_save): Don't deal with
13290 clone numbers.
13291 * buffer.c (Qclone_number): Remove declaration.
13292 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13293
13294 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13295
13296 Add multiple inheritance to keymaps.
13297 * keymap.c (Fmake_composed_keymap): New function.
13298 (Fset_keymap_parent): Simplify.
13299 (fix_submap_inheritance): Remove.
13300 (access_keymap_1): New function extracted from access_keymap to handle
13301 embedded parents and handle lists of maps.
13302 (access_keymap): Use it.
13303 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13304 (Fcopy_keymap): Handle embedded parents.
13305 (Fcommand_remapping, define_as_prefix): Simplify.
13306 (Fkey_binding): Simplify.
13307 (syms_of_keymap): Move minibuffer-local-completion-map,
13308 minibuffer-local-filename-completion-map,
13309 minibuffer-local-must-match-map, and
13310 minibuffer-local-filename-must-match-map to Elisp.
13311 (syms_of_keymap): Defsubr make-composed-keymap.
13312 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13313 (parse_menu_item): Trivial simplification.
13314
13315 2011-07-01 Glenn Morris <rgm@gnu.org>
13316
13317 * Makefile.in (SETTINGS_LIBS): Fix typo.
13318
13319 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13320
13321 * coding.c (Fencode_coding_string): Record the last coding system
13322 used, as the function doc string says (bug#8738).
13323
13324 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13325
13326 * xsettings.c (store_monospaced_changed): Take new font as arg and
13327 check for change against current_mono_font.
13328 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13329 (emacs_settings_constructor, emacs_settings_get_property)
13330 (emacs_settings_set_property, emacs_settings_class_init)
13331 (emacs_settings_init, gsettings_obj): Remove.
13332 (something_changedCB): New function for HAVE_GSETTINGS.
13333 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13334 with value as argument.
13335 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13336 g_settings_new (Bug#8967). Do not create gsettings_obj.
13337 Remove calls to g_settings_bind. Connect something_changedCB to
13338 "changed".
13339
13340 * xgselect.c: Add defined (HAVE_GSETTINGS).
13341 (xgselect_initialize): Ditto.
13342
13343 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13344 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13345 xg_select.
13346
13347 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13348
13349 * eval.c (struct backtrace): Simplify and port the data structure.
13350 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13351 signed bit field, as this assumption is not portable and it makes
13352 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13353 "char debug_on_exit : 1" as this is not portable either; instead,
13354 use the portable "unsigned int debug_on_exit : 1". Remove unused
13355 member evalargs. Remove obsolete comments about cc bombing out.
13356
13357 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13358
13359 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
13360 Let HAVE_GSETTINGS override HAVE_GCONF.
13361 (store_monospaced_changed): New function.
13362 (EMACS_SETTINGS): A new type derived from GObject to handle
13363 GSettings notifications.
13364 (emacs_settings_constructor, emacs_settings_get_property)
13365 (emacs_settings_set_property, emacs_settings_class_init):
13366 New functions.
13367 (gsettings_client, gsettings_obj): New variables.
13368 (GSETTINGS_SCHEMA): New define.
13369 (something_changedCB): Call store_monospaced_changed.
13370 (init_gsettings): New function.
13371 (xsettings_initialize): Call init_gsettings.
13372 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13373 to NULL.
13374
13375 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13376 GCONF_CFLAGS/LIBS.
13377
13378 2011-06-29 Martin Rudalics <rudalics@gmx.at>
13379
13380 * window.c (resize_root_window, grow_mini_window)
13381 (shrink_mini_window): Rename Qresize_root_window to
13382 Qwindow_resize_root_window and Qresize_root_window_vertically to
13383 Qwindow_resize_root_window_vertically.
13384
13385 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13386
13387 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13388
13389 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
13390
13391 * makefile.w32-in: Redesign dependencies so they reflect more
13392 clearly which files are directly included by each source file,
13393 and not through other includes.
13394
13395 2011-06-27 Martin Rudalics <rudalics@gmx.at>
13396
13397 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13398 (sort_overlays, overlay_strings): When an overlay's clone number
13399 matches the window's clone number process the overlay even if
13400 the overlay's window property doesn't match the current window.
13401
13402 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13403 (Fwindow_hchild): Rename to Fwindow_left_child.
13404 (Fwindow_next): Rename to Fwindow_next_sibling.
13405 (Fwindow_prev): Rename to Fwindow_prev_sibling.
13406 (resize_window_check): Rename to window_resize_check.
13407 (resize_window_apply): Rename to window_resize_apply.
13408 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13409 (Fdelete_other_windows_internal, resize_frame_windows)
13410 (Fsplit_window_internal, Fdelete_window_internal)
13411 (grow_mini_window, shrink_mini_window)
13412 (Fresize_mini_window_internal): Fix callers accordingly.
13413
13414 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13415
13416 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13417 (emacs_fixed_set_min_size): Remove.
13418 (emacs_fixed_new): Take frame as argument.
13419
13420 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13421 (_EmacsFixedPrivate): Remove minwidth/height.
13422 Add struct frame *f.
13423 (emacs_fixed_init): Initialize priv->f.
13424 (get_parent_class, emacs_fixed_set_min_size): Remove.
13425 (emacs_fixed_new): Set priv->f to argument.
13426 (emacs_fixed_get_preferred_width)
13427 (emacs_fixed_get_preferred_height): Use min_width/height from
13428 frames size_hint to set minimum and natural (Bug#8919).
13429 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13430 and use min_width/height from frames size_hint to set
13431 min_width/height (Bug#8919).
13432
13433 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13434 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13435 Fix indentation.
13436
13437 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13438
13439 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13440 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13441 called at ZV.
13442
13443 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13444
13445 * process.c (wait_reading_process_output): Bypass select if
13446 waiting for a cell while ignoring keyboard input, and input is
13447 pending. Suggested by Jan Djärv (Bug#8869).
13448
13449 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13450
13451 Use gnulib's dup2 module instead of rolling our own.
13452 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13453
13454 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13455
13456 * dispnew.c (scrolling_window): Before scrolling, turn off a
13457 mouse-highlight in the window being scrolled.
13458
13459 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13460
13461 Move DEFSYM to lisp.h and use everywhere.
13462
13463 * character.h (DEFSYM): Move declaration...
13464 * lisp.h (DEFSYM): ...here.
13465
13466 * gnutls.c:
13467 * minibuf.c:
13468 * w32menu.c:
13469 * w32proc.c:
13470 * w32select.c: Don't include character.h.
13471
13472 * alloc.c (syms_of_alloc):
13473 * buffer.c (syms_of_buffer):
13474 * bytecode.c (syms_of_bytecode):
13475 * callint.c (syms_of_callint):
13476 * casefiddle.c (syms_of_casefiddle):
13477 * casetab.c (init_casetab_once):
13478 * category.c (init_category_once, syms_of_category):
13479 * ccl.c (syms_of_ccl):
13480 * cmds.c (syms_of_cmds):
13481 * composite.c (syms_of_composite):
13482 * dbusbind.c (syms_of_dbusbind):
13483 * dired.c (syms_of_dired):
13484 * dispnew.c (syms_of_display):
13485 * doc.c (syms_of_doc):
13486 * editfns.c (syms_of_editfns):
13487 * emacs.c (syms_of_emacs):
13488 * eval.c (syms_of_eval):
13489 * fileio.c (syms_of_fileio):
13490 * fns.c (syms_of_fns):
13491 * frame.c (syms_of_frame):
13492 * fringe.c (syms_of_fringe):
13493 * insdel.c (syms_of_insdel):
13494 * keymap.c (syms_of_keymap):
13495 * lread.c (init_obarray, syms_of_lread):
13496 * macros.c (syms_of_macros):
13497 * msdos.c (syms_of_msdos):
13498 * print.c (syms_of_print):
13499 * process.c (syms_of_process):
13500 * search.c (syms_of_search):
13501 * sound.c (syms_of_sound):
13502 * syntax.c (init_syntax_once, syms_of_syntax):
13503 * terminal.c (syms_of_terminal):
13504 * textprop.c (syms_of_textprop):
13505 * undo.c (syms_of_undo):
13506 * w32.c (globals_of_w32):
13507 * window.c (syms_of_window):
13508 * xdisp.c (syms_of_xdisp):
13509 * xfaces.c (syms_of_xfaces):
13510 * xfns.c (syms_of_xfns):
13511 * xmenu.c (syms_of_xmenu):
13512 * xsettings.c (syms_of_xsettings):
13513 * xterm.c (syms_of_xterm): Use DEFSYM.
13514
13515 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13516
13517 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13518
13519 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13520
13521 Integer and buffer overflow fixes (Bug#8873).
13522
13523 * print.c (printchar, strout): Check for string overflow.
13524 (PRINTPREPARE, printchar, strout):
13525 Don't set size unless allocation succeeds.
13526
13527 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13528 for sizes. Check for string overflow more accurately.
13529 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13530
13531 * macros.c: Integer and buffer overflow fixes.
13532 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13533 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13534 Use ptrdiff_t, not int, for sizes.
13535 Don't increment bufsize until after realloc succeeds.
13536 Check for size-calculation overflow.
13537 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13538
13539 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13540
13541 * lread.c: Integer overflow fixes.
13542 (read_integer): Radix is now EMACS_INT, not int,
13543 to improve quality of diagnostics for out-of-range radices.
13544 Calculate buffer size correctly for out-of-range radices.
13545 (read1): Check for integer overflow in radices, and in
13546 read-circle numbers.
13547 (read_escape): Avoid int overflow.
13548 (Fload, openp, read_buffer_size, read1)
13549 (substitute_object_recurse, read_vector, read_list, map_obarray):
13550 Use ptrdiff_t, not int, for sizes.
13551 (read1): Use EMACS_INT, not int, for sizes.
13552 Check for size overflow.
13553
13554 * image.c (cache_image): Check for size arithmetic overflow.
13555
13556 * lread.c: Integer overflow issues.
13557 (saved_doc_string_size, saved_doc_string_length)
13558 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13559 Now ptrdiff_t, not int.
13560 (read1): Don't assume doc string length fits in int. Check for
13561 out-of-range doc string lengths.
13562 (read_list): Don't assume file position fits in int.
13563 (read_escape): Check for hex character overflow.
13564
13565 2011-06-22 Leo Liu <sdl.web@gmail.com>
13566
13567 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13568 Move to minibuffer.el.
13569
13570 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13571
13572 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13573 The following patches are for when GLYPH_DEBUG && !XASSERT.
13574 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13575 * dispnew.c (flush_stdout):
13576 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13577 Mark as externally visible.
13578 * dispnew.c (check_window_matrix_pointers): Now static.
13579 * dispnew.c (window_to_frame_vpos):
13580 * xfns.c (unwind_create_frame):
13581 * xterm.c (x_check_font): Remove unused local.
13582 * scroll.c (CHECK_BOUNDS):
13583 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13584 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13585 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13586 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13587 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13588 Now static.
13589 (debug_method_add): Use va_list and vsprintf rather than relying
13590 on undefined behavior with wrong number of arguments.
13591 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13592 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13593 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13594 since we're not interested in debugging glyphs with old libraries.
13595 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13596 GCC 4.6.0's static checking.
13597
13598 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13599
13600 Integer overflow and signedness fixes (Bug#8873).
13601 A few related buffer overrun fixes, too.
13602
13603 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13604
13605 * dispextern.h (struct face.stipple):
13606 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13607 (x_bitmap_mask, x_allocate_bitmap_record)
13608 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13609 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13610 (x_create_bitmap_from_xpm_data):
13611 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13612 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13613 (.bitmaps_last):
13614 * xfaces.c (load_pixmap):
13615 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13616 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13617 (.bitmaps_last, struct x_output.icon_bitmap):
13618 Use ptrdiff_t, not int, for bitmap indexes.
13619 (x_allocate_bitmap_record): Check for size overflow.
13620 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13621
13622 Use ptrdiff_t, not int, for overlay counts.
13623 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13624 * editfns.c (overlays_around, get_pos_property):
13625 * textprop.c (get_char_property_and_overlay):
13626 * xdisp.c (next_overlay_change, note_mouse_highlight):
13627 * xfaces.c (face_at_buffer_position):
13628 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13629 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13630 (Fnext_overlay_change, Fprevious_overlay_change)
13631 (mouse_face_overlay_overlaps, Foverlays_in):
13632 Use ptrdiff_t, not int, for sizes.
13633 (overlays_at, overlays_in): Check for size-calculation overflow.
13634
13635 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13636
13637 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13638 (x_session_initialize): Do not assume string length fits in int.
13639
13640 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13641 This is unlikely, but can occur if DPI is outlandish.
13642
13643 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13644 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13645
13646 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13647 * xrdb.c (magic_file_p, search_magic_path):
13648 Omit last arg SUFFIX; it was always 0. All callers changed.
13649 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13650
13651 * xfont.c (xfont_match): Avoid need for strlen.
13652
13653 * xfns.c: Don't assume strlen fits in int.
13654 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13655
13656 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13657 not unsigned long, as we prefer signed integers. All callers changed.
13658 Detect integer overflow in repeat count.
13659 (message_dolog): Don't assume print length fits in 39 bytes.
13660 (display_mode_element): Don't assume strlen fits in int.
13661
13662 * termcap.c: Don't assume sizes fit in int and never overflow.
13663 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13664 (gobble_line): Check for size-calculation overflow.
13665
13666 * minibuf.c (Fread_buffer):
13667 * lread.c (intern, intern_c_string):
13668 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13669 Don't assume string length fits in int.
13670
13671 * keyboard.c (parse_tool_bar_item):
13672 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13673
13674 * font.c: Don't assume string length fits in int.
13675 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13676 Use ptrdiff_t, not int.
13677 (font_intern_prop): Don't assume string length fits in int.
13678 Don't assume integer property fits in fixnum.
13679 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13680
13681 * filelock.c: Fix some buffer overrun and integer overflow issues.
13682 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13683 Reformulate so as not to need the command string.
13684 Invoke gzip -cd rather than gunzip, as it's more portable.
13685 (lock_info_type, lock_file_1, lock_file):
13686 Don't assume pid_t and time_t fit in unsigned long.
13687 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13688 (current_lock_owner): Prefer signed type for sizes.
13689 Use memcpy, not strncpy, where memcpy is what is really wanted.
13690 Don't assume (via atoi) that time_t and pid_t fit in int.
13691 Check for time_t and/or pid_t out of range, e.g., via a network share.
13692 Don't alloca where an auto var works fine.
13693
13694 * fileio.c: Fix some integer overflow issues.
13695 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13696 Don't assume string length fits in int.
13697 (directory_file_name): Don't assume string length fits in long.
13698 (make_temp_name): Don't assume pid fits in int, or that its print
13699 length is less than 20.
13700
13701 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13702
13703 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13704
13705 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13706
13707 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13708 We prefer signed integers, even for size calculations.
13709
13710 * emacs.c: Don't assume string length fits in 'int'.
13711 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13712 (main): Don't invoke strlen when not needed.
13713
13714 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13715 (XD_DEBUG_MESSAGE): Don't waste a byte.
13716
13717 * callproc.c (getenv_internal_1, getenv_internal)
13718 (Fgetenv_internal):
13719 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13720
13721 * lread.c (invalid_syntax): Omit length argument.
13722 All uses changed. This doesn't fix a bug, but it simplifies the
13723 code away from its former Hollerith-constant appearance, and it's
13724 one less 'int' to worry about when looking at integer-overflow issues.
13725 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13726
13727 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13728 This didn't break anything, but it didn't help either.
13729 It's confusing to put a bogus integer in a place where the actual
13730 value does not matter.
13731 (LIST_END_P): Remove unused macro and its bogus comment.
13732 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13733
13734 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13735 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13736 implementation.
13737 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13738 We prefer signed types, and the value cannot exceed the EMACS_INT
13739 range anyway (because otherwise the length would not be representable).
13740 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13741 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13742 This avoids a GCC warning when WIDE_EMACS_INT.
13743
13744 * indent.c (sane_tab_width): New function.
13745 (current_column, scan_for_column, Findent_to, position_indentation)
13746 (compute_motion): Use it. This is just for clarity.
13747 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13748
13749 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13750
13751 * lisp.h (lint_assume): New macro.
13752 * composite.c (composition_gstring_put_cache):
13753 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13754
13755 * editfns.c, insdel.c:
13756 Omit unnecessary forward decls, to simplify future changes.
13757
13758 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13759
13760 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13761
13762 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13763 Use much-faster test for byte-length change.
13764 Don't assume string byte-length fits in 'int'.
13765 Check that character arg fits in 'int'.
13766 (mapcar1): Declare byte as byte, for clarity.
13767
13768 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13769
13770 * fns.c (concat): Catch string overflow earlier.
13771 Do not rely on integer wraparound.
13772
13773 * dispextern.h (struct it.overlay_strings_charpos)
13774 (struct it.selective): Now EMACS_INT, not int.
13775 * xdisp.c (forward_to_next_line_start)
13776 (back_to_previous_visible_line_start)
13777 (reseat_at_next_visible_line_start, next_element_from_buffer):
13778 Don't arbitrarily truncate the value of 'selective' to int.
13779
13780 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13781
13782 * composite.c: Don't truncate sizes to 'int'.
13783 (composition_gstring_p, composition_reseat_it)
13784 (composition_adjust_point): Use EMACS_INT, not int.
13785 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13786 not EMACS_UINT, for indexes.
13787
13788 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13789
13790 * buffer.c: Include <verify.h>.
13791 (struct sortvec.priority, struct sortstr.priority):
13792 Now EMACS_INT, not int.
13793 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13794 (struct sortstr.size, record_overlay_string)
13795 (struct sortstrlist.size, struct sortlist.used):
13796 Don't truncate size to int.
13797 (record_overlay_string): Check for size-calculation overflow.
13798 (init_buffer_once): Check at compile-time, not run-time.
13799
13800 2011-06-22 Jim Meyering <meyering@redhat.com>
13801
13802 Don't leak an XBM-image-sized buffer
13803 * image.c (xbm_load): Free the image buffer after using it.
13804
13805 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13806
13807 Port to Sun C.
13808 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13809 that Sun C diagnosed.
13810 * fns.c (secure_hash): Fix pointer signedness issue.
13811 * intervals.c (static_offset_intervals): New function.
13812 (offset_intervals): Use it.
13813
13814 2011-06-21 Leo Liu <sdl.web@gmail.com>
13815
13816 * deps.mk (fns.o):
13817 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13818 sha512.h.
13819
13820 * fns.c (secure_hash): Rename from crypto_hash_function and change
13821 the first arg to accept symbols.
13822 (Fsecure_hash): New primitive.
13823 (syms_of_fns): New symbols.
13824
13825 2011-06-20 Deniz Dogan <deniz@dogan.se>
13826
13827 * process.c (Fset_process_buffer): Clarify return value in
13828 docstring.
13829
13830 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
13831
13832 * dispnew.c (add_window_display_history): Use BVAR.
13833
13834 * xdisp.c (debug_method_add): Use BVAR.
13835 (check_window_end, dump_glyph_matrix, dump_glyph)
13836 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13837
13838 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13839 Likewise.
13840
13841 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13842 check till after the cache is created in init_frame_faces.
13843
13844 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13845
13846 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13847
13848 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13849
13850 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13851 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13852 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13853
13854 Improve buffer-overflow checking (Bug#8873).
13855 * fileio.c (Finsert_file_contents):
13856 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13857 Remove the old (too-loose) buffer overflow checks.
13858 They weren't needed, since make_gap checks for buffer overflow.
13859 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13860 The old code merely checked for Emacs fixnum overflow, and relied
13861 on undefined (wraparound) behavior. The new code avoids undefined
13862 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13863
13864 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13865 Tune. Don't use wider integers than needed. Don't use alloca.
13866 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13867
13868 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13869
13870 * insdel.c, lisp.h (buffer_overflow): New function.
13871 (insert_from_buffer_1, replace_range, replace_range_2):
13872 * insdel.c (make_gap_larger):
13873 * editfns.c (Finsert_char):
13874 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13875
13876 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13877
13878 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13879
13880 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13881
13882 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13883 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13884
13885 * fileio.c: Don't assume EMACS_INT fits in off_t.
13886 (emacs_lseek): New static function.
13887 (Finsert_file_contents, Fwrite_region): Use it.
13888 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13889
13890 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13891
13892 * fns.c: Don't overflow int when computing a list length.
13893 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13894 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13895 truncation on 64-bit hosts. Check for QUIT every
13896 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13897 faster and is responsive enough.
13898 (Flength): Report an error instead of overflowing an integer.
13899 (Fsafe_length): Return a float if the value is not representable
13900 as a fixnum. This shouldn't happen except in contrived situations.
13901 (Fnthcdr, Fsort): Don't assume list length fits in int.
13902 (Fcopy_sequence): Don't assume vector length fits in int.
13903
13904 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13905 (header_size, word_size): New constants.
13906 (allocate_vectorlike): Don't check size overflow here.
13907 (allocate_vector): Check it here instead, since this is the only
13908 caller of allocate_vectorlike that could cause overflow.
13909 Check that the new vector's length is representable as a fixnum.
13910
13911 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13912 The previous code was bogus. For example, next_almost_prime (32)
13913 returned 39, which is undesirable as it is a multiple of 3; and
13914 next_almost_prime (24) returned 25, which is a multiple of 5 so
13915 why was the code bothering to check for multiples of 7?
13916
13917 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13918
13919 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13920
13921 Variadic C functions now count arguments with ptrdiff_t.
13922 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13923 Back then I didn't know that the Emacs coding style prefers signed int.
13924 Also, in the meantime I found a few more instances where arguments
13925 were being counted with int, which may truncate counts on 64-bit
13926 machines, or EMACS_INT, which may be unnecessarily wide.
13927 * lisp.h (struct Lisp_Subr.function.aMANY)
13928 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13929 Arg counts are now ptrdiff_t, not size_t.
13930 All variadic functions and their callers changed accordingly.
13931 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13932 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13933 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13934 * callint.c (Fcall_interactively): Check arg count for overflow,
13935 to avoid potential buffer overrun. Use signed char, not 'int',
13936 for 'varies' array, so that we needn't bother to check its size
13937 calculation for overflow.
13938 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13939 * eval.c (apply_lambda):
13940 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13941 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13942 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13943
13944 * callint.c (Fcall_interactively): Don't use index var as event count.
13945
13946 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13947 * mem-limits.h (SIZE): Remove; no longer used.
13948
13949 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13950
13951 Remove unnecessary casts.
13952 * xterm.c (x_term_init):
13953 * xfns.c (x_set_border_pixel):
13954 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13955 These aren't needed now that we assume ANSI C.
13956
13957 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13958 It's more likely to cause problems (due to unsigned overflow)
13959 than to cure them.
13960
13961 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13962
13963 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13964
13965 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13966
13967 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13968
13969 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13970
13971 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13972
13973 GLYPH_CODE_FACE returns EMACS_INT, not int.
13974 * dispextern.h (merge_faces):
13975 * xfaces.c (merge_faces):
13976 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13977 Don't assume EMACS_INT fits in int.
13978
13979 * character.h (CHAR_VALID_P): Remove unused parameter.
13980 * fontset.c, lisp.h, xdisp.c: All uses changed.
13981
13982 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13983
13984 * fns.c (concat): Minor tuning based on overflow analysis.
13985 This doesn't fix any bugs. Use int to hold character, instead
13986 of constantly refetching from Emacs object. Use XFASTINT, not
13987 XINT, for value known to be a character. Don't bother comparing
13988 a single byte to 0400, as it's always less.
13989
13990 * floatfns.c (Fexpt):
13991 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13992
13993 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13994 for characters.
13995
13996 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13997
13998 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13999 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14000 incorrectly succeed when S was a string, because 4294967386 was
14001 truncated before it was used.
14002
14003 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14004 Otherwise, an out-of-range integer could cause undefined behavior
14005 on a 64-bit host.
14006
14007 * composite.c: Use int, not EMACS_INT, for characters.
14008 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14009 EMACS_INT, for values that are known to be in character range.
14010 This doesn't fix any bugs but is the usual style inside Emacs and
14011 may generate better code on 32-bit machines.
14012
14013 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14014 This is for reasons similar to the recent CHAR_STRING fix.
14015 * charset.c (Fencode_char): Check that character arg is actually
14016 a character. Pass an int to ENCODE_CHAR.
14017 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14018 wider than 'int', as a compile-time check to prevent future regressions
14019 in this area.
14020
14021 * character.c (char_string): Remove unnecessary casts.
14022
14023 Make sure a 64-bit char is never passed to CHAR_STRING.
14024 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14025 by silently ignoring the top 32 bits, allowing some values
14026 that were far too large to be valid characters.
14027 * character.h: Include <verify.h>.
14028 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14029 arguments are no wider than unsigned, as a compile-time check
14030 to prevent future regressions in this area.
14031 * data.c (Faset):
14032 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14033 (Fsubst_char_in_region):
14034 * fns.c (concat):
14035 * xdisp.c (decode_mode_spec_coding):
14036 Adjust to CHAR_STRING's new requirement.
14037 * editfns.c (Finsert_char, Fsubst_char_in_region):
14038 * fns.c (concat): Check that character args are actually
14039 characters. Without this test, these functions did the wrong
14040 thing with wildly out-of-range values on 64-bit hosts.
14041
14042 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14043 These casts should not be needed on 32-bit hosts, either.
14044 * keyboard.c (read_char):
14045 * lread.c (Fload): Remove casts to unsigned.
14046
14047 * lisp.h (UNSIGNED_CMP): New macro.
14048 This fixes comparison bugs on 64-bit hosts.
14049 (ASCII_CHAR_P): Use it.
14050 * casefiddle.c (casify_object):
14051 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14052 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14053 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14054 * dispextern.h (FACE_FROM_ID):
14055 * keyboard.c (read_char): Use UNSIGNED_CMP.
14056
14057 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14058 not to EMACS_INT, to avoid GCC warning.
14059
14060 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14061
14062 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14063 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14064 isn't needed on 32-bit machines.
14065
14066 * buffer.c (Fgenerate_new_buffer_name):
14067 Use EMACS_INT for count, not int.
14068 (advance_to_char_boundary): Return EMACS_INT, not int.
14069
14070 * data.c (Qcompiled_function): Now static.
14071
14072 * window.c (window_body_lines): Now static.
14073
14074 * image.c (gif_load): Rename local to avoid shadowing.
14075
14076 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14077 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14078 * alloc.c (make_save_value): Integer argument is now of type
14079 ptrdiff_t, not int.
14080 (mark_object): Use ptrdiff_t, not int.
14081 * lisp.h (pD): New macro.
14082 * print.c (print_object): Use it.
14083
14084 * alloc.c: Use EMACS_INT, not int, to count objects.
14085 (total_conses, total_markers, total_symbols, total_vector_size)
14086 (total_free_conses, total_free_markers, total_free_symbols)
14087 (total_free_floats, total_floats, total_free_intervals)
14088 (total_intervals, total_strings, total_free_strings):
14089 Now EMACS_INT, not int. All uses changed.
14090 (Fgarbage_collect): Compute overall total using a double, so that
14091 integer overflow is less likely to be a problem. Check for overflow
14092 when converting back to an integer.
14093 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14094 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14095 These were 'int' variables that could overflow on 64-bit hosts;
14096 they were never used, so remove them instead of repairing them.
14097 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14098 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14099 Previously, this ceilinged at INT_MAX, but that doesn't work on
14100 64-bit machines.
14101 (allocate_pseudovector): Don't use EMACS_INT when int would do.
14102
14103 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14104 (allocate_vectorlike): Check for ptrdiff_t overflow.
14105 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14106 when a (possibly-narrower) signed value would do just as well.
14107 We prefer using signed arithmetic, to avoid comparison confusion.
14108
14109 * alloc.c: Catch some string size overflows that we were missing.
14110 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14111 for convenience in STRING_BYTES_MAX.
14112 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14113 The definition here is exact; the one in lisp.h was approximate.
14114 (allocate_string_data): Check for string overflow. This catches
14115 some instances we weren't catching before. Also, it catches
14116 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14117 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14118 and ptrdiff_t and EMACS_INT are both 64 bits.
14119
14120 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14121 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14122 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14123
14124 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14125
14126 * alloc.c (Fmake_string): Check for out-of-range init.
14127
14128 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14129
14130 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14131
14132 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14133
14134 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14135 xg_get_default_scrollbar_width.
14136
14137 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14138 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14139 (style_changed_cb): Call update_theme_scrollbar_width and call
14140 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14141 all frames (Bug#8505).
14142 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14143 Call gtk_window_set_resizable if HAVE_GTK3.
14144 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14145 and height if HAVE_GTK3 (Bug#8505).
14146 (scroll_bar_width_for_theme): New variable.
14147 (update_theme_scrollbar_width): New function.
14148 (xg_get_default_scrollbar_width): Move code to
14149 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14150 (xg_initialize): Call update_theme_scrollbar_width.
14151
14152 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14153
14154 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14155
14156 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14157
14158 * frame.c (make_frame): Call other_buffer_safely instead of
14159 other_buffer.
14160
14161 * window.c (temp_output_buffer_show): Call display_buffer with
14162 second argument Vtemp_buffer_show_specifiers and reset latter
14163 immediately after the call.
14164 (Vtemp_buffer_show_specifiers): New variable.
14165 (auto_window_vscroll_p, next_screen_context_lines)
14166 (Vscroll_preserve_screen_position): Remove leading asterisks from
14167 doc-strings.
14168
14169 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
14170
14171 Fix minor problems found by GCC 4.6.0 static checking.
14172 * buffer.c (Qclone_number): Remove for now, as it's unused.
14173 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14174 (record_buffer): Remove unused local.
14175 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14176 (set_frame_buffer_list): Remove; unused.
14177 * frame.h (other_visible_frames): Remove decl.
14178 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14179 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14180 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14181 if HAVE_GPM.
14182 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14183 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14184 Define only if HAVE_GPM.
14185 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14186 (update_hints_inhibit): Remove; never set. All uses removed.
14187 * widgetprv.h (emacsFrameClassRec): Remove decl.
14188 * window.c (delete_deletable_window): Now returns void, since it
14189 wasn't returning anything.
14190 (compare_window_configurations): Remove unused locals.
14191 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14192 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14193 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14194 the same widths as pointers. This follows up on the 2011-05-06 patch.
14195 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14196 * xterm.h: Likewise.
14197 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14198
14199 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
14200
14201 * makefile.w32-in: Update dependencies.
14202 (LISP_H): Add lib/intprops.h.
14203
14204 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14205
14206 * image.c (gif_load): Add animation frame delay to the metadata.
14207 (syms_of_image): Use DEFSYM. New symbol `delay'.
14208
14209 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14210
14211 * window.c (delete_deletable_window): Re-add.
14212 (Fset_window_configuration): Rewrite to handle dead buffers and
14213 consequently deletable windows.
14214 (window_tree, Fwindow_tree): Remove. Supply functionality in
14215 window.el.
14216 (compare_window_configurations): Simplify code.
14217
14218 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14219
14220 * image.c (imagemagick_load_image): Fix type mismatch.
14221 (Fimagemagick_types): Likewise.
14222
14223 * window.h (replace_buffer_in_windows): Declare.
14224
14225 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14226
14227 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14228 Qclone_number. Remove external declaration of Qdelete_window.
14229 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14230 code.
14231 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14232 Run Qbuffer_list_update_hook if allowed.
14233 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14234 buffer list implementation.
14235 (other_buffer_safely): New function.
14236 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14237 calls to replace_buffer_in_windows and
14238 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14239 if allowed.
14240 (record_buffer): Inhibit quitting and rewrite using quittable
14241 functions. Run Qbuffer_list_update_hook if allowed.
14242 (Frecord_buffer, Funrecord_buffer): New functions.
14243 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14244 Move switch-to-buffer to window.el.
14245 (bury-buffer): Move to window.el.
14246 (Vbuffer_list_update_hook): New variable.
14247
14248 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14249 section.
14250
14251 * window.h (resize_frame_windows): Move up in code.
14252 (Fwindow_frame): Remove EXFUN.
14253 (replace_buffer_in_all_windows): Remove prototype.
14254 (replace_buffer_in_windows_safely): Add prototype.
14255
14256 * window.c: Declare Qdelete_window static again. Move down
14257 declaration of select_count.
14258 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14259 (Fother_window): Move to window.el.
14260 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14261 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14262 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14263 window.el.
14264 (replace_buffer_in_windows): Implement by calling
14265 Qreplace_buffer_in_windows.
14266 (replace_buffer_in_all_windows): Remove with some functionality
14267 moved into replace_buffer_in_windows_safely.
14268 (replace_buffer_in_windows_safely): New function.
14269 (select_window_norecord, select_frame_norecord): Move in front
14270 of run_window_configuration_change_hook. Remove now obsolete
14271 declarations.
14272 (Fset_window_buffer): Rewrite doc-string.
14273 Call Qrecord_window_buffer.
14274 (keys_of_window): Move binding for other-window to window.el.
14275
14276 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14277
14278 * dispextern.h (struct image): Replace data member, whose int_val
14279 and ptr_val fields were not used by anything, with a single
14280 lisp_val object.
14281
14282 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14283 (gif_clear_image, gif_load, imagemagick_load_image)
14284 (gs_clear_image, gs_load): Callers changed.
14285
14286 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14287
14288 * buffer.h: Include <time.h>, for time_t.
14289 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14290
14291 Fix minor problems found by static checking.
14292
14293 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14294
14295 Make identifiers static if they are not used in other modules.
14296 * data.c (Qcompiled_function, Qframe, Qvector):
14297 * image.c (QimageMagick, Qsvg):
14298 * minibuf.c (Qmetadata):
14299 * window.c (resize_window_check, resize_root_window): Now static.
14300 * window.h (resize_window_check, resize_root_window): Remove decls.
14301
14302 * window.c (window_deletion_count, delete_deletable_window):
14303 Remove; unused.
14304 (window_body_lines): Now static.
14305 (Fdelete_other_windows_internal): Mark vars as initialized.
14306 Make sure 'resize_failed' is initialized.
14307 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14308 (resize_window_apply): Remove unused local.
14309 * window.h (delete_deletable_window): Remove decl.
14310
14311 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14312 (imagemagick_load_image): Fix pointer signedness problem by changing
14313 last arg from unsigned char * to char *. All uses changed.
14314 Also, fix a local for similar reasons.
14315 Remove unused locals. Remove locals to avoid shadowing.
14316 (fn_rsvg_handle_free): Remove; unused.
14317 (svg_load, svg_load_image): Fix pointer signedness problem.
14318 (imagemagick_load_image): Don't use garbage pointer image_wand.
14319
14320 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14321
14322 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
14323
14324 * image.c (gif_load): Fix omitted cast error introduced by
14325 2011-06-06 change.
14326
14327 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14328
14329 * window.h (resize_proportionally, orig_total_lines)
14330 (orig_top_line): Remove from window structure.
14331 (set_window_height, set_window_width, change_window_heights)
14332 (Fdelete_window): Remove prototypes.
14333 (resize_frame_windows): Remove duplicate declaration.
14334
14335 2011-06-10 Eli Zaretskii <eliz@gnu.org>
14336
14337 * window.h (resize_frame_windows, resize_window_check)
14338 (delete_deletable_window, resize_root_window)
14339 (resize_frame_windows): Declare prototypes.
14340
14341 * window.c (resize_window_apply): Make definition be "static" to
14342 match the prototype.
14343
14344 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14345
14346 * window.c: Remove declarations of Qwindow_size_fixed,
14347 window_min_size_1, window_min_size_2, window_min_size,
14348 size_window, window_fixed_size_p, enlarge_window, delete_window.
14349 Remove static from declaration of Qdelete_window, it's
14350 temporarily needed by Fbury_buffer.
14351 (replace_window): Don't assign orig_top_line and
14352 orig_total_lines.
14353 (Fdelete_window, delete_window): Remove. Window deletion is
14354 handled by window.el.
14355 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14356 Replace Fdelete_window calls with calls to Qdelete_window.
14357 (Fdelete_other_windows): Remove. Deleting other windows is
14358 handled by window.el.
14359 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14360 handled in window.el.
14361 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14362 Window minimum sizes are handled in window.el.
14363 (shrink_windows, size_window, set_window_height)
14364 (set_window_width, change_window_heights, window_height)
14365 (window_width, CURBEG, CURSIZE, enlarge_window)
14366 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14367 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14368 handled in window.el.
14369 (make_dummy_parent): Rename to make_parent_window and give it a
14370 second argument horflag.
14371 (make_window): Don't set resize_proportionally any more.
14372 (Fsplit_window): Remove. Windows are split in window.el.
14373 (save_restore_action, save_restore_orig_size)
14374 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14375 Resize mini windows in window.el.
14376 (grow_mini_window, shrink_mini_window): Implement by calling
14377 Qresize_root_window_vertically, resize_window_check and
14378 resize_window_apply.
14379 (saved_window, Fset_window_configuration, save_window_save):
14380 Do not handle orig_top_line, orig_total_lines, and
14381 resize_proportionally.
14382 (window_min_height, window_min_width): Move to window.el.
14383 (keys_of_window): Move bindings for delete-other-windows,
14384 split-window, delete-window and enlarge-window to window.el.
14385
14386 * buffer.c: Temporarily extern Qdelete_window.
14387 (Fbury_buffer): Temporarily call Qdelete_window instead of
14388 Fdelete_window (Fbury_buffer will move to window.el soon).
14389
14390 * frame.c (set_menu_bar_lines_1): Remove code handling
14391 orig_top_line and orig_total_lines.
14392
14393 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14394 set_window_height but set heights directly.
14395 (change_frame_size_1): Use resize_frame_windows.
14396
14397 * xdisp.c (init_xdisp): Don't use set_window_height but set
14398 heights directly.
14399
14400 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14401 Use resize_frame_windows instead of change_window_heights and run
14402 run_window_configuration_change_hook.
14403
14404 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14405 instead of change_window_heights and run
14406 run_window_configuration_change_hook.
14407
14408 2011-06-09 Martin Rudalics <rudalics@gmx.at>
14409
14410 * window.c (replace_window): Rename second argument REPLACEMENT to
14411 NEW. New third argument SETFLAG. Rewrite.
14412 (delete_window, make_dummy_parent): Call replace_window with
14413 third argument 1.
14414 (window_list_1): Move down in code.
14415 (run_window_configuration_change_hook): Move set_buffer part
14416 before select_frame_norecord part in order to unwind correctly.
14417 Rename count1 to count.
14418 (recombine_windows, delete_deletable_window, resize_root_window)
14419 (Fdelete_other_windows_internal)
14420 (Frun_window_configuration_change_hook, make_parent_window)
14421 (resize_window_check, resize_window_apply, Fresize_window_apply)
14422 (resize_frame_windows, Fsplit_window_internal)
14423 (Fdelete_window_internal, Fresize_mini_window_internal):
14424 New functions.
14425 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14426
14427 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14428
14429 * window.h (window): Add some new members to window structure -
14430 normal_lines, normal_cols, new_total, new_normal, clone_number,
14431 splits, nest, prev_buffers, next_buffers.
14432 (WINDOW_TOTAL_SIZE): Move here from window.c.
14433 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14434
14435 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14436 Remove.
14437 (make_dummy_parent): Set new members of windows structure.
14438 (make_window): Move down in code. Handle new members of window
14439 structure.
14440 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14441 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14442 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14443 (Fset_window_prev_buffers, Fwindow_next_buffers)
14444 (Fset_window_next_buffers, Fset_window_clone_number):
14445 New functions.
14446 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14447 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14448 Doc-string fixes.
14449 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14450 Argument WINDOW can be now internal window too.
14451 (Fwindow_use_time): Move up in code.
14452 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14453 Rewrite doc-string.
14454 (Fset_window_configuration, saved_window)
14455 (Fcurrent_window_configuration, save_window_save): Handle new
14456 members of window structure.
14457 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14458 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14459 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14460 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14461 Qget_mru_window, Qresize_root_window,
14462 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14463 Qauto_buffer_name; staticpro them.
14464
14465 2011-06-07 Martin Rudalics <rudalics@gmx.at>
14466
14467 * window.c (Fwindow_total_size, Fwindow_left_column)
14468 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14469 (Fwindow_list_1): New functions.
14470 (window_box_text_cols): Replace with window_body_cols.
14471 (Fwindow_width, Fscroll_left, Fscroll_right):
14472 Use window_body_cols instead of window_box_text_cols.
14473 (delete_window, Fset_window_configuration):
14474 Call delete_all_subwindows with window as argument.
14475 (delete_all_subwindows): Take a window as argument and not a
14476 structure. Rewrite.
14477 (window_loop): Remove handling of GET_LRU_WINDOW and
14478 GET_LARGEST_WINDOW.
14479 (Fget_lru_window, Fget_largest_window): Move to window.el.
14480
14481 * window.h: Extern window_body_cols instead of
14482 window_box_text_cols. delete_all_subwindows now takes a
14483 Lisp_Object as argument.
14484
14485 * indent.c (compute_motion, Fcompute_motion):
14486 Use window_body_cols instead of window_box_text_cols.
14487
14488 * frame.c (delete_frame): Call delete_all_subwindows with root
14489 window as argument.
14490
14491 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14492
14493 * fns.c (Fputhash): Document return value.
14494
14495 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
14496
14497 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14498
14499 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14500
14501 Cons<->int and similar integer overflow fixes (Bug#8794).
14502
14503 Check for overflow when converting integer to cons and back.
14504 * charset.c (Fdefine_charset_internal, Fdecode_char):
14505 Use cons_to_unsigned to catch overflow.
14506 (Fencode_char): Use INTEGER_TO_CONS.
14507 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14508 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14509 * data.c (long_to_cons, cons_to_long): Remove.
14510 (cons_to_unsigned, cons_to_signed): New functions.
14511 These signal an error for invalid or out-of-range values.
14512 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14513 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14514 * font.c (Ffont_variation_glyphs):
14515 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14516 * lisp.h: Include <intprops.h>.
14517 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14518 (cons_to_signed, cons_to_unsigned): New decls.
14519 (long_to_cons, cons_to_long): Remove decls.
14520 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14521 (Fprimitive_undo): Use CONS_TO_INTEGER.
14522 * xfns.c (Fx_window_property): Likewise.
14523 * xselect.c: Include <limits.h>.
14524 (x_own_selection, selection_data_to_lisp_data):
14525 Use INTEGER_TO_CONS.
14526 (x_handle_selection_request, x_handle_selection_clear)
14527 (x_get_foreign_selection, Fx_disown_selection_internal)
14528 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14529 (lisp_data_to_selection_data): Use cons_to_unsigned.
14530 (x_fill_property_data): Use cons_to_signed.
14531 Report values out of range.
14532
14533 Check for buffer and string overflow more precisely.
14534 * buffer.h (BUF_BYTES_MAX): New macro.
14535 * lisp.h (STRING_BYTES_MAX): New macro.
14536 * alloc.c (Fmake_string):
14537 * character.c (string_escape_byte8):
14538 * coding.c (coding_alloc_by_realloc):
14539 * doprnt.c (doprnt):
14540 * editfns.c (Fformat):
14541 * eval.c (verror):
14542 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14543 since they may not be the same number.
14544 * editfns.c (Finsert_char):
14545 * fileio.c (Finsert_file_contents):
14546 Likewise for BUF_BYTES_MAX.
14547
14548 * image.c: Use ptrdiff_t, not int, for sizes.
14549 (slurp_file): Switch from int to ptrdiff_t.
14550 All uses changed.
14551 (slurp_file): Check that file size fits in both size_t (for
14552 malloc) and ptrdiff_t (for sanity and safety).
14553
14554 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14555 if b->modtime has its maximal value.
14556
14557 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14558
14559 Don't assume time_t can fit into int.
14560 * buffer.h (struct buffer.modtime): Now time_t, not int.
14561 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14562 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14563
14564 Minor fixes for signed vs unsigned integers.
14565 * character.h (MAYBE_UNIFY_CHAR):
14566 * charset.c (maybe_unify_char):
14567 * keyboard.c (read_char, reorder_modifiers):
14568 XINT -> XFASTINT, since the integer must be nonnegative.
14569 * ftfont.c (ftfont_spec_pattern):
14570 * keymap.c (access_keymap, silly_event_symbol_error):
14571 XUINT -> XFASTINT, since the integer must be nonnegative.
14572 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14573 since it makes no difference and we prefer signed.
14574 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14575 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14576 nonnegative.
14577
14578 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14579
14580 * window.h (Fwindow_frame): Declare.
14581
14582 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14583
14584 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14585 (SPARE_MEMORY): Always define.
14586 (LARGE_REQUEST): Remove.
14587 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14588
14589 2011-06-06 Martin Rudalics <rudalics@gmx.at>
14590
14591 * lisp.h: Move EXFUNS for Fframe_root_window,
14592 Fframe_first_window and Fset_frame_selected_window to window.h.
14593
14594 * window.h: Move EXFUNS for Fframe_root_window,
14595 Fframe_first_window and Fset_frame_selected_window here from
14596 lisp.h.
14597
14598 * frame.c (Fwindow_frame, Fframe_first_window)
14599 (Fframe_root_window, Fframe_selected_window)
14600 (Fset_frame_selected_window): Move to window.c.
14601 (Factive_minibuffer_window): Move to minibuf.c.
14602 (Fother_visible_frames_p): New function.
14603
14604 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14605
14606 * window.c (decode_window, decode_any_window): Move up in code.
14607 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14608 (inhibit_frame_unsplittable): Remove unused variable.
14609 (Fwindow_buffer): Move up and rewrite doc-string.
14610 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14611 (Fwindow_prev): New functions.
14612 (Fwindow_frame): Move here from frame.c. Accept any window as
14613 argument.
14614 (Fframe_root_window, Fframe_first_window)
14615 (Fframe_selected_window): Move here from frame.c. Accept frame
14616 or arbitrary window as argument. Update doc-strings.
14617 (Fminibuffer_window): Move up in code.
14618 (Fwindow_minibuffer_p): Move up in code and simplify.
14619 (Fset_frame_selected_window): Move here from frame.c.
14620 Marginal rewrite.
14621 (Fselected_window, select_window, Fselect_window): Move up in
14622 code. Minor doc-string fixes.
14623
14624 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14625
14626 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14627 Do not assume that spare memory exists; that assumption is valid
14628 only if SYSTEM_MALLOC.
14629 (LARGE_REQUEST): New macro, so that the issue of large requests
14630 is separated from the issue of spare memory.
14631
14632 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14633
14634 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14635 format. (Bug#8806)
14636
14637 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14638
14639 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14640 before statements.
14641
14642 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14643
14644 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14645
14646 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14647
14648 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14649 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14650
14651 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
14652
14653 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14654
14655 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
14656
14657 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14658 (x_clipboard_manager_save): Add return value.
14659 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14660 New error handlers.
14661 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14662 Obey Vx_select_enable_clipboard_manager. Catch errors in
14663 x_clipboard_manager_save (Bug#8779).
14664 (Vx_select_enable_clipboard_manager): New variable.
14665 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14666
14667 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
14668
14669 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14670
14671 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14672
14673 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14674 in the current matrix if keep_current_p is non-zero.
14675
14676 2011-06-04 Eli Zaretskii <eliz@gnu.org>
14677
14678 * bidi.c (bidi_level_of_next_char): Fix last change.
14679
14680 2011-06-03 Eli Zaretskii <eliz@gnu.org>
14681
14682 Support bidi reordering of text covered by display properties.
14683
14684 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14685 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14686 (bidi_cache_search, bidi_cache_iterator_state)
14687 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14688 (bidi_level_of_next_char, bidi_move_to_visually_next):
14689 Support character positions inside a run of characters covered by a
14690 display string.
14691 (bidi_paragraph_init, bidi_resolve_explicit_1)
14692 (bidi_level_of_next_char): Call bidi_fetch_char and
14693 bidi_fetch_char_advance instead of FETCH_CHAR and
14694 FETCH_CHAR_ADVANCE.
14695 (bidi_init_it): Initialize new members.
14696 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14697 definitions.
14698 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14699 instead of using explicit *_CHAR codes.
14700 (bidi_resolve_explicit, bidi_resolve_weak):
14701 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14702 bidirectional text is supported only in multibyte buffers.
14703 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14704 it to initialize the frame_window_p member of struct bidi_it.
14705 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14706 (bidi_resolve_explicit, bidi_resolve_weak)
14707 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14708 bidi_it->nchars is non-positive.
14709 (bidi_level_of_next_char): Don't try to lookup the cache for the
14710 next/previous character if nothing is cached there yet, or if we
14711 were just reseat()'ed to a new position.
14712
14713 * xdisp.c (set_cursor_from_row): Set start and stop points
14714 according to the row's direction when priming the loop that looks
14715 for the glyph on which to display cursor.
14716 (single_display_spec_intangible_p): Function deleted.
14717 (display_prop_intangible_p): Reimplement to call
14718 handle_display_spec instead of single_display_spec_intangible_p.
14719 Accept 3 additional arguments needed by handle_display_spec.
14720 This fixes incorrect cursor motion across display property with complex
14721 values: lists, `(when COND...)' forms, etc.
14722 (single_display_spec_string_p): Support property values that are
14723 lists with the argument STRING its top-level element.
14724 (display_prop_string_p): Fix the condition for processing a
14725 property that is a list to be consistent with handle_display_spec.
14726 (handle_display_spec): New function, refactored from the
14727 last portion of handle_display_prop.
14728 (compute_display_string_pos): Accept additional argument
14729 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14730 value of a `display' property is a "replacing spec".
14731 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14732 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14733 the display property, but just return a value indicating whether
14734 the display property will replace the characters it covers.
14735 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14736 frame_window_p members of struct bidi_it.
14737 (compute_display_string_pos, compute_display_string_end):
14738 New functions.
14739 (push_it): Accept second argument POSITION, where pop_it should
14740 jump to continue iteration.
14741 (reseat_1): Initialize bidi_it.disp_pos.
14742
14743 * keyboard.c (adjust_point_for_property): Adjust the call to
14744 display_prop_intangible_p to its new signature.
14745
14746 * dispextern.h (struct bidi_it): New member frame_window_p.
14747 (bidi_init_it): Update prototypes.
14748 (display_prop_intangible_p): Update prototype.
14749 (compute_display_string_pos, compute_display_string_end):
14750 Declare prototypes.
14751 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14752 EMACS_INT.
14753
14754 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14755
14756 Malloc failure behavior now depends on size of allocation.
14757 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14758 * lisp.h: Change signatures accordingly.
14759 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14760 All callers changed. (Bug#8762)
14761
14762 * gnutls.c: Use Emacs's memory allocators.
14763 Without this change, the gnutls library would invoke malloc etc.
14764 directly, which causes problems on non-SYNC_INPUT hosts, and which
14765 runs afoul of improving memory_full behavior. (Bug#8761)
14766 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14767 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14768 xfree instead of the default malloc, realloc, free.
14769 (Fgnutls_boot): No need to check for memory allocation failure,
14770 since xmalloc does that for us.
14771
14772 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14773 * category.c (hash_get_category_set):
14774 * ccl.c (ccl_driver):
14775 * charset.c (Fdefine_charset_internal):
14776 * charset.h (struct charset.hash_index):
14777 * composite.c (get_composition_id, gstring_lookup_cache)
14778 (composition_gstring_put_cache):
14779 * composite.h (struct composition.hash_index):
14780 * dispextern.h (struct image.hash):
14781 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14782 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14783 (hashfn_equal, hashfn_user_defined, make_hash_table)
14784 (maybe_resize_hash_table, hash_lookup, hash_put)
14785 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14786 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14787 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14788 * image.c (make_image, search_image_cache, lookup_image)
14789 (xpm_put_color_table_h):
14790 * lisp.h (struct Lisp_Hash_Table):
14791 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14792 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14793 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14794 * alloc.c (allocate_vectorlike):
14795 Check for overflow in vector size calculations.
14796 * ccl.c (ccl_driver):
14797 Check for overflow when converting EMACS_INT to int.
14798 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14799 need to be updated by these changes.
14800 * fns.c (make_hash_table, maybe_resize_hash_table):
14801 Check for integer overflow with large hash tables.
14802 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14803 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14804 (SXHASH_REDUCE): New macro.
14805 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14806 Use it instead of discarding useful hash info with large hash values.
14807 (sxhash_float): New function.
14808 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14809 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14810 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14811 Rewrite to use FIXNUM_BITS, as this simplifies things.
14812 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14813 Adjust signatures to match updated version of code.
14814 (consing_since_gc): Now EMACS_INT, since a single hash table can
14815 use more than INT_MAX bytes.
14816
14817 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14818
14819 Make it possible to build with GCC-4.6+ -O2 -flto.
14820
14821 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14822
14823 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14824
14825 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14826 Call minibuffer-inactive-mode.
14827
14828 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
14829
14830 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14831 Update dependencies.
14832
14833 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14834
14835 * data.c (init_data): Remove code for UTS, this system is not
14836 supported anymore.
14837
14838 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14839
14840 Don't force ./temacs to start in terminal mode.
14841
14842 * frame.c (make_initial_frame): Initialize faces in all cases, not
14843 only when CANNOT_DUMP is defined.
14844 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14845
14846 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14847
14848 * dispnew.c (add_window_display_history): Use const for the string
14849 pointer. Remove declaration, not needed.
14850
14851 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14852
14853 Use 'inline', not 'INLINE'.
14854 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14855 * alloc.c, fontset.c (INLINE): Remove.
14856 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14857 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14858 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14859 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14860 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14861
14862 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14863
14864 Make it possible to run ./temacs.
14865
14866 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14867 syms_of_callproc does the same thing. Remove test for
14868 "initialized", do it in the caller.
14869 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14870
14871 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14872
14873 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14874 (read_minibuf): Use get_minibuffer.
14875 (syms_of_minibuf): Use DEFSYM.
14876 (Qmetadata): New var.
14877 * data.c (Qbuffer): Don't make it static.
14878 (syms_of_data): Use DEFSYM.
14879
14880 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14881
14882 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14883 (CCL_CODE_MIN): New macro.
14884
14885 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14886
14887 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14888
14889 * eval.c (Qdebug): Now static.
14890 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14891 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14892 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14893
14894 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14895
14896 * image.c: Various fixes to ImageMagick code comments.
14897 (Fimagemagick_types): Doc fix.
14898
14899 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14900
14901 Minor fixes prompted by GCC 4.6.0 warnings.
14902
14903 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14904
14905 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14906 (x_clipboard_manager_save_all): Move extern decl to ...
14907 * xterm.h: ... here, so that it can be checked for consistency.
14908
14909 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14910
14911 * xselect.c (x_clipboard_manager_save_frame)
14912 (x_clipboard_manager_save_all): New functions.
14913 (Fx_clipboard_manager_save): Lisp function deleted.
14914
14915 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14916 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14917
14918 * xterm.h: Update prototype.
14919
14920 2011-05-28 William Xu <william.xwl@gmail.com>
14921
14922 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14923 exiting (Bug#8239).
14924
14925 2011-05-28 Jim Meyering <meyering@redhat.com>
14926
14927 Avoid a sign-extension bug in crypto_hash_function.
14928 * fns.c (to_uchar): Define.
14929 (crypto_hash_function): Use it to convert some newly-signed
14930 variables to unsigned, to avoid sign-extension bugs. For example,
14931 without this change, (md5 "truc") would evaluate to
14932 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14933 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14934 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14935
14936 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14937
14938 Integer overflow fixes.
14939
14940 * dbusbind.c: Serial number integer overflow fixes.
14941 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14942 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14943 to hold a serial number that is too large for a fixnum.
14944 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14945 Check for serial numbers out of range. Decode any serial number
14946 that was so large that it became a float. (Bug#8722)
14947
14948 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14949 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14950 Use XFASTINT rather than XUINT when numbers are nonnegative.
14951 (xd_append_arg, Fdbus_method_return_internal):
14952 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14953 arguments, check that Lisp number is nonnegative, rather than
14954 silently wrapping negative numbers around. (Bug#8722)
14955 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14956 (Bug#8722)
14957
14958 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14959
14960 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14961
14962 ccl: Add integer overflow checks.
14963 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14964 (IN_INT_RANGE): New macros.
14965 (ccl_driver): Use them to check for integer overflow when
14966 decoding a CCL program. Many of the new checks are whether XINT (x)
14967 fits in int; it doesn't always, on 64-bit hosts. The new version
14968 doesn't catch all possible integer overflows, but it's an
14969 improvement. (Bug#8719)
14970
14971 * alloc.c (make_event_array): Use XINT, not XUINT.
14972 There's no need for unsigned here.
14973
14974 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14975 This follows up to the 2011-05-06 change that substituted uintptr_t
14976 for EMACS_INT. This case wasn't caught back then.
14977
14978 Rework Fformat to avoid integer overflow issues.
14979 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14980 now (part of C89). Include <verify.h>.
14981 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14982 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14983 (Fformat): Avoid the prepass trying to compute sizes; it was only
14984 approximate and thus did not catch overflow reliably. Instead, walk
14985 through the format just once, formatting and computing sizes as we go,
14986 checking for integer overflow at every step, and allocating a larger
14987 buffer as needed. Keep track separately whether the format is
14988 multibyte. Keep only the most-recently calculated precision, rather
14989 than them all. Record whether each argument has been converted to
14990 string. Use EMACS_INT, not int, for byte and char and arg counts.
14991 Support field widths and precisions larger than INT_MAX. Avoid
14992 sprintf's undefined behavior with conversion specifications such as %#d
14993 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14994 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14995 formatting out-of-range floating point numbers with int
14996 formats. (Bug#8668)
14997
14998 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14999
15000 * data.c: Avoid integer truncation in expressions involving floats.
15001 * data.c: Include <intprops.h>.
15002 (arith_driver): When there's an integer overflow in an expression
15003 involving floating point, convert the integers to floating point
15004 so that the resulting value does not suffer from catastrophic
15005 integer truncation. For example, on a 64-bit host (* 4
15006 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15007 Do not rely on undefined behavior after integer overflow.
15008
15009 merge count_size_as_multibyte, parse_str_to_multibyte
15010 * character.c, character.h (count_size_as_multibyte):
15011 Rename from parse_str_to_multibyte; all uses changed.
15012 Check for integer overflow.
15013 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15014 since it's now a duplicate of the other. This is more of
15015 a character than a buffer op, so better that it's in character.c.
15016 * fns.c, print.c: Adjust to above changes.
15017
15018 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15019
15020 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15021
15022 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15023
15024 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15025 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15026 (x_clipboard_manager_save): Now static.
15027 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15028
15029 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15030 (crypto_hash_function): Now static.
15031 Fix pointer signedness problems. Avoid unnecessary initializations.
15032
15033 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15034
15035 * termhooks.h (Vselection_alist): Make it terminal-local.
15036
15037 * terminal.c (create_terminal): Initialize it.
15038
15039 * xselect.c: Support for clipboard managers.
15040 (Vselection_alist): Move to termhooks.h as terminal-local var.
15041 (LOCAL_SELECTION): New macro.
15042 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15043 (symbol_to_x_atom): Remove gratuitous arg.
15044 (x_handle_selection_request, lisp_data_to_selection_data)
15045 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15046 (x_own_selection, x_get_local_selection, x_convert_selection):
15047 New arg, specifying work frame. Use terminal-local Vselection_alist.
15048 (some_frame_on_display): Delete unused function.
15049 (Fx_own_selection_internal, Fx_get_selection_internal)
15050 (Fx_disown_selection_internal, Fx_selection_owner_p)
15051 (Fx_selection_exists_p): New optional frame arg.
15052 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15053 (x_handle_selection_clear): Don't treat other terminals with the
15054 same keyboard specially. Use the terminal-local Vselection_alist.
15055 (x_clear_frame_selections): Use Frun_hook_with_args.
15056
15057 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15058
15059 * xterm.h: Add support for those atoms.
15060
15061 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
15062
15063 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15064 (converted_selections, conversion_fail_tag): New global variables.
15065 (x_selection_request_lisp_error): Free the above.
15066 (x_get_local_selection): Remove unnecessary code.
15067 (x_reply_selection_request): Args changed; handle arbitrary array
15068 of converted selections stored in converted_selections.
15069 Separate the XChangeProperty and SelectionNotify steps.
15070 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15071 (x_convert_selection): New function.
15072 (x_handle_selection_event): Simplify.
15073 (x_get_foreign_selection): Don't ignore incoming requests while
15074 waiting for an answer; this will fail when we implement
15075 SAVE_TARGETS, and seems unnecessary anyway.
15076 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15077 (Vx_sent_selection_functions): Doc fix.
15078
15079 2011-05-26 Leo Liu <sdl.web@gmail.com>
15080
15081 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15082
15083 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15084
15085 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15086
15087 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15088 for fringe update if it has periodic bitmap.
15089 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15090 and fringe_bitmap_periodic_p.
15091
15092 * fringe.c (get_fringe_bitmap_data): New function.
15093 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15094 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15095 row. Mark glyph row for fringe update if periodicity changed.
15096
15097 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15098 for fringe update unless it has periodic bitmap.
15099
15100 2011-05-25 Kenichi Handa <handa@m17n.org>
15101
15102 * xdisp.c (get_next_display_element): Set correct it->face_id for
15103 a static composition.
15104
15105 2011-05-24 Leo Liu <sdl.web@gmail.com>
15106
15107 * deps.mk (fns.o):
15108 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15109
15110 * fns.c (crypto_hash_function, Fsha1): New function.
15111 (Fmd5): Use crypto_hash_function.
15112 (syms_of_fns): Add Ssha1.
15113
15114 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15115
15116 * gnutls.c: Remove unused macros.
15117 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15118 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15119 Remove macros that are defined and never used.
15120 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15121
15122 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15123
15124 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15125 (Fx_get_selection_internal): Minor cleanup.
15126 (Fx_own_selection_internal): Rename arguments for consistency with
15127 select.el.
15128
15129 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15130
15131 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15132
15133 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15134
15135 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15136
15137 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15138
15139 * dispnew.c (scrolling_window): Don't exclude the case that the
15140 last enabled row in the desired matrix touches the bottom boundary.
15141
15142 2011-05-21 Glenn Morris <rgm@gnu.org>
15143
15144 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15145 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15146 and add some more files.
15147
15148 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15149
15150 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15151 report_file_error introduced by the change from 2011-05-07.
15152
15153 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15154
15155 * systime.h (Time): Define only if emacs is defined.
15156 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15157 where the include path doesn't have X11/X.h by default. See
15158 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15159
15160 2011-05-20 Kenichi Handa <handa@m17n.org>
15161
15162 * composite.c (find_automatic_composition): Fix previous change.
15163
15164 2011-05-20 Glenn Morris <rgm@gnu.org>
15165
15166 * lisp.mk: New file, split from Makefile.in.
15167 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15168 (shortlisp): Remove.
15169 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15170
15171 2011-05-19 Glenn Morris <rgm@gnu.org>
15172
15173 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15174 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15175 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15176 (lisp): Set the order to that of loadup.el.
15177 (shortlisp): Make it a copy of $lisp.
15178 (SOME_MACHINE_LISP): Remove.
15179 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15180 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15181
15182 2011-05-18 Kenichi Handa <handa@m17n.org>
15183
15184 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15185 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15186 (find_automatic_composition): Mostly rewrite for efficiency.
15187
15188 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
15189
15190 * makefile.w32-in: Update dependencies.
15191
15192 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15193
15194 * menu.c: Include limits.h (fixes the MS-Windows build broken by
15195 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15196
15197 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
15198
15199 Fix some integer overflow issues, such as string length overflow.
15200
15201 * insdel.c (count_size_as_multibyte): Check for string overflow.
15202
15203 * character.c (lisp_string_width): Check for string overflow.
15204 Use EMACS_INT, not int, for string indexes and lengths; in
15205 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15206 the resulting string length overflows an EMACS_INT; instead,
15207 report a string overflow if no precision given. When checking for
15208 precision exhaustion, use a check that cannot possibly have
15209 integer overflow. (Bug#8675)
15210 * character.h (lisp_string_width): Adjust to new signature.
15211
15212 * alloc.c (string_overflow): New function.
15213 (Fmake_string): Use it. This doesn't change behavior, but saves
15214 a few bytes and will simplify future changes.
15215 * character.c (string_escape_byte8): Likewise.
15216 * lisp.h (string_overflow): New decl.
15217
15218 Fixups, following up to the user-interface timestamp change.
15219 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15220 for UI timestamps, instead of unsigned long.
15221 * msdos.c (mouse_get_pos): Likewise.
15222 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15223 * w32gui.h (Time): Define by including "systime.h" rather than by
15224 declaring it ourselves. (Bug#8664)
15225
15226 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15227 * image.c (clear_image_cache): Likewise.
15228
15229 * term.c (term_mouse_position): Don't assume time_t wraparound.
15230
15231 Be more systematic about user-interface timestamps.
15232 Before, the code sometimes used 'Time', sometimes 'unsigned long',
15233 and sometimes 'EMACS_UINT', to represent these timestamps.
15234 This change causes it to use 'Time' uniformly, as that's what X uses.
15235 This makes the code easier to follow, and makes it easier to catch
15236 integer overflow bugs such as Bug#8664.
15237 * frame.c (Fmouse_position, Fmouse_pixel_position):
15238 Use Time, not unsigned long, for user-interface timestamps.
15239 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15240 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15241 * keyboard.h (last_event_timestamp): Likewise.
15242 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15243 * menu.h (xmenu_show): Likewise.
15244 * term.c (term_mouse_position): Likewise.
15245 * termhooks.h (struct input_event.timestamp): Likewise.
15246 (struct terminal.mouse_position_hook): Likewise.
15247 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15248 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15249 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15250 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15251 what it was before.
15252 * menu.h, termhooks.h: Include "systime.h", for Time.
15253
15254 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15255 Don't assume that the difference between two unsigned long values
15256 can fit into an integer. At this point, we know button_down_time
15257 <= event->timestamp, so the difference must be nonnegative, so
15258 there's no need to cast the result if double-click-time is
15259 nonnegative, as it should be; check that it's nonnegative, just in
15260 case. This bug is triggered when events are more than 2**31 ms
15261 apart (about 25 days). (Bug#8664)
15262
15263 * xselect.c (last_event_timestamp): Remove duplicate decl.
15264 (x_own_selection): Remove needless cast to unsigned long.
15265
15266 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15267 that always fit in int. Use a sentinel instead of a counter, to
15268 avoid a temp and to allay GCC's concerns about possible int overflow.
15269 * frame.h (struct frame): Use int for menu_bar_items_used
15270 instead of EMACS_INT, since it always fits in int.
15271
15272 * menu.c (grow_menu_items): Check for int overflow.
15273
15274 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15275
15276 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15277 Before, the code was not consistent. These values cannot exceed
15278 2**31 - 1 so there's no need to make them unsigned.
15279 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15280 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15281 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15282 as modifiers.
15283 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15284
15285 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15286 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15287 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15288 presumably because the widths might not match.
15289
15290 * window.c (size_window): Avoid needless test at loop start.
15291
15292 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15293
15294 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15295
15296 2011-05-12 Drew Adams <drew.adams@oracle.com>
15297
15298 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15299
15300 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15301
15302 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15303 `width' to `bar_area_x' and `bar_area_width', respectively.
15304 (x_scroll_run): Take account of fringe background extension.
15305
15306 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15307 Rename local vars `left' and `width' to `bar_area_x' and
15308 `bar_area_width', respectively.
15309 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15310 background extension.
15311
15312 2011-05-10 Jim Meyering <meyering@redhat.com>
15313
15314 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15315
15316 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
15317
15318 * image.c (Finit_image_library): Return t for built-in image types,
15319 like pbm and xbm. (Bug#8640)
15320
15321 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15322
15323 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15324
15325 2011-05-07 Eli Zaretskii <eliz@gnu.org>
15326
15327 * w32console.c (Fset_screen_color): Doc fix.
15328 (Fget_screen_color): New function.
15329 (syms_of_ntterm): Defsubr it.
15330
15331 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15332 unlink the temporary file if Fcall_process didn't create it in the
15333 first place.
15334 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15335 child process will be redirected to a file specified with `:file'.
15336 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15337 cue to call_process_cleanup not to close that handle.
15338
15339 2011-05-07 Ben Key <bkey76@gmail.com>
15340
15341 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15342 one of two shell specific rules, either bootstrap-temacs-CMD or
15343 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15344 to the previous implementation of the bootstrap-temacs rule.
15345 The bootstrap-temacs-CMD rule is similar to the previous
15346 implementation of the bootstrap-temacs rule except that it
15347 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15348 variable.
15349
15350 These changes, along with some changes to nt/configure.bat,
15351 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15352 earlier fix to add support for --cflags and --ldflags options
15353 that include quotes so that it works whether make uses cmd or
15354 sh as the shell.
15355
15356 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
15357
15358 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15359 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15360 is a constant.
15361 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15362 a string. Handle both cases.
15363 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15364 (Fdbus_register_method): Use Qinvalid_function.
15365
15366 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15367
15368 * makefile.w32-in: Update dependencies.
15369 (LISP_H): Add inttypes.h and stdin.h.
15370 (PROCESS_H): Add unistd.h.
15371
15372 2011-05-06 Eli Zaretskii <eliz@gnu.org>
15373
15374 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15375 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15376
15377 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
15378
15379 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15380
15381 * term.c (vfatal): Remove stray call to va_end.
15382 It's not needed and the C Standard doesn't allow it here anyway.
15383
15384 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15385 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15386
15387 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15388 bytes.
15389
15390 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15391
15392 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15393
15394 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15395
15396 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15397
15398 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15399
15400 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15401 * charset.c (Fdefine_charset_internal): Don't initialize
15402 charset.code_space[15]. The value was garbage, on hosts with
15403 32-bit int (Bug#8600).
15404
15405 * lread.c (read_integer): Be more consistent with string-to-number.
15406 Use string_to_number to do the actual conversion; this avoids
15407 rounding errors and fixes some other screwups. Without this fix,
15408 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15409 (digit_to_number): Move earlier, for benefit of read_integer.
15410 Return -1 if the digit is out of range for the base, -2 if it is
15411 not a digit in any supported base. (Bug#8602)
15412
15413 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15414
15415 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15416 to match comment at start of function. This also removes a
15417 GCC warning about overflow in a 32+64-bit port.
15418
15419 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15420
15421 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15422 Reported by Stefan Monnier in
15423 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15424 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15425 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15426
15427 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15428 (EMACS_UINTPTR): Likewise, with uintptr_t.
15429
15430 * lisp.h: Prefer 64-bit EMACS_INT if available.
15431 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15432 on 32-bit hosts that have 64-bit int, so that they can access
15433 large files.
15434 However, temporarily disable this change unless the temporary
15435 symbol WIDE_EMACS_INT is defined.
15436
15437 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15438
15439 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15440 This removes an assumption that EMACS_INT and long are the same
15441 width as pointers. The assumption is true for Emacs porting targets
15442 now, but we want to make other targets possible.
15443 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15444 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15445 In the rest of the code, change types of integers that hold casted
15446 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15447 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15448 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15449 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15450 No need to cast type when ORing.
15451 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15452 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15453 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15454 assume EMACS_INT is the same width as char *.
15455 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15456 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15457 Remove no-longer-needed casts.
15458 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15459 (xg_tool_bar_help_callback, xg_make_tool_item):
15460 Use EMACS_INTPTR to hold an integer
15461 that will be cast to void *; this can avoid a GCC warning
15462 if EMACS_INT is not the same width as void *.
15463 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15464 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15465 (current_message_1, set_message_1):
15466 Use a local to convert to proper width without a cast.
15467 * xmenu.c (dialog_selection_callback): Likewise.
15468
15469 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15470 Also, don't assume VALBITS / RAND_BITS is less than 5,
15471 and don't rely on undefined behavior when shifting a 1 left into
15472 the sign bit.
15473 * lisp.h (get_random): Change signature to match.
15474
15475 * lread.c (hash_string): Use size_t, not int, for hash computation.
15476 Normally we prefer signed values; but hashing is special, because
15477 it's better to use unsigned division on hash table sizes so that
15478 the remainder is nonnegative. Also, size_t is the natural width
15479 for hashing into memory. The previous code used 'int', which doesn't
15480 retain enough info to hash well into very large tables.
15481 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15482
15483 * dbusbind.c: Don't possibly lose pointer info when converting.
15484 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15485 Use XPNTR rather than XHASH, so that the high-order bits of
15486 the pointer aren't lost when converting through void *.
15487
15488 * eval.c (Fautoload): Don't double-shift a pointer.
15489
15490 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15491
15492 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15493
15494 * gnutls.c (DEF_GNUTLS_FN):
15495 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15496
15497 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15498
15499 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15500 marker. (Bug#8610)
15501
15502 2011-05-05 Eli Zaretskii <eliz@gnu.org>
15503
15504 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15505 New version that can reserve upto 2GB of heap space.
15506
15507 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
15508
15509 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15510
15511 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15512
15513 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15514 `gnutls_certificate_set_x509_key_file'.
15515
15516 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
15517
15518 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15519 Update dependencies.
15520
15521 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15522
15523 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15524 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15525 Remove unused parameter `fildes'.
15526 * process.c (read_process_output, send_process): Don't pass it.
15527
15528 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15529
15530 Fix previous change: the library cache is defined in w32.c.
15531 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15532 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15533
15534 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15535
15536 Implement dynamic loading of GnuTLS on Windows.
15537
15538 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15539 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15540 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15541 Declare.
15542
15543 * gnutls.c (Qgnutls_dll): Define.
15544 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15545 (gnutls_*): Declare function pointers.
15546 (init_gnutls_functions): New function to initialize function pointers.
15547 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15548 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15549 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15550 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15551 (emacs_gnutls_write, emacs_gnutls_read)
15552 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15553 (Fgnutls_available_p): New function.
15554 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15555 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15556 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15557
15558 * image.c: Include w32.h.
15559 (Vimage_type_cache): Delete.
15560 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15561 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15562 (w32_delayed_load): Move to w32.c.
15563
15564 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15565
15566 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15567 (w32_delayed_load): Move from image.c. When loading a library, record
15568 its filename in the :loaded-from property of the library id.
15569 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15570 Initialize and staticpro them.
15571 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15572
15573 * process.c: Include lisp.h before w32.h, not after.
15574 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15575 instead of gnutls_record_check_pending.
15576
15577 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15578
15579 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15580
15581 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15582 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15583 as passed in.
15584
15585 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15586
15587 * xterm.c (x_set_frame_alpha): Do not set property on anything
15588 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15589
15590 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15591
15592 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15593
15594 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15595
15596 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15597 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15598 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15599 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15600 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15601 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15602 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15603 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15604 (Qgnutls_bootprop_callbacks_verify): Make static.
15605
15606 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15607
15608 * callproc.c: Indentation fixup.
15609
15610 * sysdep.c (wait_for_termination_1): Make static.
15611 (wait_for_termination, interruptible_wait_for_termination):
15612 Move after wait_for_termination_1.
15613
15614 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15615
15616 * sysdep.c (interruptible_wait_for_termination): New function
15617 which is like wait_for_termination, but allows keyboard
15618 interruptions.
15619
15620 * callproc.c (Fcall_process): Add (:file "file") as an option for
15621 the STDOUT buffer.
15622 (Fcall_process_region): Ditto.
15623
15624 2011-04-30 Eli Zaretskii <eliz@gnu.org>
15625
15626 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15627 rather than `XVECTOR (FOO)->size'.
15628
15629 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15630 inttypes.h, as a gnulib replacement is used if it not available in
15631 system headers.
15632
15633 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15634
15635 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15636 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15637 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15638
15639 * coding.c (coding_alloc_by_realloc): Error out if destination
15640 will grow beyond MOST_POSITIVE_FIXNUM.
15641 (decode_coding_emacs_mule): Abort if there isn't enough place in
15642 charbuf for the composition carryover bytes. Reserve an extra
15643 space for up to 2 characters produced in a loop.
15644 (decode_coding_iso_2022): Abort if there isn't enough place in
15645 charbuf for the composition carryover bytes.
15646
15647 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15648
15649 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15650 aborting when %lld or %lll format is passed.
15651 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15652 %llo or %llx format is passed. (Bug#8545)
15653
15654 * window.c (window_scroll_line_based): Use a marker instead of
15655 simple variables to record original value of point. (Bug#7952)
15656
15657 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15658 produced by %s or %c overflows available buffer space. (Bug#8545)
15659
15660 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15661
15662 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15663 (SIZE_MAX): Move defn after all includes, as they might #define it.
15664
15665 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15666
15667 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15668
15669 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15670
15671 * keyboard.c (Qdelayed_warnings_hook): Define.
15672 (command_loop_1): Run `delayed-warnings-hook'
15673 if Vdelayed_warnings_list is non-nil.
15674 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15675 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15676
15677 2011-04-28 Eli Zaretskii <eliz@gnu.org>
15678
15679 * doprnt.c (doprnt): Don't return value smaller than the buffer
15680 size if the message was truncated. (Bug#8545).
15681
15682 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15683
15684 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15685 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15686
15687 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15688
15689 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15690
15691 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
15692
15693 * makefile.w32-in: Update dependencies.
15694
15695 2011-04-27 Eli Zaretskii <eliz@gnu.org>
15696
15697 Improve `doprnt' and its usage. (Bug#8545)
15698 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15699 `format_end'. Remove support for %l as a conversion specifier.
15700 Don't use xrealloc. Improve diagnostics when the %l size modifier
15701 is used. Update the commentary.
15702
15703 * eval.c (verror): Simplify calculation of size_t.
15704
15705 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15706 messages.
15707
15708 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15709
15710 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15711 change.
15712
15713 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15714
15715 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15716 This makes this file independent of the recent pseudovector change.
15717
15718 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
15719
15720 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15721
15722 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15723 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15724 Remove unused local.
15725 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15726
15727 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
15728 GCC 4.6.0 optimizes based on type-based alias analysis.
15729 For example, if b is of type struct buffer * and v of type struct
15730 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15731 != &v->size, and therefore "v->size = 1; b->size = 2; return
15732 v->size;" must therefore return 1. This assumption is incorrect
15733 for Emacs, since it type-puns struct Lisp_Vector * with many other
15734 types. To fix this problem, this patch adds a new type struct
15735 vectorlike_header that documents the constraints on layout of vectors
15736 and pseudovectors, and helps optimizing compilers not get fooled
15737 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15738 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15739 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15740 the size member.
15741 (XSETPVECTYPE): Rewrite in terms of new macro.
15742 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15743 This is a bit clearer, and further avoids the possibility of
15744 undesirable aliasing.
15745 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15746 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15747 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15748 since Lisp_Subr is a special case (no "next" field).
15749 (ASIZE): Now uses header.size rather than size.
15750 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15751 to avoid the hassle of writing XVECTOR (foo)->header.size.
15752 (struct vectorlike_header): New type.
15753 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15754 object, to help avoid aliasing.
15755 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15756 (SUBRP): Likewise, since Lisp_Subr is a special case.
15757 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15758 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15759 (struct Lisp_Hash_Table): Combine first two members into a single
15760 struct vectorlike_header member. All uses of "size" and "next" members
15761 changed to be "header.size" and "header.next".
15762 * buffer.h (struct buffer): Likewise.
15763 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15764 * frame.h (struct frame): Likewise.
15765 * process.h (struct Lisp_Process): Likewise.
15766 * termhooks.h (struct terminal): Likewise.
15767 * window.c (struct save_window_data, struct saved_window): Likewise.
15768 * window.h (struct window): Likewise.
15769 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15770 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15771 * buffer.c (init_buffer_once): Likewise.
15772 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15773 special case.
15774 * process.c (Fformat_network_address): Use local var for size,
15775 for brevity.
15776
15777 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15778
15779 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15780 * data.c (atof): Remove decl; no longer used or needed.
15781 (digit_to_number): Move to lread.c.
15782 (Fstring_to_number): Use new string_to_number function, to be
15783 consistent with how the Lisp reader treats infinities and NaNs.
15784 Do not assume that floating-point numbers represent EMACS_INT
15785 without losing information; this is not true on most 64-bit hosts.
15786 Avoid double-rounding errors, by insisting on integers when
15787 parsing non-base-10 numbers, as the documentation specifies.
15788 * lisp.h (string_to_number): New decl, replacing ...
15789 (isfloat_string): Remove.
15790 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15791 (read1): Do not accept +. and -. as integers; this
15792 appears to have been a coding error. Similarly, do not accept
15793 strings like +-1e0 as floating point numbers. Do not report
15794 overflow for integer overflows unless the base is not 10 which
15795 means we have no simple and reliable way to continue.
15796 Break out the floating-point parsing into a new
15797 function string_to_number, so that Fstring_to_number parses
15798 floating point numbers consistently with the Lisp reader.
15799 (digit_to_number): Move here from data.c. Make it static inline.
15800 (E_CHAR, EXP_INT): Remove, replacing with ...
15801 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15802 (string_to_number): New function, replacing isfloat_string.
15803 This function checks for valid syntax and produces the resulting
15804 Lisp float number too. Rework it so that string-to-number
15805 no longer mishandles examples like "1.0e+". Use strtoumax,
15806 so that overflow for non-base-10 numbers is reported only when
15807 there's no portable and simple way to convert to floating point.
15808
15809 * textprop.c (set_text_properties_1): Rewrite for clarity,
15810 and to avoid GCC warning about integer overflow.
15811
15812 * intervals.h (struct interval): Use EMACS_INT for members
15813 where EMACS_UINT might cause problems. See
15814 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15815 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15816 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15817 All uses changed.
15818 (offset_intervals): Tell GCC not to worry about length overflow
15819 when negating a negative length.
15820
15821 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15822 (overrun_check_free): Likewise.
15823
15824 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15825 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15826 word size.
15827
15828 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15829 (gnutls_make_error): Rename local to avoid shadowing.
15830 (gnutls_emacs_global_deinit): ifdef out; not used.
15831 (Fgnutls_boot): Use const for pointer to readonly storage.
15832 Comment out unused local. Fix pointer signedness problems.
15833
15834 * lread.c (openp): Don't stuff size_t into an 'int'.
15835 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15836 about possible signed overflow.
15837
15838 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15839 (GDK_KEY_g): Don't define if already defined.
15840 (xg_prepare_tooltip): Avoid pointer signedness problem.
15841 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15842
15843 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15844 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15845
15846 * xfns.c (Fx_window_property): Simplify a bit,
15847 to make a bit faster and to avoid GCC 4.6.0 warning.
15848 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15849
15850 * fns.c (internal_equal): Don't assume size_t fits in int.
15851
15852 * alloc.c (compact_small_strings): Tighten assertion a little.
15853
15854 Replace pEd with more-general pI, and fix some printf arg casts.
15855 * lisp.h (pI): New macro, generalizing old pEd macro to other
15856 conversion specifiers. For example, use "...%"pI"d..." rather
15857 than "...%"pEd"...".
15858 (pEd): Remove. All uses replaced with similar uses of pI.
15859 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15860 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15861 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15862 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15863 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15864 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15865 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15866 64-bit hosts.
15867 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15868 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15869 * print.c (safe_debug_print, print_object): Likewise.
15870 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15871 to int.
15872 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15873 avoiding the 0 flag, which is not portable.
15874 * process.c (Fmake_network_process): Use pI to avoid cast.
15875 * region-cache.c (pp_cache): Likewise.
15876 * xdisp.c (decode_mode_spec): Likewise.
15877 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15878 behavior on 64-bit hosts with printf arg.
15879 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15880 (x_stop_queuing_selection_requests): Likewise.
15881 (x_get_window_property): Don't truncate byte count to an 'int'
15882 when tracing.
15883
15884 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15885 here, since it parses constructs like leading '-' and spaces,
15886 which are not wanted; and it overflows with large numbers.
15887 Instead, simply match F[0-9]+, which is what is wanted anyway.
15888
15889 * alloc.c: Remove unportable assumptions about struct layout.
15890 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15891 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15892 (allocate_vectorlike, make_pure_vector): Use the new macros,
15893 plus offsetof, to remove unportable assumptions about struct layout.
15894 These assumptions hold on all porting targets that I know of, but
15895 they are not guaranteed, they're easy to remove, and removing them
15896 makes further changes easier.
15897
15898 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15899 This doesn't fix a bug but makes the code clearer.
15900 (string_overrun_cookie): Now const. Use initializers that
15901 don't formally overflow signed char, to avoid warnings.
15902 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15903 can cause Emacs to crash when string overrun checking is enabled.
15904 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15905 multiple of sizeof (EMACS_INT); it need not be, if
15906 alignof(EMACS_INT) < sizeof (EMACS_INT).
15907 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15908
15909 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
15910
15911 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15912
15913 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15914
15915 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15916 supposed to be handshaking. (Bug#8556)
15917 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15918
15919 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15920
15921 * lisp.h (Qdebug): List symbol.
15922 * eval.c (Qdebug): Restore global linkage.
15923 * keyboard.c (debug-on-event): New variable.
15924 (handle_user_signal): Break into debugger when debug-on-event
15925 matches the current signal symbol.
15926
15927 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15928
15929 * alloc.c (check_sblock, check_string_bytes)
15930 (check_string_free_list): Convert to standard C.
15931
15932 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15933
15934 * w32.c (emacs_gnutls_push): Fix typo.
15935
15936 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15937
15938 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15939 "cast to pointer from integer of different size".
15940
15941 Improve doprnt and its use in verror. (Bug#8545)
15942 * doprnt.c (doprnt): Document the set of format control sequences
15943 supported by the function. Use SAFE_ALLOCA instead of always
15944 using `alloca'.
15945
15946 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15947 is one byte too soon. Don't use xrealloc; instead xfree and
15948 xmalloc anew.
15949
15950 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15951
15952 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15953 callbacks stage.
15954
15955 * gnutls.c: Renamed global_initialized to
15956 gnutls_global_initialized. Added internals for the
15957 :verify-hostname-error, :verify-error, and :verify-flags
15958 parameters of `gnutls-boot' and documented those parameters in the
15959 docstring. Start callback support.
15960 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15961 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15962 on error. Return error code.
15963 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15964 (emacs_gnutls_read): Likewise.
15965 (Fgnutls_boot): Return handshake error code.
15966 (emacs_gnutls_handle_error): New function.
15967 (wsaerror_to_errno): Likewise.
15968
15969 * w32.h (emacs_gnutls_pull): Add prototype.
15970 (emacs_gnutls_push): Likewise.
15971
15972 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15973 (emacs_gnutls_push): Likewise.
15974
15975 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15976
15977 * process.c (wait_reading_process_output): Check if GnuTLS
15978 buffered some data internally if no FDs are set for TLS
15979 connections.
15980
15981 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15982 (LIBS): Link to USER_LIBS.
15983 ($(BLD)/gnutls.$(0)): New target.
15984
15985 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15986
15987 * xdisp.c (handle_single_display_spec): Rename the
15988 display_replaced_before_p argument into display_replaced_p, to
15989 make it consistent with the commentary. Fix typos in the
15990 commentary.
15991
15992 * textprop.c (syms_of_textprop): Remove dead code.
15993 (copy_text_properties): Delete obsolete commentary about an
15994 interface that was deleted long ago. Fix typos in the description
15995 of arguments.
15996
15997 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15998 to changes in oldXMenu/XMenu.h from 2011-04-16.
15999 <menu_help_message, prev_menu_help_message>: Constify.
16000 (IT_menu_make_room): menu->help_text is now `const char **';
16001 adjust.
16002
16003 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16004 to changes in oldXMenu/XMenu.h from 2011-04-16.
16005 (struct XMenu): Declare `help_text' `const char **'.
16006
16007 * xfaces.c <Qunspecified>: Make extern again.
16008
16009 * syntax.c: Include sys/types.h before including regex.h, as
16010 required by POSIX.
16011
16012 * doc.c (get_doc_string): Improve the format passed to `error'.
16013
16014 * doprnt.c (doprnt): Improve commentary.
16015
16016 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16017
16018 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16019 them with etags.
16020
16021 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16022 changes in globals.h immediately force recompilation.
16023 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16024 $(CURDIR)/s/ms-w32.h.
16025 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16026
16027 * character.c (Fchar_direction): Function deleted.
16028 (syms_of_character): Don't defsubr it.
16029 <char-direction-table>: Deleted.
16030
16031 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16032
16033 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16034 * doprnt.c: Include limits.h.
16035 (SIZE_MAX): New macro.
16036 (doprnt): Return a size_t value. 2nd arg is now size_t.
16037 Many local variables are now size_t instead of int or unsigned.
16038 Improve overflow protection. Support `l' modifier for integer
16039 conversions. Support %l conversion. Don't assume an EMACS_INT
16040 argument for integer conversions and for %c.
16041
16042 * lisp.h (doprnt): Restore prototype.
16043
16044 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16045 $(SRC)/character.h.
16046
16047 * Makefile.in (base_obj): Add back doprnt.o.
16048
16049 * deps.mk (doprnt.o): Add back prerequisites.
16050 (callint.o): Depend on character.h.
16051
16052 * eval.c (internal_lisp_condition_case): Include the handler
16053 representation in the error message.
16054 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16055 when breaking from the loop.
16056
16057 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16058
16059 * callint.c (Fcall_interactively): When displaying error message
16060 about invalid control letter, pass the character's codepoint, not
16061 a pointer to its multibyte form. Improve display of the character
16062 in octal and display also its hex code.
16063
16064 * character.c (char_string): Use %x to display the (unsigned)
16065 codepoint of an invalid character, to avoid displaying a bogus
16066 negative value.
16067
16068 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16069 `error', not SYMBOL_NAME itself.
16070
16071 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16072 character arguments to `error'.
16073
16074 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16075 to `error' in error message about FINAL_CHAR argument. Make sure
16076 FINAL_CHAR is a character, and use %c when it is passed as
16077 argument to `error'.
16078
16079 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16080
16081 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16082
16083 * w32.c: Include <time.h>.
16084 (sys_localtime): New function.
16085
16086 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
16087
16088 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16089
16090 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16091
16092 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
16093
16094 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16095 zombies (Bug#8467).
16096
16097 2011-04-19 Eli Zaretskii <eliz@gnu.org>
16098
16099 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16100 gl_state.e_property when gl_state.object is Qt.
16101
16102 * insdel.c (make_gap_larger): Remove limitation of buffer size
16103 to <= INT_MAX.
16104
16105 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
16106
16107 * xdisp.c (lookup_glyphless_char_display)
16108 (produce_glyphless_glyph): Handle cons cell entry in
16109 glyphless-char-display.
16110 (Vglyphless_char_display): Document it.
16111
16112 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16113 glyphless-char-display.
16114
16115 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
16116
16117 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16118
16119 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16120
16121 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16122 definition for no-X builds.
16123
16124 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
16125
16126 Static checks with GCC 4.6.0 and non-default toolkits.
16127
16128 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16129
16130 * process.c (keyboard_bit_set): Define only if SIGIO.
16131 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16132 (send_process): Repair possible setjmp clobbering.
16133
16134 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16135
16136 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16137
16138 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16139
16140 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16141 Define only if needed.
16142
16143 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16144 by pacifying GCC about it. Maybe it's time to retire it?
16145 * xfaces.c (USG, __TIMEVAL__): Likewise.
16146
16147 * dispextern.h (struct redisplay_interface): Rename param
16148 to avoid shadowing.
16149 * termhooks.h (struct terminal): Likewise.
16150 * xterm.c (xembed_send_message): Likewise.
16151
16152 * insdel.c (make_gap_smaller): Define only if
16153 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16154
16155 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16156 it.
16157
16158 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16159 so that we aren't warned about unused symbols.
16160
16161 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16162
16163 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16164
16165 * xfns.c (x_real_positions): Mark locals as initialized.
16166
16167 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16168
16169 * xterm.c: Fix problems found by static analysis with other toolkits.
16170 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16171 (x_dispatch_event): Declare static if USE_GTK, and
16172 define if USE_GTK || USE_X_TOOLKIT.
16173 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16174 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16175 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16176 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16177
16178 * xmenu.c (menu_help_callback): Pointer type fixes.
16179 Use const pointers when pointing at readonly data. Avoid pointer
16180 signedness clashes.
16181 (FALSE): Remove unused macro.
16182 (update_frame_menubar): Remove unused decl.
16183
16184 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16185
16186 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16187 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16188 (single_menu_item): Rename local to avoid shadowing.
16189
16190 * keyboard.c (make_lispy_event): Remove unused local var.
16191
16192 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16193 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16194
16195 * bitmaps: Change bitmaps from unsigned char back to the X11
16196 compatible char. Avoid the old compiler warnings about
16197 out-of-range initializers by using, for example, '\xab' rather
16198 than 0xab.
16199
16200 * xgselect.c (xgselect_initialize): Check vs interface
16201 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16202
16203 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16204
16205 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16206 to read-only memory.
16207
16208 * fns.c (vector): Remove; this old hack is no longer needed.
16209
16210 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16211 Remove unused var.
16212 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16213
16214 * xrdb.c (x_load_resources): Omit unused local.
16215
16216 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16217 (x_window): Rename locals to avoid shadowing.
16218 (USG): Use the kludged USG macro, to pacify gcc.
16219
16220 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16221 (x_term_init): Remove local to avoid shadowing.
16222
16223 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16224
16225 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16226 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16227
16228 2011-04-16 Eli Zaretskii <eliz@gnu.org>
16229
16230 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16231
16232 Fix regex.c, syntax.c and friends for buffers > 2GB.
16233 * syntax.h (struct gl_state_s): Declare character position members
16234 EMACS_INT.
16235
16236 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16237
16238 * textprop.c (verify_interval_modification, interval_of):
16239 Declare arguments EMACS_INT.
16240
16241 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16242 EMACS_INT.
16243
16244 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16245
16246 * indent.c (Fvertical_motion): Local variable it_start is now
16247 EMACS_INT.
16248
16249 * regex.c (re_match, re_match_2, re_match_2_internal)
16250 (bcmp_translate, regcomp, regexec, print_double_string)
16251 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16252 (re_compile_pattern, re_exec): Declare arguments and local
16253 variables `size_t' and `ssize_t' and return values `regoff_t', as
16254 appropriate.
16255 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16256 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16257 <compile_stack_type>: `size' and `avail' are now `size_t'.
16258
16259 * regex.h <regoff_t>: Use ssize_t, not int.
16260 (re_search, re_search_2, re_match, re_match_2): Arguments that
16261 specify buffer/string position and length are now ssize_t and
16262 size_t. Return type is regoff_t.
16263
16264 2011-04-16 Ben Key <bkey76@gmail.com>
16265
16266 * nsfont.m: Fixed bugs in ns_get_family and
16267 ns_descriptor_to_entity that were caused by using free to
16268 deallocate memory blocks that were allocated by xmalloc (via
16269 xstrdup). This caused Emacs to crash when compiled with
16270 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16271 --enable-checking=xmallocoverrun). xfree is now used to
16272 deallocate these memory blocks.
16273
16274 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
16275
16276 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16277
16278 emacs_write: Accept and return EMACS_INT for sizes.
16279 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16280 et seq.
16281 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16282 Accept and return EMACS_INT.
16283 (emacs_gnutls_write): Return the number of bytes written on
16284 partial writes.
16285 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16286 (emacs_read, emacs_write): Remove check for negative size, as the
16287 Emacs source code has been audited now.
16288 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16289 (emacs_read, emacs_write): Use it.
16290 * process.c (send_process): Adjust to the new signatures of
16291 emacs_write and emacs_gnutls_write. Do not attempt to store
16292 a byte offset into an 'int'; it might overflow.
16293 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16294
16295 * sound.c: Don't assume sizes fit in 'int'.
16296 (struct sound_device.period_size, alsa_period_size):
16297 Return EMACS_INT, not int.
16298 (struct sound_device.write, vox_write, alsa_write):
16299 Accept EMACS_INT, not int.
16300 (wav_play, au_play): Use EMACS_INT to store sizes and to
16301 record read return values.
16302
16303 2011-04-15 Ben Key <bkey76@gmail.com>
16304
16305 * keyboard.c (Qundefined): Don't declare static since it is used
16306 in nsfns.m.
16307 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16308 static since they are used in nsfont.m.
16309
16310 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16311
16312 * process.c (Qprocessp): Don't declare static.
16313 * lisp.h (Qprocessp): Declare again.
16314
16315 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
16316
16317 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16318
16319 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16320
16321 Improve C-level modularity by making more things 'static'.
16322
16323 Don't publish debugger-only interfaces to other modules.
16324 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16325 (verify_bytepos, count_markers): Move decls to the only modules
16326 that need them.
16327 * region-cache.h (pp_cache): Likewise.
16328 * window.h (check_all_windows): Likewise.
16329 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16330
16331 * sysdep.c (croak): Now static, if
16332 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16333 * syssignal.h (croak): Declare only if not static.
16334
16335 * alloc.c (refill_memory_reserve): Now static if
16336 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16337 * lisp.h (refill_memory_reserve): Declare only if not static.
16338
16339 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16340 Define only if USE_LUCID.
16341
16342 * xrdb.c (x_customization_string, x_rm_string): Now static.
16343
16344 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16345 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16346
16347 * xdisp.c (draw_row_with_mouse_face): Now static.
16348 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16349
16350 * window.h (check_all_windows): Mark externally visible.
16351
16352 * window.c (window_deletion_count): Now static.
16353
16354 * undo.c: Make symbols static if they're not exported.
16355 (last_undo_buffer, last_boundary_position, pending_boundary):
16356 Now static.
16357
16358 * textprop.c (interval_insert_behind_hooks): Now static.
16359 (interval_insert_in_front_hooks): Likewise.
16360
16361 * term.c: Make symbols static if they're not exported.
16362 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16363 (max_frame_lines, tty_set_terminal_modes):
16364 (tty_reset_terminal_modes, tty_turn_off_highlight):
16365 (get_tty_terminal): Now static.
16366 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16367 * termhooks.h (term_mouse_moveto): Do not declare if
16368 HAVE_WINDOW_SYSTEM.
16369 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16370 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16371
16372 * sysdep.c: Make symbols static if they're not exported.
16373 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16374 Now static.
16375 (sigprocmask_set, full_mask): Remove; unused.
16376 (wait_debugging): Mark as visible.
16377 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16378 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16379
16380 * syntax.c (syntax_temp): Define only if !__GNUC__.
16381
16382 * sound.c (current_sound_device, current_sound): Now static.
16383
16384 * search.c (searchbufs, searchbuf_head): Now static.
16385
16386 * scroll.c (scroll_cost): Remove; unused.
16387 * dispextern.h (scroll_cost): Remove decl.
16388
16389 * region-cache.h (pp_cache): Mark as externally visible.
16390
16391 * process.c: Make symbols static if they're not exported.
16392 (process_tick, update_tick, create_process, chan_process):
16393 (Vprocess_alist, proc_buffered_char, datagram_access):
16394 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16395 (deactivate_process): Mark defn as static, as well as decl.
16396 * lisp.h (create_process): Remove decl.
16397 * process.h (chan_process, Vprocess_alist): Remove decls.
16398
16399 * print.c: Make symbols static if they're not exported.
16400 (print_depth, new_backquote_output, being_printed, print_buffer):
16401 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16402 (print_interval, print_number_index, initial_stderr_stream):
16403 Now static.
16404 * lisp.h (Fprinc): Remove decl.
16405 (debug_output_compilation_hack): Mark as externally visible.
16406
16407 * sysdep.c (croak): Move decl from here to syssignal.h.
16408 * syssignal.h (croak): Put it here, so the API can be checked when
16409 'croak' is called from dissociate_if_controlling_tty.
16410
16411 * minibuf.c: Make symbols static if they're not exported.
16412 (minibuf_save_list, choose_minibuf_frame): Now static.
16413 * lisp.h (choose_minibuf_frame): Remove decl.
16414
16415 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16416
16417 * lread.c: Make symbols static if they're not exported.
16418 (read_objects, initial_obarray, oblookup_last_bucket_number):
16419 Now static.
16420 (make_symbol): Remove; unused.
16421 * lisp.h (initial_obarray, make_symbol): Remove decls.
16422
16423 * keyboard.c: Make symbols static if they're not exported.
16424 (single_kboard, recent_keys_index, total_keys, recent_keys):
16425 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16426 (this_single_command_key_start, echoing, last_auto_save):
16427 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16428 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16429 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16430 (Vlispy_mouse_stem, double_click_count):
16431 Now static.
16432 (force_auto_save_soon): Define only if SIGDANGER.
16433 (ignore_mouse_drag_p): Now static if
16434 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16435 (print_help): Remove; unused.
16436 (stop_character, last_timer_event): Mark as externally visible.
16437 * keyboard.h (ignore_mouse_drag_p): Declare only if
16438 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16439 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16440 * lisp.h (echoing): Remove decl.
16441 (force_auto_save_soon): Declare only if SIGDANGER.
16442 * xdisp.c (redisplay_window): Simplify code, to make it more
16443 obvious that ignore_mouse_drag_p is not accessed if !defined
16444 USE_GTK && !defined HAVE_NS.
16445
16446 * intervals.c: Make symbols static if they're not exported.
16447 (merge_properties_sticky, merge_interval_right, delete_interval):
16448 Now static.
16449 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16450
16451 * insdel.c: Make symbols static if they're not exported.
16452 However, leave prepare_to_modify_buffer alone. It's never
16453 called from outside this function, but that appears to be a bug.
16454 (combine_after_change_list, combine_after_change_buffer):
16455 (adjust_after_replace, signal_before_change): Now static.
16456 (adjust_after_replace_noundo): Remove; unused.
16457 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16458 (signal_before_change): Remove decls.
16459
16460 * indent.c (val_compute_motion, val_vmotion): Now static.
16461
16462 * image.c: Make symbols static if they're not exported.
16463 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16464 if USE_GTK.
16465 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16466 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16467
16468 * fringe.c (standard_bitmaps): Now static.
16469 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16470
16471 * frame.c: Make symbols static if they're not exported.
16472 (x_report_frame_params, make_terminal_frame): Now static.
16473 (get_frame_param): Now static, unless HAVE_NS.
16474 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16475 (x_get_resource_string): Remove; not used.
16476 * frame.h (make_terminal_frame, x_report_frame_params):
16477 (x_get_resource_string); Remove decls.
16478 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16479 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16480
16481 * font.c, fontset.c: Make symbols static if they're not exported.
16482 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16483 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16484 * font.c (font_close_object): Now static.
16485 * font.h (font_close_object): Remove.
16486 * fontset.c (FONTSET_OBJLIST): Remove.
16487 (free_realized_fontset) #if-0 the body, which does nothing.
16488 (face_suitable_for_char_p): #if-0, as it's never called.
16489 * fontset.h (face_suitable_for_char_p): Remove decl.
16490 * xfaces.c (face_at_string_position):
16491 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16492 since 0 is always ASCII.
16493
16494 * fns.c (weak_hash_tables): Now static.
16495
16496 * fileio.c: Make symbols static if they're not exported.
16497 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16498 (Vwrite_region_annotation_buffers): Now static.
16499
16500 * eval.c: Make symbols static if they're not exported.
16501 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16502 * lisp.h (backtrace_list): Remove decl.
16503
16504 * emacs.c: Make symbols static if they're not exported.
16505 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16506 (fatal_error_code, fatal_error_signal_hook, standard_args):
16507 Now static.
16508 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16509 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16510 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16511 * lisp.h (fatal_error_signal_hook): Remove decl.
16512 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16513
16514 * editfns.c: Move a (normally-unused) function to its only use.
16515 * editfns.c, lisp.h (get_operating_system_release): Remove.
16516 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16517 worth the hassle of breaking this out.
16518
16519 * xterm.c: Make symbols static if they're not exported.
16520 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16521 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16522 (x_destroy_window, x_delete_display):
16523 Now static.
16524 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16525 (x_mouse_leave): Remove; unused.
16526 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16527 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16528 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16529 Remove decls.
16530 (x_mouse_leave): Declare only if WINDOWSNT.
16531 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16532 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16533 USE_X_TOOLKIT.
16534
16535 * ftxfont.c: Make symbols static if they're not exported.
16536 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16537 HAVE_FREETYPE.
16538 * font.h (ftxfont_driver): Likewise.
16539
16540 * xfns.c: Make symbols static if they're not exported.
16541 (x_last_font_name, x_display_info_for_name):
16542 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16543 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16544 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16545 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16546 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16547 (last_show_tip_args): Now static.
16548 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16549 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16550 (x_screen_planes): Remove; unused.
16551 * dispextern.h (x_screen_planes): Remove decl.
16552
16553 * dispnew.c: Make symbols static if they're not exported.
16554 * dispextern.h (redraw_garbaged_frames, scrolling):
16555 (increment_row_positions): Remove.
16556 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16557 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16558 Now static.
16559 (redraw_garbaged_frames): Remove; unused.
16560
16561 * xfaces.c: Make symbols static if they're not exported.
16562 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16563 Remove decls.
16564 * xterm.h (defined_color): Remove decls.
16565 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16566 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16567 (menu_face_changed_default, defined_color, free_realized_face):
16568 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16569 (ascii_face_of_lisp_face): Remove; unused.
16570
16571 * xdisp.c: Make symbols static if they're not exported.
16572 * dispextern.h (scratch_glyph_row, window_box_edges):
16573 (glyph_to_pixel_coords, set_cursor_from_row):
16574 (get_next_display_element, set_iterator_to_next):
16575 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16576 (show_mouse_face): Remove decls
16577 * frame.h (message_buf_print): Likewise.
16578 * lisp.h (pop_message, set_message, check_point_in_composition):
16579 Likewise.
16580 * xterm.h (set_vertical_scroll_bar): Likewise.
16581 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16582 (message_buf_print, scratch_glyph_row, displayed_buffer):
16583 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16584 (get_next_display_element, show_mouse_face, window_box_edges):
16585 (frame_to_window_pixel_xy, check_point_in_composition):
16586 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16587 (glyph_to_pixel_coords): Remove; unused.
16588
16589 * dired.c (file_name_completion): Now static.
16590
16591 * dbusbind.c (xd_in_read_queued_messages): Now static.
16592
16593 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16594 * data.c (circular_list_error): Remove.
16595
16596 * commands.h (last_point_position, last_point_position_buffer):
16597 (last_point_position_window): Remove decls.
16598 * keyboard.c: Make these variables static.
16599
16600 * coding.h (coding, code_convert_region, encode_coding_gap):
16601 Remove decls.
16602 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16603 (iso_code_class, detect_coding, code_convert_region): Now static.
16604 (encode_coding_gap): Remove; unused.
16605
16606 * chartab.c (chartab_chars, chartab_bits): Now static.
16607
16608 * charset.h (charset_iso_8859_1): Remove decl.
16609 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16610 Now static.
16611
16612 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16613 * ccl.c (Vccl_program_table): Now static.
16614 (check_ccl_update): Remove; unused.
16615
16616 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16617 * category.h: ... from here.
16618 * category.c (check_category_table, set_category_set): Now static.
16619
16620 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16621 * lisp.h: Remove these decls.
16622
16623 * buffer.c (buffer_count): Remove unused var.
16624
16625 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16626 so that it's not optimized away.
16627 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16628 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16629 exported only to the debugger.
16630
16631 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16632 * atimer.h (run_all_atimers): Remove; not exported.
16633
16634 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16635 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16636 was inaccessible from Lisp.
16637 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16638 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16639
16640 alloc.c: Import and export fewer symbols, and remove unused items.
16641 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16642 is defined.
16643 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16644 it's not optimized away by whole-program optimization.
16645 (message_enable_multibyte, free_misc): Remove.
16646 (catchlist, handlerlist, mark_backtrace):
16647 Declare only if BYTE_MARK_STACK.
16648 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16649 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16650 (message_enable_multibyte): Remove decl.
16651 (free_misc, interval_free_list, float_block, float_block_index):
16652 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16653 (cons_free_list, last_marked_index):
16654 Now static.
16655 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16656 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16657 (mark_backtrace): Define only if BYTE_MARK_STACK.
16658 * xdisp.c (message_enable_multibyte): Now static.
16659
16660 Declare Lisp_Object Q* variables to be 'static' if not exported.
16661 This makes it easier for human readers (and static analyzers)
16662 to see whether these variables are used from other modules.
16663 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16664 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16665 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16666 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16667 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16668 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16669 * xmenu.c, xselect.c:
16670 Declare Q* vars static if they are not used in other modules.
16671 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16672 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16673 Remove decls of unexported vars.
16674 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16675
16676 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16677
16678 Make Emacs functions such as Fatom 'static' by default.
16679 This makes it easier for human readers (and static analyzers)
16680 to see whether these functions can be called from other modules.
16681 DEFUN now defines a static function. To make the function external
16682 so that it can be used in other C modules, use the new macro DEFUE.
16683 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16684 (Finit_image_library):
16685 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16686 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16687 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16688 Remove decls, since these functions are now static.
16689 (Funintern, Fget_internal_run_time): New decls, since these functions
16690 were already external.
16691
16692 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16693 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16694 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16695 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16696 * keyboard.c, keymap.c, lread.c:
16697 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16698 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16699 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16700 Mark functions with DEFUE instead of DEFUN,
16701 if they are used in other modules.
16702 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16703 decls for now-static functions.
16704 * buffer.h (Fdelete_overlay): Remove decl.
16705 * callproc.c (Fgetenv_internal): Mark as internal.
16706 * composite.c (Fremove_list_of_text_properties): Remove decl.
16707 (Fcomposition_get_gstring): New forward static decl.
16708 * composite.h (Fcomposite_get_gstring): Remove decl.
16709 * dired.c (Ffile_attributes): New forward static decl.
16710 * doc.c (Fdocumntation_property): New forward static decl.
16711 * eval.c (Ffetch_bytecode): New forward static decl.
16712 (Funintern): Remove extern decl; now in .h file where it belongs.
16713 * fileio.c (Fmake_symbolic_link): New forward static decl.
16714 * image.c (Finit_image_library): New forward static decl.
16715 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16716 * intervals.h (Fprevious_property_change):
16717 (Fremove_list_of_text_properties): Remove decls.
16718 * keyboard.c (Fthis_command_keys): Remove decl.
16719 (Fcommand_execute): New forward static decl.
16720 * keymap.c (Flookup_key): New forward static decl.
16721 (Fcopy_keymap): Now static.
16722 * keymap.h (Flookup_key): Remove decl.
16723 * process.c (Fget_process): New forward static decl.
16724 (Fprocess_datagram_address): Mark as internal.
16725 * syntax.c (Fsyntax_table_p): New forward static decl.
16726 (skip_chars): Remove duplicate decl.
16727 * textprop.c (Fprevious_property_change): New forward static decl.
16728 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16729 Now internal.
16730 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16731 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16732
16733 * editfns.c (Fformat): Remove unreachable code.
16734
16735 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16736
16737 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16738 change. (Bug#8496)
16739
16740 2011-04-13 Eli Zaretskii <eliz@gnu.org>
16741
16742 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16743 when at ZV. (Bug#8487)
16744
16745 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16746
16747 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16748 (Bug#8437)
16749 * keyboard.c (parse_tool_bar_item): Likewise.
16750 * sound.c (sound_cleanup, alsa_close): Likewise.
16751 * termcap.c (tgetent): Likewise.
16752 * xfns.c (x_default_font_parameter): Likewise.
16753 * xsettings.c (read_and_apply_settings): Likewise.
16754
16755 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16756 (overrun_check_free): Protoize.
16757
16758 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16759
16760 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16761 since callers should never pass a negative size.
16762 Change the signature to match that of plain 'read' and 'write'; see
16763 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16764 * lisp.h: Update prototypes of emacs_write and emacs_read.
16765
16766 2011-04-11 Eli Zaretskii <eliz@gnu.org>
16767
16768 * xdisp.c (redisplay_window): Don't try to determine the character
16769 position of the scroll margin if the window start point w->startp
16770 is outside the buffer's accessible region. (Bug#8468)
16771
16772 2011-04-10 Eli Zaretskii <eliz@gnu.org>
16773
16774 Fix write-region and its subroutines for buffers > 2GB.
16775 * fileio.c (a_write, e_write): Modify declaration of arguments and
16776 local variables to support buffers larger than 2GB.
16777 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16778
16779 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16780 argument, local variables, and return value.
16781
16782 * lisp.h: Update prototypes of emacs_write and emacs_read.
16783
16784 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16785
16786 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16787
16788 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16789
16790 Fix more problems found by GCC 4.6.0's static checks.
16791
16792 * xdisp.c (vmessage): Use a better test for character truncation.
16793
16794 * charset.c (load_charset_map): <, not <=, for optimization,
16795 and to avoid potential problems with integer overflow.
16796 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16797 * casetab.c (set_identity, shuffle): Likewise.
16798 * editfns.c (Fformat): Likewise.
16799 * syntax.c (skip_chars): Likewise.
16800
16801 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16802 This also lets GCC 4.6.0 generate slightly better loop code.
16803
16804 * callint.c (Fcall_interactively): <, not <=, for optimization.
16805 (Fcall_interactively): Count the number of arguments produced,
16806 not the number of arguments given. This is simpler and lets GCC
16807 4.6.0 generate slightly better code.
16808
16809 * ftfont.c: Distingish more carefully between FcChar8 and char.
16810 The previous code passed unsigned char * to a functions like
16811 strlen and xstrcasecmp that expect char *, which does not
16812 conform to the C standard.
16813 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16814 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16815 char * when the C standard requires it.
16816
16817 * keyboard.c (read_char): Remove unused var.
16818
16819 * eval.c: Port to Windows vsnprintf (Bug#8435).
16820 Include <limits.h>.
16821 (SIZE_MAX): Define if the headers do not.
16822 (verror): Do not give up if vsnprintf returns a negative count.
16823 Instead, grow the buffer. This ports to Windows vsnprintf, which
16824 does not conform to C99. Problem reported by Eli Zaretskii.
16825 Also, simplify the allocation scheme, by avoiding the need for
16826 calling realloc, and removing the ALLOCATED variable.
16827
16828 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16829
16830 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16831 But keep the doprint source code for now, as we might revamp it
16832 and use it again (Bug#8435).
16833 * lisp.h (doprnt): Remove.
16834 * Makefile.in (base_obj): Remove doprnt.o.
16835 * deps.mk (doprnt.o): Remove.
16836
16837 error: Print 32- and 64-bit integers portably (Bug#8435).
16838 Without this change, on typical 64-bit hosts error ("...%d...", N)
16839 was used to print both 32- and 64-bit integers N, which relied on
16840 undefined behavior.
16841 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16842 * lisp.h (error, verror): Mark as printf-like functions.
16843 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16844 Report overflow in size calculations when allocating printf buffer.
16845 Do not truncate output string at its first null byte.
16846 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16847 Truncate the output at a character boundary, since vsnprintf does not
16848 do that.
16849 * charset.c (check_iso_charset_parameter): Convert internal
16850 character to string before calling 'error', since %c now has the
16851 printf meaning.
16852 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16853 overflow when computing char to be passed to 'error'. Do not
16854 pass Lisp_Object to 'error'; pass the integer instead.
16855 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16856 formatted with plain %d.
16857
16858 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16859
16860 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16861
16862 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16863
16864 * xterm.c (x_catch_errors): Remove duplicate declaration.
16865
16866 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16867
16868 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16869
16870 2011-04-10 Jim Meyering <meyering@redhat.com>
16871
16872 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16873 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16874 return ssize_t not "int", and use size_t as the buffer length.
16875 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16876 * gnutls.h: Update declarations.
16877 * process.c (read_process_output): Use ssize_t, to match.
16878 (send_process): Likewise.
16879
16880 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16881
16882 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16883
16884 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16885
16886 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16887 Use unsigned char, to match FcChar8 type definition.
16888
16889 * xterm.c (handle_one_xevent):
16890 * xmenu.c (create_and_show_popup_menu):
16891 * xselect.c (x_decline_selection_request)
16892 (x_reply_selection_request): Avoid type-punned deref of X events.
16893
16894 2011-04-09 Eli Zaretskii <eliz@gnu.org>
16895
16896 Fix some uses of `int' instead of EMACS_INT.
16897 * search.c (string_match_1, fast_string_match)
16898 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16899 (scan_buffer, find_next_newline_no_quit)
16900 (find_before_next_newline, search_command, Freplace_match)
16901 (Fmatch_data): Make some `int' variables be EMACS_INT.
16902
16903 * xdisp.c (display_count_lines): 3rd argument and return value now
16904 EMACS_INT. All callers changed.
16905 (pint2hrstr): Last argument is now EMACS_INT.
16906
16907 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16908 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16909 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16910 (decode_coding_utf_16, decode_coding_emacs_mule)
16911 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16912 (decode_coding_ccl, decode_coding_charset)
16913 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16914 (decode_coding_iso_2022, decode_coding_emacs_mule)
16915 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16916 <char_offset, last_offset>: Declare EMACS_INT.
16917 (encode_coding_utf_8, encode_coding_utf_16)
16918 (encode_coding_emacs_mule, encode_invocation_designation)
16919 (encode_designation_at_bol, encode_coding_iso_2022)
16920 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16921 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16922 Declare EMACS_INT.
16923 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16924 (encode_invocation_designation): Last argument P_NCHARS is now
16925 EMACS_INT.
16926 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16927 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16928
16929 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16930 All users changed.
16931
16932 * ccl.c (Fccl_execute_on_string): Declare some variables
16933 EMACS_INT.
16934
16935 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16936
16937 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16938
16939 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16940
16941 * process.c (Fformat_network_address): Doc fix.
16942
16943 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16944
16945 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16946
16947 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16948
16949 * keyboard.c (read_char): Call Lisp function help-form-show,
16950 instead of using internal_with_output_to_temp_buffer.
16951 (Qhelp_form_show): New var.
16952 (syms_of_keyboard): Use DEFSYM macro.
16953
16954 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16955
16956 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16957
16958 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16959
16960 * process.c (Flist_processes): Remove to Lisp.
16961 (list_processes_1): Delete.
16962
16963 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16964
16965 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16966
16967 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16968
16969 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16970
16971 Fix more problems found by GCC 4.6.0's static checks.
16972
16973 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16974
16975 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16976
16977 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16978
16979 * xdisp.c (vmessage): Mark as a printf-like function.
16980
16981 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16982
16983 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16984
16985 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16986 printf-like functions.
16987 (tiff_load): Add casts to remove these marks before passing them
16988 to system-supplied API.
16989
16990 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16991
16992 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16993 This avoids several warnings with gcc -Wstrict-overflow.
16994 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16995 directly, rather than having caller test rule sign. This avoids
16996 some unnecessary tests.
16997 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16998 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16999 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17000
17001 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17002 (xfont_open): Avoid unnecessary tests.
17003
17004 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17005
17006 * composite.h, composite.c (composition_gstring_put_cache):
17007 Use EMACS_INT, not int, for length.
17008
17009 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17010 breaking out part of COMPOSITION_DECODE_RULE.
17011 (COMPOSITION_DECODE_RULE): Use it.
17012 * composite.c (get_composition_id): Remove unused local vars,
17013 by using the new macro.
17014
17015 * textprop.c (set_text_properties_1): Change while to do-while,
17016 since the condition is always true at first.
17017
17018 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17019 (interval_deletion_adjustment): Return unsigned value.
17020 All uses changed.
17021
17022 * process.c (list_processes_1, create_pty, read_process_output):
17023 (exec_sentinel): Remove vars that were set but not used.
17024 (create_pty): Remove unnecessary "volatile"s.
17025 (Fnetwork_interface_info): Avoid possibility of int overflow.
17026 (read_process_output): Do adaptive read buffering even if carryover.
17027 (read_process_output): Simplify nbytes computation if buffered.
17028
17029 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17030
17031 * syntax.c (scan_words): Remove var that was set but not used.
17032 (update_syntax_table): Use unsigned instead of int.
17033
17034 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17035 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17036 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17037
17038 * print.c (print_error_message): Avoid int overflow.
17039
17040 * font.c (font_list_entities): Redo for clarity,
17041 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17042
17043 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17044 (font_score): Avoid potential overflow in diff calculation.
17045
17046 * fns.c (substring_both): Remove var that is set but not used.
17047 (sxhash): Redo loop for clarity and to avoid wraparound warning.
17048
17049 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17050
17051 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17052 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17053 can always succeed if overflow has undefined behavior.
17054
17055 * search.c (boyer_moore, wordify): Remove vars set but not used.
17056 (wordify): Omit three unnecessary tests.
17057
17058 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17059 All callers changed. This avoids the need for an unused var.
17060
17061 * casefiddle.c (casify_region): Remove var that is set but not used.
17062
17063 * dired.c (file_name_completion): Remove var that is set but not used.
17064
17065 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17066
17067 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17068 (Finsert_file_contents): Remove unnecessary code checking fd.
17069
17070 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17071 Check for integer overflow on size calculations.
17072
17073 * buffer.c (Fprevious_overlay_change): Remove var that is set
17074 but not used.
17075
17076 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17077 Remove vars that are set but not used.
17078 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17079 (timer_check_2): Mark vars as initialized.
17080
17081 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17082
17083 * image.c (lookup_image): Remove var that is set but not used.
17084 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17085
17086 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17087 that are set but not used.
17088
17089 * xfns.c (make_invisible_cursor): Don't return garbage
17090 if XCreateBitmapFromData fails (Bug#8410).
17091
17092 * xselect.c (x_get_local_selection, x_handle_property_notify):
17093 Remove vars that are set but not used.
17094
17095 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17096 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17097
17098 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17099 Remove var that is set but not used.
17100 (scroll_bar_windows_size): Now size_t, not int.
17101 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17102 Check for overflow.
17103
17104 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17105 (map_tty_color) [!defined MSDOS]: Likewise.
17106
17107 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17108
17109 * coding.c: Remove vars that are set but not used.
17110 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17111 All callers changed.
17112 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17113 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17114 (decode_coding_charset): Remove vars that are set but not used.
17115
17116 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17117 that is set but not used.
17118
17119 * print.c (print_object): Remove var that is set but not used.
17120
17121 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17122 The gnulib version avoids calling malloc in the usual case,
17123 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17124 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17125 * filelock.c (current_lock_owner): Likewise.
17126 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17127 * sysdep.c: Include allocator.h, careadlinkat.h.
17128 (emacs_no_realloc_allocator): New static constant.
17129 (emacs_readlink): New function.
17130 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17131 ../lib/careadlinkat.h.
17132
17133 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17134
17135 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17136 first non-nil return value).
17137
17138 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17139
17140 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17141 if not defined (Bug#8403).
17142
17143 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17144
17145 * xdisp.c (display_count_lines): Remove parameter `start',
17146 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17147 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17148 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17149 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17150 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17151 and thereabouts. All callers changed.
17152 (get_per_char_metric): Remove parameter `f', unused since
17153 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17154
17155 2011-04-02 Jim Meyering <meyering@redhat.com>
17156
17157 do not dereference NULL upon failed strdup
17158 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17159 (ns_get_family): Likewise.
17160
17161 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17162
17163 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17164
17165 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17166
17167 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17168 later (Bug#8403).
17169
17170 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17171
17172 Add lexical binding.
17173
17174 * window.c (Ftemp_output_buffer_show): New fun.
17175 (Fsave_window_excursion):
17176 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17177
17178 * lread.c (lisp_file_lexically_bound_p): New function.
17179 (Fload): Bind Qlexical_binding.
17180 (readevalloop): Remove `evalfun' arg.
17181 Bind Qinternal_interpreter_environment.
17182 (Feval_buffer): Bind Qlexical_binding.
17183 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17184 Mark as dynamic.
17185 (syms_of_lread): Declare `lexical-binding'.
17186
17187 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17188
17189 * keyboard.c (eval_dyn): New fun.
17190 (menu_item_eval_property): Use it.
17191
17192 * image.c (parse_image_spec): Use Ffunctionp.
17193
17194 * fns.c (concat, mapcar1): Accept byte-code-functions.
17195
17196 * eval.c (Fsetq): Handle lexical vars.
17197 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17198 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17199 (FletX, Flet): Obey lexical binding.
17200 (Fcommandp): Handle closures.
17201 (Feval): New `lexical' arg.
17202 (eval_sub): New function extracted from Feval. Use it almost
17203 everywhere where Feval was used. Look up vars in lexical env.
17204 Handle closures.
17205 (Ffunctionp): Move from subr.el.
17206 (Ffuncall): Handle closures.
17207 (apply_lambda): Remove `eval_flags'.
17208 (funcall_lambda): Handle closures and new byte-code-functions.
17209 (Fspecial_variable_p): New function.
17210 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17211 but without exporting it to Lisp.
17212
17213 * doc.c (Fdocumentation, store_function_docstring):
17214 * data.c (Finteractive_form): Handle closures.
17215
17216 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17217 interactive spec.
17218
17219 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17220 New byte-codes.
17221 (exec_byte_code): New function extracted from Fbyte_code to handle new
17222 calling convention for byte-code-functions. Add new byte-codes.
17223
17224 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17225
17226 * alloc.c (Fmake_symbol): Init new `declared_special' field.
17227
17228 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17229
17230 * xdisp.c (redisplay_internal): Fix prototype.
17231
17232 2011-03-31 Eli Zaretskii <eliz@gnu.org>
17233
17234 * xdisp.c (SCROLL_LIMIT): New macro.
17235 (try_scrolling): Use it when setting scroll_limit.
17236 Limit scrolling to 100 screen lines.
17237 (redisplay_window): Even when falling back on "recentering",
17238 position point in the window according to scroll-conservatively,
17239 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17240
17241 (try_scrolling): When point is above the window, allow searching
17242 as far as scroll_max, or one screenful, to compute vertical
17243 distance from PT to the scroll margin position. This prevents
17244 try_scrolling from unnecessarily failing when
17245 scroll-conservatively is set to a value slightly larger than the
17246 window height. Clean up the case of PT below the margin at bottom
17247 of window: scroll_max can no longer be INT_MAX. When aggressive
17248 scrolling is in use, don't let point enter the opposite scroll
17249 margin as result of the scroll.
17250 (syms_of_xdisp) <scroll-conservatively>: Document the
17251 threshold of 100 lines for never-recentering scrolling.
17252
17253 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17254
17255 * dispextern.h (move_it_by_lines):
17256 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17257 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17258 (message_log_check_duplicate): Remove parameters `prev_bol' and
17259 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17260 (redisplay_internal): Remove parameter `preserve_echo_area',
17261 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17262
17263 * indent.c (Fvertical_motion):
17264 * window.c (window_scroll_pixel_based, Frecenter):
17265 Don't pass `need_y_p' to `move_it_by_lines'.
17266
17267 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17268
17269 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17270 steal a few bits to be more compact.
17271 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17272 Remove unneeded casts.
17273
17274 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17275
17276 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17277
17278 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17279 binding" message (bug#7967).
17280
17281 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17282
17283 Fix more problems found by GCC 4.6.0's static checks.
17284
17285 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17286 Remove unused local var.
17287
17288 * editfns.c (Fmessage_box): Remove unused local var.
17289
17290 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17291 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17292 Omit unused local vars.
17293 * window.c (shrink_windows): Omit unused local var.
17294 * menu.c (digest_single_submenu): Omit unused local var.
17295 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17296 Omit unused local var.
17297
17298 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17299 Don't assume string length fits in int.
17300 (keyremap_step, read_key_sequence): Use size_t for sizes.
17301 (read_key_sequence): Don't check last_real_key_start redundantly.
17302
17303 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17304 instead of alloca (Bug#8344).
17305
17306 * eval.c (Fbacktrace): Don't assume nargs fits in int.
17307 (Fbacktrace_frame): Don't assume nframes fits in int.
17308
17309 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17310
17311 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17312 concerns.
17313
17314 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17315
17316 * cm.c (calccost): Turn while-do into do-while, for clarity.
17317
17318 * keyboard.c (syms_of_keyboard): Use the same style as later
17319 in this function when indexing through an array. This also
17320 works around GCC bug 48267.
17321
17322 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17323
17324 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17325
17326 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17327 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17328
17329 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17330 This avoids undefined behavior on integer overflow, and is a bit
17331 more convenient anyway since it is compared to a size_t variable.
17332
17333 Variadic C functions now count arguments with size_t, not int.
17334 This avoids an unnecessary limitation on 64-bit machines, which
17335 caused (substring ...) to crash on large vectors (Bug#8344).
17336 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17337 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
17338 All variadic functions and their callers changed accordingly.
17339 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17340 * data.c (arith_driver, float_arith_driver): Likewise.
17341 * editfns.c (general_insert_function): Likewise.
17342 * eval.c (struct backtrace.nargs, interactive_p)
17343 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17344 (funcall_lambda, mark_backtrace): Likewise.
17345 * fns.c (concat): Likewise.
17346 * frame.c (x_set_frame_parameters): Likewise.
17347 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17348 0 if not found, not -1. All callers changed.
17349
17350 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17351 (stack_copy_size): Now size_t, not int.
17352 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17353
17354 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17355
17356 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17357 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17358 All callers changed.
17359
17360 * lisp.h (multibyte_char_to_unibyte):
17361 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17362 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17363 * character.h (CHAR_TO_BYTE8):
17364 * cmds.c (internal_self_insert):
17365 * editfns.c (general_insert_function):
17366 * keymap.c (push_key_description):
17367 * search.c (Freplace_match):
17368 * xdisp.c (message_dolog, set_message_1): All callers changed.
17369
17370 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17371
17372 * keyboard.c (safe_run_hook_funcall): New function.
17373 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17374 don't set the hook to nil, but remove the offending function instead.
17375 (Qcommand_hook_internal): Remove, unused.
17376 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17377 Vcommand_hook_internal.
17378
17379 * eval.c (enum run_hooks_condition): Remove.
17380 (funcall_nil, funcall_not): New functions.
17381 (run_hook_with_args): Call each function through a `funcall' argument.
17382 Remove `cond' argument, now redundant.
17383 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17384 (Frun_hook_with_args_until_failure): Adjust accordingly.
17385 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17386
17387 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17388
17389 * dispextern.h (string_buffer_position): Remove declaration.
17390
17391 * print.c (strout): Remove parameter `multibyte', unused since
17392 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17393
17394 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17395 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17396 All callers changed.
17397
17398 * w32.c (_wsa_errlist): Use braces for struct initializers.
17399
17400 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17401 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17402 All callers changed.
17403 (string_buffer_position): Likewise. Also, make static (it's never
17404 used outside xdisp.c).
17405 (cursor_row_p): Remove parameter `w', unused since
17406 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17407 (decode_mode_spec): Remove parameter `precision', introduced during
17408 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17409 All callers changed.
17410
17411 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17412
17413 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17414
17415 2011-03-27 Anders Lindgren <andlind@gmail.com>
17416
17417 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17418 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17419 (ns_update_auto_hide_menu_bar): New functions.
17420 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17421 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17422 ns_constrain_all_frames.
17423 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17424 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17425
17426 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17427
17428 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17429
17430 2011-03-27 Glenn Morris <rgm@gnu.org>
17431
17432 * syssignal.h: Replace RETSIGTYPE with void.
17433 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17434 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17435 Replace SIGTYPE with void everywhere.
17436 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17437 * s/template.h (SIGTYPE): Remove commented out definition.
17438
17439 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17440
17441 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17442 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17443
17444 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17445
17446 * w32.c (read_unc_volume): Use parameter `henum', instead of
17447 global variable `wget_enum_handle'.
17448
17449 * keymap.c (describe_vector): Remove parameters `indices' and
17450 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17451 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17452
17453 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17454
17455 * keyboard.c (timer_check): Remove parameter `do_it_now',
17456 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17457 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17458 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17459
17460 * keyboard.c (read_char):
17461 * w32menu.c (w32_menu_display_help):
17462 * xmenu.c (show_help_event, menu_help_callback):
17463 Adjust calls to `show_help_echo'.
17464
17465 * gtkutil.c (xg_maybe_add_timer):
17466 * keyboard.c (readable_events):
17467 * process.c (wait_reading_process_output):
17468 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17469
17470 * insdel.c (adjust_markers_gap_motion):
17471 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17472 (gap_left, gap_right): Don't call it.
17473
17474 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17475
17476 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17477 incurred during fontification.
17478
17479 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17480
17481 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17482 (DEFVAR_PER_BUFFER): Don't pass it.
17483
17484 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17485 (scrolling_window): Don't pass it.
17486
17487 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17488
17489 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17490
17491 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17492 and `suffix'.
17493 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17494 of variables specific to SELinux and computation of `encoded_absname'.
17495
17496 * image.c (XPutPixel): Remove unused variable `height'.
17497
17498 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17499
17500 * unexw32.c (get_section_info): Remove unused variable `section'.
17501
17502 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17503 (system_process_attributes): Remove unused variable `sess'.
17504 (sys_read): Remove unused variable `err'.
17505
17506 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17507 (w32_wnd_proc): Remove unused variable `isdead'.
17508 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17509 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17510 (x_create_tip_frame): Remove unused variable `tem'.
17511
17512 * w32inevt.c (w32_console_read_socket):
17513 Remove unused variable `no_events'.
17514
17515 * w32term.c (x_draw_composite_glyph_string_foreground):
17516 Remove unused variable `width'.
17517
17518 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17519
17520 * w32term.c (x_set_glyph_string_clipping):
17521 Don't pass uninitialized region to CombineRgn.
17522
17523 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17524
17525 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17526 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17527 (Fx_close_connection): Remove unused variable `i'.
17528
17529 * w32font.c (w32font_draw): Return number of glyphs.
17530 (w32font_open_internal): Remove unused variable `i'.
17531 (w32font_driver): Add missing initializer.
17532
17533 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17534 (fill_in_menu): Remove unused variable `items_added'.
17535
17536 * w32term.c (last_mouse_press_frame): Remove static global variable.
17537 (w32_clip_to_row): Remove unused variable `f'.
17538 (x_delete_terminal): Remove unused variable `i'.
17539
17540 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17541 (NOTHING): Remove unused static global variable.
17542 (uniscribe_check_otf): Remove unused variable `table'.
17543 (uniscribe_font_driver): Add missing initializers.
17544
17545 2011-03-23 Julien Danjou <julien@danjou.info>
17546
17547 * term.c (Fsuspend_tty, Fresume_tty):
17548 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17549 * window.c (temp_output_buffer_show):
17550 * insdel.c (signal_before_change):
17551 * frame.c (Fhandle_switch_frame):
17552 * fileio.c (Fdo_auto_save):
17553 * emacs.c (Fkill_emacs):
17554 * editfns.c (save_excursion_restore):
17555 * cmds.c (internal_self_insert):
17556 * callint.c (Fcall_interactively):
17557 * buffer.c (Fkill_all_local_variables):
17558 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17559 Use Frun_hooks.
17560 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17561 unconditionally since it does the check itself.
17562
17563 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17564
17565 Fix more problems found by GCC 4.5.2's static checks.
17566
17567 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17568 the first time through the loop, since we know p0 < p1 then.
17569 This also avoids a gcc -Wstrict-overflow warning.
17570
17571 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17572 leading to a memory leak, possible in functions like
17573 load_charset_map_from_file that can allocate an unbounded number
17574 of objects (Bug#8318).
17575
17576 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17577 that could (at least in theory) be that large.
17578
17579 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17580 This is less likely to overflow, and avoids undefined behavior if
17581 overflow does occur. All callers changed. Use strtoul to scan
17582 for the unsigned long integer.
17583 (pint2hrstr): Simplify and tune code slightly.
17584 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17585
17586 * scroll.c (do_scrolling): Work around GCC bug 48228.
17587 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17588
17589 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17590 This also avoids a warning with gcc -Wstrict-overflow.
17591 (validate_x_resource_name): Simplify count usage.
17592 This also avoids a warning with gcc -Wstrict-overflow.
17593
17594 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17595 fail (Bug#8306).
17596
17597 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17598
17599 * process.c (Fmake_network_process): Use socklen_t, not int,
17600 where POSIX says socklen_t is required in portable programs.
17601 This fixes a porting bug on hosts like 64-bit HP-UX, where
17602 socklen_t is wider than int (Bug#8277).
17603 (Fmake_network_process, server_accept_connection):
17604 (wait_reading_process_output, read_process_output):
17605 Likewise.
17606
17607 * process.c: Rename or move locals to avoid shadowing.
17608 (list_processes_1, Fmake_network_process):
17609 (read_process_output_error_handler, exec_sentinel_error_handler):
17610 Rename or move locals.
17611 (Fmake_network_process): Define label "retry_connect" only if needed.
17612 (Fnetwork_interface_info): Fix pointer signedness.
17613 (process_send_signal): Add cast to avoid pointer signedness problem.
17614 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17615 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17616
17617 Make tparam.h and terminfo.c consistent.
17618 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17619 Include tparam.h instead, since it declares them.
17620 * cm.h (PC): Remove extern decl; tparam.h now does this.
17621 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17622 * terminfo.c: Include tparam.h, to check interfaces.
17623 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17624 (tparam): Adjust signature to match interface in tparam.h;
17625 this removes some undefined behavior. Check that outstring and len
17626 are zero, which they always are with Emacs.
17627 * tparam.h (PC, BC, UP): New extern decls.
17628
17629 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17630 (xftfont_open): Rename locals to avoid shadowing.
17631
17632 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17633 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17634 (OTF_TAG_SYM): Omit macro if not needed.
17635 (ftfont_list): Remove unused local.
17636 (get_adstyle_property, ftfont_pattern_entity):
17637 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17638 Rename locals to avoid shadowing.
17639
17640 * xfont.c (xfont_list_family): Mark var as initialized.
17641
17642 * xml.c (make_dom): Now static.
17643
17644 * composite.c (composition_compute_stop_pos): Rename local to
17645 avoid shadowing.
17646 (composition_reseat_it): Remove unused locals.
17647 (find_automatic_composition, composition_adjust_point): Likewise.
17648 (composition_update_it): Mark var as initialized.
17649 (find_automatic_composition): Mark vars as initialized,
17650 with a FIXME (Bug#8290).
17651
17652 character.h: Rename locals to avoid shadowing.
17653 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17654 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17655 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17656 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17657 to avoid shadowing.
17658
17659 * textprop.c (property_change_between_p): Remove; unused.
17660
17661 * intervals.c (interval_start_pos): Now static.
17662
17663 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17664
17665 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17666 Rename locals to avoid shadowing.
17667
17668 * sound.c (wav_play, au_play, Fplay_sound_internal):
17669 Fix pointer signedness.
17670 (alsa_choose_format): Remove unused local var.
17671 (wav_play): Initialize a variable to 0, to prevent undefined
17672 behavior (Bug#8278).
17673
17674 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17675
17676 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17677
17678 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17679 clobbering (Bug#8298).
17680 * sysdep.c (sys_subshell): Likewise.
17681 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17682
17683 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17684 This should get cleaned up, so that child_setup has the
17685 same signature on all platforms.
17686
17687 * callproc.c (call_process_cleanup): Now static.
17688 (relocate_fd): Rename locals to avoid shadowing.
17689
17690 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
17691
17692 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17693 not to be necessary, and produces flickering.
17694
17695 2011-03-20 Glenn Morris <rgm@gnu.org>
17696
17697 * config.in: Remove file.
17698
17699 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
17700
17701 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17702 are now in src/globals.h.
17703 (syms_of_minibuf): Remove spurious & from previous change.
17704
17705 2011-03-20 Leo Liu <sdl.web@gmail.com>
17706
17707 * minibuf.c (completing-read-function): New variable.
17708 (completing-read-default): Rename from completing-read.
17709 (completing-read): Call completing-read-function.
17710
17711 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17712
17713 * xfaces.c (Fx_load_color_file):
17714 Read color file from absolute filename (bug#8250).
17715
17716 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17717
17718 * makefile.w32-in: Update dependencies.
17719
17720 2011-03-17 Eli Zaretskii <eliz@gnu.org>
17721
17722 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17723
17724 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17725
17726 Fix more problems found by GCC 4.5.2's static checks.
17727
17728 * process.c (make_serial_process_unwind, send_process_trap):
17729 (sigchld_handler): Now static.
17730
17731 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17732 That way, the code declares only the vars that it needs.
17733 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17734 * s/cygwin.h (PTY_ITERATION): Likewise.
17735 * s/darwin.h (PTY_ITERATION): Likewise.
17736 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17737
17738 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17739 * process.c (allocate_pty): Don't declare stb unless it's needed.
17740
17741 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17742 (CONSTANTLIM): Remove; unused.
17743 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17744 Define only if needed.
17745
17746 * unexelf.c (unexec): Name an expression,
17747 to avoid gcc -Wbad-function-cast warning.
17748 Use a different way to cause a compilation error if anyone uses
17749 n rather than nn, a way that does not involve shadowing.
17750 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17751
17752 * deps.mk (unexalpha.o): Remove; unused.
17753
17754 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17755 * unexec.h: New file.
17756 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17757 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17758 Depend on unexec.h.
17759 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17760 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17761 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17762 Change as necessary to match prototype in unexec.h.
17763
17764 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17765 shadowing.
17766 (back_comment, skip_chars): Mark vars as initialized.
17767
17768 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17769 Rename locals to avoid shadowing.
17770
17771 * lread.c (read1): Rewrite so as not to use empty "else".
17772 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17773
17774 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17775
17776 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17777 warning when compiling print.c.
17778
17779 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17780 instead of using an uninitialized var.
17781 (font_sort_entities): Mark var as initialized.
17782
17783 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17784
17785 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17786 pointers to constants.
17787 (font_parse_fcname): Remove unused vars.
17788 (font_delete_unmatched): Now static.
17789 (font_get_spec): Remove; unused.
17790 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17791 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17792 Rename or move locals to avoid shadowing.
17793
17794 * fns.c (require_nesting_list, require_unwind): Now static.
17795 (Ffillarray): Rename locals to avoid shadowing.
17796
17797 * floatfns.c (domain_error2): Define only if needed.
17798 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17799
17800 * alloc.c (mark_backtrace): Move decl from here ...
17801 * lisp.h: ... to here, so that it can be checked.
17802
17803 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17804 (Fdefvar): Rewrite so as not to use empty "else".
17805 (lisp_indirect_variable): Name an expression,
17806 to avoid gcc -Wbad-function-cast warning.
17807 (Fdefvar): Rename locals to avoid shadowing.
17808
17809 * callint.c (quotify_arg, quotify_args): Now static.
17810 (Fcall_interactively): Rename locals to avoid shadowing.
17811 Use const pointer when appropriate.
17812
17813 * lisp.h (get_system_name, get_operating_system_release):
17814 Move decls here, to check interfaces.
17815 * process.c (get_operating_system_release): Move decl to lisp.h.
17816 * xrdb.c (get_system_name): Likewise.
17817 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17818 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17819 some of which prompt warnings from gcc -Wbad-function-cast.
17820 (Fformat_time_string, Fencode_time, Finsert_char):
17821 (Ftranslate_region_internal, Fformat):
17822 Rename or remove local vars to avoid shadowing.
17823 (Ftranslate_region_internal): Mark var as initialized.
17824
17825 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17826 avoid shadowing.
17827
17828 * lisp.h (eassert): Check that the argument compiles, even if
17829 ENABLE_CHECKING is not defined.
17830
17831 * data.c (Findirect_variable): Name an expression, to avoid
17832 gcc -Wbad-function-cast warning.
17833 (default_value, arithcompare, arith_driver, arith_error): Now static.
17834 (store_symval_forwarding): Rename local to avoid shadowing.
17835 (Fmake_variable_buffer_local, Fmake_local_variable):
17836 Mark variables as initialized.
17837 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17838
17839 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17840 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17841 Rename locals to avoid shadowing.
17842 (mark_stack): Move local variables into the #ifdef region where
17843 they're used.
17844 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17845 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17846 needed otherwise.
17847 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17848 (GC_STRING_CHARS): Remove; not used.
17849 (Fmemory_limit): Cast sbrk's returned value to char *.
17850
17851 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17852 avoids undefined behavior in theory.
17853
17854 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17855
17856 Use functions, not macros, for up- and down-casing (Bug#8254).
17857 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17858 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17859 to use the following functions instead of these macros.
17860 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17861 EMACS_INT, since callers assume the returned value fits in int.
17862 (upcase1): Likewise, for UPCASE_TABLE.
17863 (uppercasep, lowercasep, upcase): New static inline functions.
17864 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17865 the race-condition problem in the old DOWNCASE.
17866
17867 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17868 Rename locals to avoid shadowing.
17869 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17870 (regex_compile, re_search_2, re_match_2_internal):
17871 Remove unused local vars.
17872 (FREE_VAR): Rewrite so as not to use empty "else",
17873 which gcc can warn about.
17874 (regex_compile, re_match_2_internal): Mark locals as initialized.
17875 (RETALLOC_IF): Define only if needed.
17876 (WORDCHAR_P): Likewise. This one is never needed, but is used
17877 only in a comment talking about a compiler bug, so put inside
17878 the #if 0 of that comment.
17879 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17880 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17881 Remove; unused.
17882
17883 * search.c (boyer_moore): Rename locals to avoid shadowing.
17884 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17885 (PREV_CHAR_BOUNDARY): Likewise.
17886
17887 * search.c (simple_search): Remove unused var.
17888
17889 * dired.c (compile_pattern): Move decl from here ...
17890 * lisp.h: ... to here, so that it can be checked.
17891 (struct re_registers): New forward decl.
17892
17893 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17894
17895 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17896 All uses changed.
17897 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17898 Rename locals to avoid shadowing.
17899 (Fvertical_motion): Mark locals as initialized.
17900
17901 * casefiddle.c (casify_object, casify_region): Now static.
17902 (casify_region): Mark local as initialized.
17903
17904 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17905
17906 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17907 New macros, so that the caller can use some names other than
17908 gcpro1, gcpro2, etc.
17909 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17910 of the new macros.
17911 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17912 argument, for consistency with GCPRO2_VAR, etc: it is now the
17913 prefix of the variable, not the variable itself. All uses
17914 changed.
17915 * dired.c (directory_files_internal, file_name_completion):
17916 Rename locals to avoid shadowing.
17917
17918 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17919 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17920 dired.c's scmp function, had undefined behavior.
17921 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17922 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17923 * buffer.h: ... to here, because these macros use current_buffer,
17924 and the new implementation with inline functions needs to have
17925 current_buffer in scope now, rather than later when the macros
17926 are used.
17927 (downcase, upcase1): New static inline functions.
17928 (DOWNCASE, UPCASE1): Reimplement using these functions.
17929 This avoids undefined behavior in expressions like
17930 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17931 from race conditions in accessing the global variables
17932 case_temp1 and case_temp2.
17933 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17934 * lisp.h (case_temp1, case_temp2): Remove their decls.
17935 * character.h (ASCII_CHAR_P): Move from here ...
17936 * lisp.h: ... to here, so that the inline functions mentioned
17937 above can use them.
17938
17939 * dired.c (directory_files_internal_unwind): Now static.
17940
17941 * fileio.c (file_name_as_directory, directory_file_name):
17942 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17943 Now static.
17944 (file_name_as_directory): Use const pointers when appropriate.
17945 (Fexpand_file_name): Likewise. In particular, newdir might
17946 point at constant storage, so make it a const pointer.
17947 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17948 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17949 signedness issues.
17950 (Fset_file_times, Finsert_file_contents, auto_save_error):
17951 Rename locals to avoid shadowing.
17952
17953 * minibuf.c (choose_minibuf_frame_1): Now static.
17954 (Ftry_completion, Fall_completions): Rename or remove locals
17955 to avoid shadowing.
17956
17957 * marker.c (bytepos_to_charpos): Remove; unused.
17958
17959 * lisp.h (verify_bytepos, count_markers): New decls,
17960 so that gcc does not warn that these functions aren't declared.
17961
17962 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17963 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17964 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17965 (copy_text): Remove unused local var.
17966
17967 * filelock.c (within_one_second): Now static.
17968 (lock_file_1): Rename local to avoid shadowing.
17969
17970 * buffer.c (fix_overlays_before): Mark locals as initialized.
17971 (fix_start_end_in_overlays): Likewise. This function should be
17972 simplified by using pointers-to-pointers, but that's a different
17973 matter.
17974 (switch_to_buffer_1): Now static.
17975 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17976 (report_overlay_modification): Rename locals to avoid shadowing.
17977
17978 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17979 Fix pointer signedness issue.
17980 (sys_subshell): Mark local as volatile if checking for lint,
17981 to suppress a gcc -Wclobbered warning that does not seem to be right.
17982 (MAXPATHLEN): Define only if needed.
17983
17984 * process.c (serial_open, serial_configure): Move decls from here ...
17985 * systty.h: ... to here, so that they can be checked.
17986
17987 * fns.c (get_random, seed_random): Move extern decls from here ...
17988 * lisp.h: ... to here, so that they can be checked.
17989
17990 * sysdep.c (reset_io): Now static.
17991 (wait_for_termination_signal): Remove; unused.
17992
17993 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17994 (copy_keymap_item, append_key, push_text_char_description):
17995 Now static.
17996 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17997 (DENSE_TABLE_SIZE): Remove; unused.
17998 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17999 (describe_map_tree):
18000 Rename locals to avoid shadowing.
18001
18002 * keyboard.c: Declare functions static if they are not used elsewhere.
18003 (echo_char, echo_dash, cmd_error, top_level_2):
18004 (poll_for_input, handle_async_input): Now static.
18005 (read_char, kbd_buffer_get_event, make_lispy_position):
18006 (make_lispy_event, make_lispy_movement, apply_modifiers):
18007 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18008 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18009 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18010 (read_key_sequence, read_char): Mark locals as initialized.
18011 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18012
18013 * keyboard.h (make_ctrl_char): New decl.
18014 (mark_kboards): Move decl here ...
18015 * alloc.c (mark_kboards): ... from here.
18016
18017 * lisp.h (force_auto_save_soon): New decl.
18018
18019 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18020 (DEFINE_DUMMY_FUNCTION): New macro.
18021 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18022 Use it.
18023 (main): Add casts to avoid warnings
18024 if GCC considers string literals to be constants.
18025
18026 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18027
18028 * dbusbind.c: Pointer signedness fixes.
18029 (xd_signature, xd_append_arg, xd_initialize):
18030 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18031 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18032 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18033 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18034
18035 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18036 if GCC considers string literals to be constants.
18037 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18038
18039 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18040
18041 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18042 (print_preprocess, print_object): New macro to fix last change.
18043
18044 * print.c (print_preprocess): Don't forget font objects.
18045
18046 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
18047
18048 * emacs.c (USAGE3): Doc fixes.
18049
18050 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18051
18052 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18053 structure.
18054
18055 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
18056
18057 * lisp.h (VWindow_system, Qfile_name_history):
18058 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18059 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18060 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18061
18062 * w32select.c: Don't #include "keyboard.h".
18063 (run_protected): Add extern declaration for waiting_for_input.
18064
18065 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18066 * w32console.c (detect_input_pending, read_input_pending)
18067 (encode_terminal_code):
18068 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18069 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18070 (w32_system_caret_y, Qfile_name_history):
18071 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18072 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18073 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18074 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18075 * w32proc.c (Qlocal, report_file_error):
18076 * w32term.c (Vwindow_system, updating_frame):
18077 * w32uniscribe.c (initialized, uniscribe_font_driver):
18078 Remove unneeded extern declarations.
18079
18080 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
18081
18082 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18083
18084 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
18085
18086 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18087 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18088 These macros can no longer be used for assignment.
18089
18090 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18091 Assign struct members directly, instead of using BUF_BEGV etc.
18092 (record_buffer_markers, fetch_buffer_markers): New functions for
18093 recording and fetching special buffer markers.
18094 (set_buffer_internal_1, set_buffer_temp): Use them.
18095
18096 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18097
18098 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18099
18100 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18101 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18102
18103 * xdisp.c (hscroll_window_tree):
18104 (reconsider_clip_changes): Use PT instead of BUF_PT.
18105
18106 2011-03-13 Eli Zaretskii <eliz@gnu.org>
18107
18108 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18109 $(EMACS_ROOT)/lib/intprops.h.
18110
18111 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18112
18113 Fix more problems found by GCC 4.5.2's static checks.
18114
18115 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18116 to unsigned char * to avoid compiler diagnostic.
18117 (xg_free_frame_widgets): Make it clear that a local variable is
18118 needed only if USE_GTK_TOOLTIP.
18119 (gdk_window_get_screen): Make it clear that this macro is needed
18120 only if USE_GTK_TOOLTIP.
18121 (int_gtk_range_get_value): New function, which avoids a diagnostic
18122 from gcc -Wbad-function-cast.
18123 (xg_set_toolkit_scroll_bar_thumb): Use it.
18124 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18125 diagnostic from gcc -Wbad-function-cast.
18126 (get_utf8_string, xg_get_file_with_chooser):
18127 Rename locals to avoid shadowing.
18128 (create_dialog): Move locals to avoid shadowing.
18129
18130 * xgselect.c (xg_select): Remove unused var.
18131
18132 * image.c (four_corners_best): Mark locals as initialized.
18133 (gif_load): Initialize transparent_p to zero (Bug#8238).
18134 Mark another local as initialized.
18135 (my_png_error, my_error_exit): Mark with NO_RETURN.
18136
18137 * image.c (clear_image_cache): Now static.
18138 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18139 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18140 (x_edge_detection): Remove unnecessary cast that
18141 gcc -Wbad-function-cast diagnoses.
18142 (gif_load): Fix pointer signedness.
18143 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18144 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18145
18146 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18147
18148 Improve quality of tests for time stamp overflow.
18149 For example, without this patch (encode-time 0 0 0 1 1
18150 1152921504606846976) returns the obviously-bogus value (-948597
18151 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18152 reports time overflow. See
18153 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18154 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18155 * editfns.c: Include limits.h and intprops.h.
18156 (TIME_T_MIN, TIME_T_MAX): New macros.
18157 (time_overflow): Move earlier, to before first use.
18158 (hi_time, lo_time): New functions, for an accurate test for
18159 out-of-range times.
18160 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18161 (Fget_internal_run_time): Don't assume time_t fits in int.
18162 (make_time): Use list2 instead of Fcons twice.
18163 (Fdecode_time): More accurate test for out-of-range times.
18164 (check_tm_member): New function.
18165 (Fencode_time): Use it, to test for out-of-range times.
18166 (lisp_time_argument): Don't rely on undefined left-shift and
18167 right-shift behavior when checking for time stamp overflow.
18168
18169 * editfns.c (time_overflow): New function, refactoring common code.
18170 (Fformat_time_string, Fdecode_time, Fencode_time):
18171 (Fcurrent_time_string): Use it.
18172
18173 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18174 * dired.c (make_time): Move to ...
18175 * editfns.c (make_time): ... here.
18176 * systime.h: Note the move.
18177
18178 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18179
18180 * fringe.c (update_window_fringes): Remove unused variables.
18181
18182 * unexmacosx.c (copy_data_segment): Also copy __got section.
18183 (Bug#8223)
18184
18185 2011-03-12 Eli Zaretskii <eliz@gnu.org>
18186
18187 * termcap.c [MSDOS]: Include "msdos.h".
18188 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18189 Constify `char *' arguments and their references according to
18190 prototypes in tparam.h.
18191
18192 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18193
18194 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18195 Adapt all references accordingly.
18196
18197 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18198
18199 2011-03-11 Tom Tromey <tromey@redhat.com>
18200
18201 * buffer.c (syms_of_buffer): Remove obsolete comment.
18202
18203 2011-03-11 Eli Zaretskii <eliz@gnu.org>
18204
18205 * termhooks.h (encode_terminal_code): Declare prototype.
18206
18207 * msdos.c (encode_terminal_code): Don't declare prototype.
18208
18209 * term.c (encode_terminal_code): Now external again, used by
18210 w32console.c and msdos.c.
18211
18212 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18213 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18214
18215 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
18216
18217 Fix some minor problems found by GCC 4.5.2's static checks.
18218
18219 * fringe.c (update_window_fringes): Mark locals as initialized
18220 (Bug#8227).
18221 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18222
18223 * alloc.c (mark_fringe_data): Move decl from here ...
18224 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18225 to check its interface.
18226 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18227
18228 * fontset.c (free_realized_fontset): Now static.
18229 (Fset_fontset_font): Rename local to avoid shadowing.
18230 (fontset_font): Mark local as initialized.
18231 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18232
18233 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18234
18235 * xselect.c (x_disown_buffer_selections): Remove; not used.
18236 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18237 (x_own_selection, Fx_disown_selection_internal): Rename locals
18238 to avoid shadowing.
18239 (x_handle_dnd_message): Remove local to avoid shadowing.
18240
18241 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18242 so that the caller can use some name other than gcpro1.
18243 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18244 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18245 (Fx_backspace_delete_keys_p):
18246 Use them to avoid shadowing, and rename vars to avoid shadowing.
18247 (x_decode_color, x_set_name, x_window): Now static.
18248 (Fx_create_frame): Add braces to silence GCC warning.
18249 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18250 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18251 Remove unused locals.
18252 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18253 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18254 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18255 macros.
18256
18257 * xterm.h (x_mouse_leave): New decl.
18258
18259 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18260 Remove unused functions.
18261 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18262 (x_calc_absolute_position): Now static.
18263 (XTread_socket): Don't define label "out" unless it's used.
18264 Don't declare local "event" unless it's used.
18265 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18266 unless they are used.
18267 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18268 (x_fatal_error_signal): Remove; not used.
18269 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18270 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18271 (x_error_catcher, x_connection_closed, x_error_handler):
18272 (x_error_quitter, xembed_send_message, x_iconify_frame):
18273 (my_log_handler): Rename locals to avoid shadowing.
18274 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18275 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18276
18277 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18278 Rename or move locals to avoid shadowing.
18279 (tty_defined_color, merge_face_heights): Now static.
18280 (free_realized_faces_for_fontset): Remove; not used.
18281 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18282 does not deduce is never used uninitialized.
18283 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18284 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18285
18286 * terminal.c (store_terminal_param): Now static.
18287
18288 * xmenu.c (menu_highlight_callback): Now static.
18289 (set_frame_menubar): Remove unused local.
18290 (xmenu_show): Rename parameter to avoid shadowing.
18291 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18292 since they might point to immutable storage.
18293 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18294 since it's unused otherwise.
18295
18296 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18297 Add a FIXME, since the code still doesn't look right. (Bug#8215)
18298 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18299 avoids a gcc -Wuninitialized diagnostic.
18300 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18301 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18302 does not deduce are never used uninitialized.
18303
18304 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18305
18306 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18307 * window.c (window_loop, size_window):
18308 (run_window_configuration_change_hook, enlarge_window): Likewise.
18309
18310 * window.c (display_buffer): Now static.
18311 (size_window): Mark variables that gcc -Wuninitialized
18312 does not deduce are never used uninitialized.
18313 * window.h (check_all_windows): New decl, to forestall
18314 gcc -Wmissing-prototypes diagnostic.
18315 * dispextern.h (bidi_dump_cached_states): Likewise.
18316
18317 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18318 shadowing.
18319 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18320 Include <limits.h>.
18321 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18322 and to avoid gcc -Wuninitialized warning.
18323 (load_charset_map): Mark variables that gcc -Wuninitialized
18324 does not deduce are never used uninitialized.
18325 (load_charset): Abort instead of using uninitialized var (Bug#8229).
18326
18327 * coding.c (coding_set_source, coding_set_destination):
18328 Use "else { /* comment */ }" rather than "else /* comment */;"
18329 for clarity, and to avoid gcc -Wempty-body warning.
18330 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18331 a block, when the outer 'i' will do.
18332 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18333 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18334 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18335 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18336 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18337 Rename locals to avoid shadowing.
18338 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
18339 * coding.c (emacs_mule_char, encode_invocation_designation):
18340 Now static, since they're not used elsewhere.
18341 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
18342 (decode_coding_object, encode_coding_object, detect_coding_system):
18343 (decode_coding_emacs_mule): Mark variables that gcc
18344 -Wuninitialized does not deduce are never used uninitialized.
18345 (detect_coding_iso_2022): Initialize a local variable that might
18346 be used uninitialized. Leave a FIXME because it's not clear that
18347 this initialization is needed. (Bug#8211)
18348 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18349 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18350 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18351 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18352 Remove unused macros.
18353
18354 * category.c (hash_get_category_set): Remove unused local var.
18355 (copy_category_table): Now static, since it's not used elsewhere.
18356 * character.c (string_count_byte8): Likewise.
18357
18358 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18359 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18360
18361 * chartab.c (copy_sub_char_table): Now static, since it's not used
18362 elsewhere.
18363 (sub_char_table_ref_and_range, char_table_ref_and_range):
18364 Rename locals to avoid shadowing.
18365 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
18366
18367 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18368 (BIDI_BOB): Remove unused macro.
18369
18370 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18371 deduce are never used uninitialized.
18372 * term.c (encode_terminal_code): Likewise.
18373
18374 * term.c (encode_terminal_code): Now static. Remove unused local.
18375
18376 * tparam.h: New file.
18377 * term.c, tparam.h: Include it.
18378 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18379 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18380 Move these decls to tparam.h, and make them agree with what
18381 is actually in tparam.c. The previous trick of using incompatible
18382 decls in different modules does not conform to the C standard.
18383 All callers of tparam changed to use tparam's actual API.
18384 * tparam.c (tparam1, tparam, tgoto):
18385 Use const pointers where appropriate.
18386
18387 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18388 * cm.h (struct cm): Likewise.
18389 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18390 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18391 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18392 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18393 (turn_on_face, init_tty): Likewise.
18394 * termchar.h (struct tty_display_info): Likewise.
18395
18396 * term.c (term_mouse_position): Rename local to avoid shadowing.
18397
18398 * alloc.c (mark_ttys): Move decl from here ...
18399 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18400
18401 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18402
18403 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18404
18405 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
18406
18407 * search.c (compile_pattern_1): Remove argument regp, unused since
18408 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18409 (compile_pattern): Don't pass it.
18410
18411 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18412
18413 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18414 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18415 for ! HAVE_GTK3.
18416 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18417
18418 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18419
18420 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18421 gdk_window_get_screen, gdk_window_get_geometry,
18422 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18423 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18424 (xg_get_pixbuf_from_pixmap): New function.
18425 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18426 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18427 Call xg_get_pixbuf_from_pixmap instead of
18428 gdk_pixbuf_get_from_drawable.
18429 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18430 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18431 (xg_check_special_colors): Use GtkStyleContext and its functions
18432 for HAVE_GTK3.
18433 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18434 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18435 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18436 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18437 Call gtk_widget_get_preferred_size.
18438 (xg_frame_resized): gdk_window_get_geometry only takes 5
18439 parameters.
18440 (xg_win_to_widget, xg_event_is_for_menubar):
18441 Call gdk_x11_window_lookup_for_display.
18442 (xg_set_widget_bg): New function.
18443 (delete_cb): New function.
18444 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18445 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18446 (xg_set_background_color): Call xg_set_widget_bg.
18447 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18448 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18449 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18450 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18451 if ! HAVE_GTK3.
18452 (update_frame_tool_bar): Call gtk_widget_hide.
18453 (xg_initialize): Use GDK_KEY_g.
18454
18455 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18456 if ! HAVE_GTK3
18457 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18458
18459 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18460 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18461 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18462
18463 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18464
18465 * w32xfns.c (select_palette): Check success of RealizePalette against
18466 GDI_ERROR, not zero.
18467
18468 See ChangeLog.11 for earlier changes.
18469
18470 ;; Local Variables:
18471 ;; coding: utf-8
18472 ;; End:
18473
18474 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18475
18476 This file is part of GNU Emacs.
18477
18478 GNU Emacs is free software: you can redistribute it and/or modify
18479 it under the terms of the GNU General Public License as published by
18480 the Free Software Foundation, either version 3 of the License, or
18481 (at your option) any later version.
18482
18483 GNU Emacs is distributed in the hope that it will be useful,
18484 but WITHOUT ANY WARRANTY; without even the implied warranty of
18485 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18486 GNU General Public License for more details.
18487
18488 You should have received a copy of the GNU General Public License
18489 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.