Support setting file times of directories on MS-Windows.
[bpt/emacs.git] / src / ChangeLog
1 2012-10-05 Eli Zaretskii <eliz@gnu.org>
2
3 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
4 that time stamps of directories could also be changed. Don't
5 request the too broad GENERIC_WRITE, only the more restrictive
6 FILE_WRITE_ATTRIBUTES access rights.
7
8 * fileio.c (Fset_file_times): Special-case ignoring errors for
9 directories only on MSDOS, not on MS-Windows.
10
11 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
12
13 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
14
15 2012-10-04 Eli Zaretskii <eliz@gnu.org>
16
17 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
18 see whether CreateFile failed.
19
20 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
21
22 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
23 to avoid similar races.
24 * keyboard.c (pending_signals): Now bool, not int.
25
26 Port timers to OpenBSD, plus check for timer failures.
27 OpenBSD problem reported by Han Boetes.
28 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
29 and/or setitimer.
30 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
31 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
32 like OpenBSD, which has timer_settime but does not declare it.
33 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
34 whether to use itimerspec-related primitives. All uses of
35 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
36
37 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
38
39 * profiler.c (handle_profiler_signal): Fix a malloc race
40 that caused Emacs to hang on Fedora 17 when profiling Lisp.
41
42 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
43
44 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
45
46 2012-10-02 Eli Zaretskii <eliz@gnu.org>
47
48 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
49 consistent with the change in return value of 'safe_strsignal'.
50
51 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
52
53 Prefer plain 'static' to 'static inline' (Bug#12541).
54 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
55 (bidi_set_sor_type, bidi_push_embedding_level)
56 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
57 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
58 (bidi_cache_search, bidi_cache_ensure_space)
59 (bidi_cache_iterator_state, bidi_cache_find)
60 (bidi_peek_at_next_level, bidi_set_paragraph_end)
61 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
62 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
63 Now 'static', not 'static inline'.
64
65 Count overruns when profiling; change units to ns.
66 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
67 Give extra weight to samples after overruns, to attempt to count
68 the time more accurately.
69 (setup_cpu_timer): Change sampling interval units from ms to ns, since
70 the underlying primitives nominally do ns.
71 (Fprofiler_cpu_start): Document the change. Mention that
72 the sampling intervals are only approximate.
73
74 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
75
76 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
77
78 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
79 case for the special 0 coding-system.
80
81 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
82 (Fmake_overlay): Remove redundant tests.
83 (fix_start_end_in_overlays): Remove redundant recentering.
84
85 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
86
87 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
88 Update dependencies.
89
90 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
91
92 Fix a malloc race condition involving strsignal.
93 A signal can arrive in the middle of a malloc, and Emacs's signal
94 handler can invoke strsignal, which can invoke malloc, which is
95 not portable. This race condition bug makes Emacs hang on GNU/Linux.
96 Fix it by altering the signal handler so that it does not invoke
97 strsignal.
98 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
99 * process.c (status_message): Use const pointer, in case strsignal
100 is #defined to safe_strsignal.
101 * sysdep.c (sys_siglist, init_signals): Always define and
102 initialize a substitute sys_siglist if the system does not define
103 one, even if HAVE_STRSIGNAL.
104 (safe_strsignal): Rename from strsignal. Always define,
105 using sys_siglist. Return a const pointer.
106 * syssignal.h (safe_strsignal): New decl.
107 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
108
109 2012-10-01 Eli Zaretskii <eliz@gnu.org>
110
111 * w32proc.c (timer_loop): Fix code that waits for timer
112 expiration, to avoid high CPU usage.
113
114 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
115
116 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
117 (sweep_weak_table): Remove redundant prototypes.
118
119 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
120
121 * emacs.c: Move the inclusion of TERM_HEADER after including
122 windows.h on WINDOWSNT. This avoids compilation problems with
123 MSVC.
124
125 2012-10-01 Eli Zaretskii <eliz@gnu.org>
126
127 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
128 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
129 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
130 as the previous version used 'void *'.
131
132 * ralloc.c (ROUNDUP): Fix last change.
133 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
134 'size_t'.
135
136 * w32proc.c <disable_itimers>: New static flag.
137 (init_timers): Initialize it to zero, after creating the critical
138 sections used by the timer threads.
139 (term_timers): Set to 1 before deleting the critical sections.
140 (getitimer, setitimer): If disable_itimers is non-zero, return an
141 error indication without doing anything. Reported by Fabrice
142 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
143 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
144 return results.
145 [!HAVE_SETITIMER]: Behave as the previous version that didn't
146 support timers.
147
148 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
149 term_ntproc after all the other bookkeeping, to get timers working
150 as long as possible.
151
152 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
153
154 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
155 Suggested by Juri Linkov in
156 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
157
158 Prefer plain 'static' to 'static inline' (Bug#12541).
159 With static functions, modern compilers inline pretty well by
160 themselves; advice from programmers often hurts as much as it helps.
161 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
162 this change shrinks the text size of the Emacs executable by 1.1%
163 without affecting CPU significantly in my benchmark.
164 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
165 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
166 (mark_maybe_object, mark_maybe_pointer, bounded_number):
167 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
168 (bset_auto_fill_function, bset_auto_save_file_format)
169 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
170 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
171 (bset_cache_long_line_scans, bset_case_fold_search)
172 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
173 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
174 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
175 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
176 (bset_header_line_format, bset_indicate_buffer_boundaries)
177 (bset_indicate_empty_lines, bset_invisibility_spec)
178 (bset_left_fringe_width, bset_major_mode, bset_mark)
179 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
180 (bset_name, bset_overwrite_mode, bset_pt_marker)
181 (bset_right_fringe_width, bset_save_length)
182 (bset_scroll_bar_width, bset_scroll_down_aggressively)
183 (bset_scroll_up_aggressively, bset_selective_display)
184 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
185 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
186 (set_buffer_overlays_after):
187 * category.c (bset_category_table):
188 * charset.c (read_hex):
189 * coding.c (produce_composition, produce_charset)
190 (handle_composition_annotation, handle_charset_annotation)
191 (char_encodable_p):
192 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
193 (assign_row, set_frame_matrix_frame, make_current)
194 (add_row_entry):
195 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
196 * fns.c (maybe_resize_hash_table):
197 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
198 * gmalloc.c (register_heapinfo):
199 * image.c (lookup_image_type):
200 * intervals.c (set_interval_object, set_interval_left)
201 (set_interval_right, copy_interval_parent, rotate_right)
202 (rotate_left, balance_possible_root_interval):
203 * keyboard.c (kset_echo_string, kset_kbd_queue)
204 (kset_keyboard_translate_table, kset_last_prefix_arg)
205 (kset_last_repeatable_command, kset_local_function_key_map)
206 (kset_overriding_terminal_local_map, kset_real_last_command)
207 (kset_system_key_syms, clear_event, set_prop):
208 * lread.c (digit_to_number):
209 * marker.c (attach_marker, live_buffer, set_marker_internal):
210 * nsterm.m (ns_compute_glyph_string_overhangs):
211 * process.c (pset_buffer, pset_command)
212 (pset_decode_coding_system, pset_decoding_buf)
213 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
214 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
215 (pset_status, pset_tty_name, pset_type, pset_write_queue):
216 * syntax.c (bset_syntax_table, dec_bytepos):
217 * terminal.c (tset_param_alist):
218 * textprop.c (interval_has_some_properties)
219 (interval_has_some_properties_list):
220 * window.c (wset_combination_limit, wset_dedicated)
221 (wset_display_table, wset_hchild, wset_left_fringe_width)
222 (wset_left_margin_cols, wset_new_normal, wset_new_total)
223 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
224 (wset_right_fringe_width, wset_right_margin_cols)
225 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
226 (wset_vertical_scroll_bar_type, wset_window_parameters):
227 * xdisp.c (wset_base_line_number, wset_base_line_pos)
228 (wset_column_number_displayed, wset_region_showing)
229 (window_box_edges, run_window_scroll_functions)
230 (append_glyph_string_lists, prepend_glyph_string_lists)
231 (append_glyph_string, set_glyph_string_background_width)
232 (append_glyph, append_composite_glyph)
233 (take_vertical_position_into_account):
234 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
235 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
236 (lface_hash, lface_same_font_attributes_p, lookup_face):
237 * xml.c (libxml2_loaded_p):
238 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
239 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
240 Now 'static', not 'static inline'.
241
242 * bidi.c: Tune.
243 (bidi_copy_it): Do the whole copy with a single memcpy.
244 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
245
246 Revert the FOLLOW-SYMLINKS change for file-attributes.
247 Doing it right would require several changes to Tramp, and there's
248 not enough time to get that tested before the freeze today.
249 * dired.c (directory_files_internal, Ffile_attributes):
250 Undo last change.
251
252 * frame.c (x_report_frame_params): Port better to wider ints.
253 Do not assume that EMACS_UINT is the same width as uprintmax_t,
254 or that pointers can be printed in 15 decimal digits.
255 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
256
257 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
258
259 Support x64 build on MS-Windows.
260 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
261 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
262 compatibility with x64.
263 (x_get_focus_frame): Add prototype.
264
265 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
266 defining an XRectangle structure.
267
268 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
269 arithmetics for compatibility with x64.
270
271 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
272 compatibility with x64.
273
274 * w32heap.h: Adjust prototypes and declarations.
275
276 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
277 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
278 DWORD, long, and unsigned long, for compatibility with x64.
279 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
280 (sbrk): Argument is now of type ptrdiff_t.
281
282 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
283 less than 0x0500.
284 (w32_msg_pump): Use WPARAM type for 'result'.
285
286 * w32.c (init_environment, get_emacs_configuration): Support AMD64
287 architecture.
288 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
289 compatibility with x64.
290
291 * vm-limit.c (lim_data): Now size_t.
292 (check_memory_limits): Adjust prototypes of real_morecore and
293 __morecore to receive argument of type ptrdiff_t. Use size_t for
294 five_percent and data_size.
295
296 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
297 variables, for compatibility with x64.
298 (rva_to_section, offset_to_section, relocate_offset)
299 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
300 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
301 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
302 for compatibility with x64.
303
304 * sysdep.c (STDERR_FILENO): Define if not already defined.
305
306 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
307 (__morecore): Argument type is now ptrdiff_t.
308 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
309 (relinquish): Use ptrdiff_t type for 'excess'.
310 (r_alloc_sbrk): Argument type is now ptrdiff_t.
311
312 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
313 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
314 instead of a literal number.
315
316 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
317 (min): Define only if not already defined.
318
319 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
320 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
321 hosts.
322
323 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
324 'bitmaps' is a pointer.
325
326 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
327
328 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
329
330 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
331
332 file-attributes has a new optional arg FOLLOW-SYMLINKS.
333 * dired.c (directory_files_internal, Ffile_attributes):
334 New arg follow_symlinks. All uses changed.
335
336 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
337
338 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
339
340 2012-09-30 Eli Zaretskii <eliz@gnu.org>
341
342 Support atimers and CPU profiler via profile.c on MS-Windows.
343 * w32proc.c (sig_mask, crit_sig): New static variables.
344 (sys_signal): Support SIGALRM and SIGPROF.
345 (sigemptyset, sigaddset, sigfillset, sigprocmask)
346 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
347 sigfillset, and sigprocmask are no longer no-ops.
348 (sigismember): New function.
349 (struct itimer_data): New definition.
350 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
351 (crit_prof): New static variables.
352 (MAX_SINGLE_SLEEP): New definition.
353 (timer_loop, stop_timer_thread, term_timers, init_timers)
354 (start_timer_thread, getitimer, setitimer): New functions.
355 (alarm): No longer a no-op, calls setitimer.
356
357 * w32.c (term_ntproc): Call term_timers.
358 (init_ntproc): Make sure all signals are unblocked at startup, to
359 erase any traces of dumping. Call init_timers.
360
361 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
362 Windows-specific code to display the hourglass mouse pointer is no
363 longer used.
364 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
365 to hourglass timer expiration.
366 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
367 Remove, no longer used.
368 (w32_note_current_window, show_hourglass, hide_hourglass):
369 New functions, in support of hourglass cursor display similar to other
370 window systems.
371 (syms_of_w32fns): Don't initialize hourglass_timer.
372
373 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
374 WINDOWSNT as well.
375 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
376
377 * w32.h (init_timers, term_timers): Add prototypes.
378
379 2012-09-30 Kenichi Handa <handa@gnu.org>
380
381 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
382 to the buffer relocation which may be caused by ccl_driver.
383
384 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
385
386 * xfns.c (Fx_file_dialog): Update comment.
387
388 * w32fns.c (Fx_file_dialog): Update comment.
389
390 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
391 Initialize panel name field if OSX >= 10.6.
392
393 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
394
395 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
396
397 * nsterm.m (NEW_STYLE_FS): New define.
398 (ns_fullscreen_hook, windowWillEnterFullScreen)
399 (windowDidEnterFullScreen, windowWillExitFullScreen)
400 (windowDidExitFullScreen, toggleFullScreen, handleFS)
401 (setFSValue): New functions.
402 (EmacsFSWindow): New implementation.
403 (canBecomeKeyWindow): New function for EmacsFSWindow.
404 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
405 (dealloc): Release nonfs_window if in fullscreen.
406 (updateFrameSize:): Call windowDidMove to update top/left.
407 (windowWillResize:toSize:): Check if frame is still maximized.
408 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
409 next_maximized, maximized_width, maximized_height and nonfs_window.
410 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
411 tbar_height.
412 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
413 fullscreen. Set maximized_width/height. Act on next_maximized.
414
415 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
416 (EmacsView): Add variables for fullscreen.
417 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
418 (EmacsFSWindow): New interface for fullscreen.
419
420 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
421
422 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
423
424 2012-09-30 Chong Yidong <cyd@gnu.org>
425
426 * fns.c (Frandom): Doc fix.
427
428 2012-09-30 Martin Rudalics <rudalics@gmx.at>
429
430 * window.c (Vwindow_combination_limit): New default value.
431 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
432
433 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
434
435 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
436 Suggested by Eli Zaretskii in
437 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
438
439 2012-09-30 Eli Zaretskii <eliz@gnu.org>
440
441 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
442 HAVE_TIMER_SETTIME is defined.
443
444 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
445
446 Profiler improvements: more-accurate timers, overflow checks.
447 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
448 signal.h, setjmp.h. Include systime.h instead.
449 (saturated_add): New function.
450 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
451 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
452 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
453 New static vars.
454 (enum profiler_cpu_running): New enum.
455 (profiler_cpu_running): Now of that enum type, not bool.
456 All uses changed to store the new value.
457 (handle_profiler_signal): Rename from sigprof_handler_1,
458 for consistency with other handlers. Do not check whether
459 cpu_log is a hash-table if garbage collecting, since it
460 doesn't matter in that case.
461 (deliver_profiler_signal): Rename from sigprof_handler,
462 for consistency with other handlers.
463 (setup_cpu_timer): New function, with much of what used to be in
464 Fprofiler_cpu_start. Check for out-of-range argument.
465 Prefer timer_settime if available, and prefer
466 thread cputime clocks, then process cputime clocks, then
467 monotonic clocks, to the old realtime clock. Use make_timeval
468 to round more-correctly when falling back to setitimer.
469 (Fprofiler_cpu_start): Use it.
470 (Fprofiler_cpu_stop): Prefer timer_settime if available.
471 Don't assume that passing NULL as the 2nd argument of setitimer
472 is the same as passing a pointer to all-zero storage.
473 Ignore SIGPROF afterwards.
474 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
475 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
476 non-fatal signal handlers. Ignore SIGPROF on startup.
477 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
478 in profiler.c, since sysdep.c now uses it.
479
480 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
481 Suggested by Eli Zaretskii in
482 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
483
484 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
485
486 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
487
488 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
489
490 * lisp.h (struct backtrace): Remove indirection for `function' field.
491 * xdisp.c (redisplay_internal):
492 * profiler.c (record_backtrace, sigprof_handler_1):
493 * alloc.c (Fgarbage_collect):
494 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
495 (Fbacktrace_frame): Adjust accordingly.
496
497 2012-09-28 Glenn Morris <rgm@gnu.org>
498
499 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
500 (Frun_hook_with_args_until_failure): Doc fixes.
501
502 2012-09-28 Eli Zaretskii <eliz@gnu.org>
503
504 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
505 Qautomatic_redisplay and change the symbol name. All users changed.
506
507 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
508
509 * profiler.c (sigprof_handler): Fix race condition.
510
511 2012-09-28 Glenn Morris <rgm@gnu.org>
512
513 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
514
515 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
516
517 Check more robustly for timer_settime.
518 * Makefile.in (LIB_TIMER_TIME): New macro.
519 (LIBES): Add it.
520 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
521 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
522 call timer_settime.
523
524 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
525
526 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
527
528 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
529
530 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
531
532 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
533
534 * character.h (MAYBE_UNIFY_CHAR): Remove.
535 * charset.c, charset.h (maybe_unify_char): Now static.
536 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
537 Since this stuff is now private to charset.c, there's no need for
538 a public macro and no need to inline by hand.
539
540 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
541 Stefan Monnier <monnier@iro.umontreal.ca>
542 Juanma Barranquero <lekktu@gmail.com>
543
544 * profiler.c: New file.
545 * Makefile.in (base_obj): Add profiler.o.
546 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
547 ($(BLD)/profiler.$(O)): New target.
548 * emacs.c (main): Call syms_of_profiler.
549 * alloc.c (Qautomatic_gc): New constant.
550 (MALLOC_PROBE): New macro.
551 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
552 (total_bytes_of_live_objects): New function.
553 (Fgarbage_collect): Use it. Record itself in backtrace_list.
554 Call malloc_probe for the memory profiler.
555 (syms_of_alloc): Define Qautomatic_gc.
556 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
557 race condition.
558 (struct backtrace): Move definition...
559 * lisp.h (struct backtrace): ..here.
560 (Qautomatic_gc, profiler_memory_running): Declare vars.
561 (malloc_probe, syms_of_profiler): Declare functions.
562 * xdisp.c (Qautomatic_redisplay): New constant.
563 (redisplay_internal): Record itself in backtrace_list.
564 (syms_of_xdisp): Define Qautomatic_redisplay.
565
566 2012-09-25 Eli Zaretskii <eliz@gnu.org>
567 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
568
569 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
570
571 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
572
573 Prefer POSIX timers if available.
574 They avoid a race if the timer is too close to the current time.
575 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
576 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
577 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
578
579 2012-09-25 Eli Zaretskii <eliz@gnu.org>
580
581 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
582 CHAR_STRING_ADVANCE.
583 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
584 STRING_CHAR_ADVANCE.
585
586 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
587
588 Move Vlibrary_cache to emacs.c and reset before dumping.
589
590 * lisp.h (reset_image_types): Declare.
591 [WINDOWSNT] (Vlibrary_cache): Declare.
592
593 * image.c (reset_image_types): New function.
594
595 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
596 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
597 (Fdump_emacs): Reset Vlibrary_cache and image_types.
598
599 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
600 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
601
602 * w32.h (Vlibrary_cache): Do not declare.
603
604 2012-09-25 Eli Zaretskii <eliz@gnu.org>
605
606 * w32proc.c (sys_signal): Handle all signals defined by the
607 MS-Windows runtime, not just SIGCHLD. Actually install the signal
608 handlers for signals supported by Windows. Don't override
609 term_ntproc as the handler for SIGABRT.
610 (sigaction): Rewrite to call sys_signal instead of duplicating its
611 code.
612 (sys_kill): Improve commentary.
613
614 * w32.c (term_ntproc): Accept (and ignore) one argument, for
615 consistency with a signature of a signal handler. All callers
616 changed.
617 (init_ntproc): Accept an argument DUMPING. If dumping, don't
618 install term_ntproc as a signal handler for SIGABRT, as that
619 should be done by the dumped Emacs.
620
621 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
622
623 * w32select.c (term_w32select): Protect against repeated
624 invocation by setting clipboard_owner to NULL after calling
625 DestroyWindow.
626
627 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
628 and term_ntproc to their modified signatures.
629
630 * character.c (char_string, string_char): Remove calls to
631 MAYBE_UNIFY_CHAR. See the discussion starting at
632 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
633 for the details.
634
635 2012-09-25 Chong Yidong <cyd@gnu.org>
636
637 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
638
639 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
640
641 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
642 when encountering an unknown bytecode.
643
644 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
645
646 image.c, indent.c: Use bool for booleans.
647 * dispextern.h (struct image_type): Members valid_p, load, init
648 now return bool, not int. All uses changed.
649 * image.c: Omit unnecessary static decls.
650 (x_create_bitmap_mask, x_build_heuristic_mask):
651 Return void, not int, since callers don't care about the return value.
652 (x_create_bitmap_mask, define_image_type, valid_image_p)
653 (struct image_keyword, parse_image_spec, image_spec_value)
654 (check_image_size, image_background)
655 (image_background_transparent, x_clear_image_1)
656 (postprocess_image, lookup_image, x_check_image_size)
657 (x_create_x_image_and_pixmap, xbm_image_p)
658 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
659 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
660 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
661 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
662 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
663 (png_image_p, init_png_functions, png_load_body, png_load)
664 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
665 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
666 (init_gif_functions, gif_load, imagemagick_image_p)
667 (imagemagick_load_image, imagemagick_load, svg_image_p)
668 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
669 (gs_load):
670 * nsimage.m (ns_load_image):
671 * nsterm.m (ns_defined_color):
672 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
673 * xfns.c (x_defined_color):
674 * xterm.c (x_alloc_lighter_color_for_widget)
675 (x_alloc_nearest_color_1, x_alloc_nearest_color)
676 (x_alloc_lighter_color):
677 * indent.c (disptab_matches_widthtab, current_column)
678 (scan_for_column, string_display_width, indented_beyond_p)
679 (compute_motion, vmotion, Fvertical_motion):
680 Use bool for booleans.
681
682 2012-09-24 Chong Yidong <cyd@gnu.org>
683
684 * chartab.c (Fset_char_table_default): Obsolete function removed.
685
686 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
687
688 Move pid_t related decls out of lisp.h.
689 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
690 (interruptible_wait_for_termination):
691 Move these decls from lisp.h to syswait.h, since they use pid_t.
692 Needed on FreeBSD; see Herbert J. Skuhra in
693 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
694 * callproc.c: Include syswait.h.
695
696 gnutls.c, gtkutil.c: Use bool for boolean.
697 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
698 (emacs_gnutls_handle_error):
699 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
700 (xg_hide_tooltip, xg_create_frame_widgets)
701 (create_dialog, xg_uses_old_file_dialog)
702 (xg_get_file_with_chooser, xg_get_file_with_selection)
703 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
704 (xg_item_label_same_p, xg_update_menubar)
705 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
706 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
707 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
708 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
709 (update_frame_tool_bar, free_frame_tool_bar):
710 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
711 * nsmenu.m (ns_update_menubar):
712 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
713 * xfns.c (Fx_show_tip) [USE_GTK]:
714 Use bool for boolean.
715 * gtkutil.c (xg_update_frame_menubar):
716 * xmenu.c (update_frame_menubar):
717 Return void, not int, since caller ignores return value.
718 * gtkutil.c (xg_change_toolbar_position):
719 Return void, not 1.
720
721 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
722
723 * makefile.w32-in (BLOCKINPUT_H): Remove.
724 (SYSSIGNAL_H): New macro.
725 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
726 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
727 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
728 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
729 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
730 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
731 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
732 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
733 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
734 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
735 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
736 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
737 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
738 ($(BLD)/w32xfns.$(O)): Update dependencies.
739
740 2012-09-23 Eli Zaretskii <eliz@gnu.org>
741
742 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
743 fatal_error_backtrace.
744
745 * w32proc.c (sys_kill): Undo last change: don't do anything when
746 invoked to deliver SIGABRT to our own process. This is now
747 handled by emacs_raise.
748
749 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
750
751 * w32term.c (w32_read_socket): Remove leftover reference to
752 interrupt_input_pending.
753
754 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
755
756 Do not use SA_NODEFER.
757 Problem reported by Dani Moncayo in
758 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
759 * alloc.c (die):
760 * sysdep.c (emacs_abort): Do not reset signal handler.
761 * emacs.c (terminate_due_to_signal): Reset signal handler here.
762 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
763 wanted even on POSIXish hosts, and it doesn't work on Windows.
764
765 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
766
767 * xterm.c (x_term_init): Call fixup_locale before and after calling
768 gtk_init (Bug#12392).
769
770 2012-09-23 Chong Yidong <cyd@gnu.org>
771
772 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
773 Vdynamic_library_alist.
774
775 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
776 (Fgnutls_available_p): Caller changed.
777
778 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
779 (Flibxml_parse_xml_region): Likewise.
780
781 * dispextern.h (struct image_type): Remove arg from init function.
782
783 * image.c (Finit_image_library, lookup_image_type)
784 (define_image_type): Remove now-unneeded second arg.
785 (init_xpm_functions, init_png_functions, init_jpeg_functions)
786 (init_tiff_functions, init_gif_functions, init_svg_functions):
787 Arglist and w32_delayed_load calling convention changed.
788 (gs_type): Remove init_gs_functions; there is no such function.
789 (valid_image_p, make_image): Fix caller to lookup_image_type.
790
791 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
792
793 Simplify and avoid signal-handling races (Bug#12471).
794 * alloc.c (die):
795 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
796 Avoid recursive loop if there's a fatal error in the function itself.
797 * atimer.c (pending_atimers):
798 * blockinput.h: Don't include "atimer.h"; no longer needed.
799 (interrupt_input_pending): Remove. All uses removed.
800 pending_signals now counts both atimers and ordinary interrupts.
801 This is less racy than having three separate pending-signal flags.
802 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
803 (input_blocked_p):
804 Rename from their upper-case counterparts BLOCK_INPUT,
805 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
806 INPUT_BLOCKED_P, and turn into functions. All uses changed.
807 This makes it easier to access volatile variables more accurately.
808 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
809 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
810 that's more reliable if the code is buggy and sets
811 interrupt_input_blocked to a negative value. All uses changed.
812 * atimer.c (deliver_alarm_signal):
813 Remove. No need to deliver this to the parent; any thread can
814 handle this signal now. All uses replaced by underlying handler.
815 * atimer.c (turn_on_atimers):
816 * dispnew.c (handle_window_change_signal):
817 * emacs.c (handle_danger_signal):
818 * keyboard.c (kbd_buffer_get_event):
819 Don't reestablish signal handler; not needed with sigaction.
820 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
821 (UNBLOCK_INPUT_TO):
822 Rework to avoid unnecessary accesses to volatile variables.
823 (UNBLOCK_INPUT_TO): Now a function.
824 (totally_unblock_input, unblock_input): New decls.
825 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
826 (init_data): Remove. Necessary stuff now done in init_signal.
827 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
828 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
829 (fatal_error_code): Remove; no longer needed.
830 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
831 it doesn't always backtrace. All uses changed. No need to reset
832 signal to default, since sigaction and/or die does that for us now.
833 Use emacs_raise (FOO), not kill (getpid (), FOO).
834 (main): Check more-accurately whether we're dumping.
835 Move fatal-error setup to sysdep.c
836 * floatfns.c: Do not include "syssignal.h"; no longer needed.
837 * gtkutil.c (xg_get_file_name, xg_get_font):
838 Remove no-longer-needed signal-mask manipulation.
839 * keyboard.c, process.c (POLL_FOR_INPUT):
840 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
841 * keyboard.c (read_avail_input): Remove.
842 All uses replaced by gobble_input.
843 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
844 (kbd_buffer_store_event_hold, gobble_input):
845 (record_asynch_buffer_change) [USABLE_SIGIO]:
846 (store_user_signal_events):
847 No need to mess with signal mask.
848 (gobble_input): If blocking input and there are terminals, simply
849 set pending_signals to 1 and return. All hooks changed to not
850 worry about whether input is blocked.
851 (process_pending_signals): Clear pending_signals before processing
852 them, in case a signal comes in while we're processing.
853 By convention callers now test pending_signals before calling us.
854 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
855 New functions, to support changes to blockinput.h.
856 (handle_input_available_signal): Now extern.
857 (reinvoke_input_signal): Remove. All uses replaced by
858 handle_async_input.
859 (quit_count): Now volatile, since a signal handler uses it.
860 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
861 All callers changed. Block SIGINT only if not already blocked.
862 Clear sigmask reliably, even if Fsignal returns, which it can.
863 Omit unnecessary accesses to volatile var.
864 (quit_throw_to_read_char): No need to restore sigmask.
865 * keyboard.c (gobble_input, handle_user_signal):
866 * process.c (wait_reading_process_output):
867 Call signal-handling code rather than killing ourselves.
868 * lisp.h: Include <float.h>, for...
869 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
870 (pending_signals): Now volatile.
871 (syms_of_data): Now const if IEEE floating point.
872 (handle_input_available_signal) [USABLE_SIGIO]:
873 (terminate_due_to_signal, record_child_status_change): New decls.
874 * process.c (create_process): Avoid disaster if memory is exhausted
875 while we're processing a vfork, by tightening the critical section
876 around the vfork.
877 (send_process_frame, process_sent_to, handle_pipe_signal)
878 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
879 ignores SIGPIPE.
880 (send_process): No need for setjmp/longjmp any more, since the
881 SIGPIPE stuff is now gone. Instead, report an error if errno
882 is EPIPE.
883 (record_child_status_change): Now extern. PID and W are now args.
884 Return void, not bool. All callers changed.
885 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
886 Remove. All uses removed. This bug should be fixed now in a
887 different way.
888 (wait_for_termination_1): Use waitpid rather than sigsuspend,
889 and record the child status change directly. This avoids the
890 need to futz with the signal mask.
891 (process_fatal_action): Move here from emacs.c.
892 (emacs_sigaction_flags): New function, containing
893 much of what used to be in emacs_sigaction_init.
894 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
895 caught by emacs, to make races less likely.
896 (deliver_process_signal): Rename from handle_on_main_thread.
897 All uses changed.
898 (BACKTRACE_LIMIT_MAX): Now at top level.
899 (thread_backtrace_buffer, threadback_backtrace_pointers):
900 New static vars.
901 (deliver_thread_signal, deliver_fatal_thread_signal):
902 New functions, for more-accurate delivery of thread-specific signals.
903 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
904 (deliver_arith_signal): Handle in this thread, not
905 in the main thread, since it's triggered by this thread.
906 (maybe_fatal_sig): New function.
907 (init_signals): New arg DUMPING so that we can be more accurate
908 about whether we're dumping. Caller changed.
909 Treat thread-specific signals differently from process-general signals.
910 Block all signals while handling fatal error; that's safer.
911 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
912 on IEEE hosts.
913 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
914 Ignore SIGPIPE unless batch.
915 (emacs_backtrace): Output backtrace for the appropriate thread,
916 which is not necessarily the main thread.
917 * syssignal.h: Include <stdbool.h>.
918 (emacs_raise): New macro.
919 * xterm.c (x_connection_signal): Remove; no longer needed
920 now that we use sigaction.
921 (x_connection_closed): No need to mess with sigmask now.
922 (x_initialize): No need to reset SIGPIPE handler here, since
923 init_signals does this for us now.
924
925 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
926
927 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
928 background rect may be larger (Bug#12245).
929
930 2012-09-23 Chong Yidong <cyd@gnu.org>
931
932 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
933
934 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
935
936 * .gdbinit: Just stop at fatal_error_backtrace.
937 See Stefan Monnier's request in
938 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
939 Remove no-longer-used query of system type.
940
941 2012-09-22 Chong Yidong <cyd@gnu.org>
942
943 * search.c (Freplace_match): Doc fix (Bug#12325).
944
945 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
946
947 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
948 (Fline_end_position): Doc fix.
949
950 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
951
952 2012-09-22 Chong Yidong <cyd@gnu.org>
953
954 * dispextern.h (struct image_type): Add new slot, storing a type
955 initialization function.
956
957 * image.c (define_image_type): Call the image initializer function
958 if it is defined. Arguments and return value changed.
959 (valid_image_p, make_image): Callers changed.
960 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
961 (gif_type, imagemagick_type, svg_type, gs_type):
962 Add initialization functions.
963 (Finit_image_library): Call lookup_image_type.
964 (CHECK_LIB_AVAILABLE): Macro deleted.
965 (lookup_image_type): Call define_image_type here, rather than via
966 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
967 (syms_of_image): Move define_image_type calls for xbm_type and
968 pbm_type to lookup_image_type.
969
970 2012-09-22 Eli Zaretskii <eliz@gnu.org>
971
972 * keyboard.c (timer_check_2): Move calculation of 'timers' and
973 'idle_timers' from here ...
974 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
975 lists, to avoid infloops when the timer does something stupid,
976 like reinvoke itself with the same or smaller time-out.
977 (Bug#12447)
978
979 2012-09-22 Martin Rudalics <rudalics@gmx.at>
980
981 * window.c (Fsplit_window_internal): Handle only Qt value of
982 Vwindow_combination_limit separately.
983 (Qtemp_buffer_resize): New symbol.
984 (Vwindow_combination_limit): New default value.
985 Rewrite doc-string.
986
987 2012-09-22 Eli Zaretskii <eliz@gnu.org>
988
989 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
990 the new overlay string. (Bug#10159)
991
992 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
993
994 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
995 or that fprintf is async-signal-safe. POSIX doesn't require
996 either assumption.
997
998 2012-09-22 Chong Yidong <cyd@gnu.org>
999
1000 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1001 (Bug#8207).
1002
1003 2012-09-22 Kenichi Handa <handa@gnu.org>
1004
1005 * composite.c (composition_reseat_it): Handle the case that a
1006 grapheme cluster is not covered by a single font (Bug#12352).
1007
1008 2012-09-21 Chong Yidong <cyd@gnu.org>
1009
1010 * image.c (define_image_type): Avoid adding duplicate types to
1011 image_types (Bug#12463). Suggested by Jörg Walter.
1012
1013 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1014
1015 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1016 (print_load_command_name): Add case LC_DATA_IN_CODE.
1017 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1018
1019 2012-09-21 Glenn Morris <rgm@gnu.org>
1020
1021 * eval.c (Frun_hook_with_args_until_success)
1022 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1023
1024 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1025
1026 * fileio.c (Ffile_selinux_context): Only call freecon when
1027 lgetfilecon succeeded.
1028 (Fset_file_selinux_context): Likewise. (Bug#12444)
1029
1030 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1031
1032 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1033 reordering, locate the cursor by calling set_cursor_from_row; if
1034 that fails, clear the desired glyph matrix before returning a
1035 failure indication to the caller. Fixes leaving garbled display
1036 when fast scrolling with a down-key. (Bug#12403)
1037 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1038 scrolling through multibyte text.
1039
1040 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1041
1042 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1043 calling mark_vectorlike since that's the one that marks the window.
1044 (mark_discard_killed_buffers): Mark the final cdr.
1045 * window.h (struct window): Move prev/next_buffers to the
1046 non-standard fields.
1047 * window.c (make_window): Initialize prev/next_buffers manually.
1048
1049 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1050
1051 Omit unused arg EXPECTED from socket hooks.
1052 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1053 * nsterm.m (ns_term_init):
1054 * termhooks.h (struct terminal.read_socket_hook):
1055 * w32inevt.c (w32_console_read_socket):
1056 * w32term.c (w32_read_socket):
1057 * xterm.c (XTread_socket):
1058 Omit unused arg EXPECTED. All callers changed.
1059 (store_user_signal_events): Return void, not int, since callers no
1060 longer care about the return value. All uses changed.
1061
1062 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
1063
1064 * w32gui.h (XParseGeometry): Do not declare.
1065
1066 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1067
1068 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1069 Ignore 'expected'. See Eli Zaretskii in
1070 <http://bugs.gnu.org/12471#8> (last line).
1071
1072 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1073 (XParseGeometry): Now static. Substitute extremal values for
1074 values that are out of range.
1075
1076 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1077
1078 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1079
1080 * nsfns.m (XParseGeometry): Remove.
1081 (Fx_create_frame): Call x_set_offset to correctly interpret
1082 top_pos in geometry.
1083
1084 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1085 (Fx_parse_geometry): If there is a space in string, call
1086 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1087
1088 2012-09-17 Eli Zaretskii <eliz@gnu.org>
1089
1090 * search.c (scan_buffer): Use character positions in calls to
1091 region_cache_forward and region_cache_backward, not byte
1092 positions. (Bug#12196)
1093
1094 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1095 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1096
1097 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1098 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1099 emacs_blocked_malloc, now deleted.
1100
1101 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1102
1103 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1104 The workaround was for improving performance on Solaris 2.4, but
1105 is getting in the way now. Emacs will still work if someone is
1106 still running Solaris 2.4 in a museum somewhere; Sun dropped
1107 support for Solaris 2.4 in 2003.
1108 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1109 * process.c (create_process) [HAVE_WORKING_VFORK]:
1110 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1111 since Emacs no longer uses vfork on that platform.
1112
1113 2012-09-17 Glenn Morris <rgm@gnu.org>
1114
1115 * emacs.c: Use COPYRIGHT.
1116
1117 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1118
1119 Remove configure's --without-sync-input option (Bug#12450).
1120 When auditing signal-handling in preparation for cleaning it up,
1121 I found that SYNC_INPUT has race conditions and would be a real
1122 pain to fix. Since it's an undocumented and deprecated
1123 configure-time option, now seems like a good time to remove it.
1124 Also see <http://bugs.gnu.org/11080#16>.
1125 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1126 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1127 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1128 (malloc_hysteresis):
1129 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1130 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1131 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1132 (dont_register_blocks, bytes_used_when_reconsidered)
1133 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1134 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1135 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1136 Remove. All uses removed.
1137 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1138 implementation, one that depends on whether the new macro
1139 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1140 is defined.
1141 * atimer.c (run_timers, handle_alarm_signal):
1142 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1143 (handle_async_input, process_pending_signals)
1144 (handle_input_available_signal, init_keyboard):
1145 * nsterm.m (ns_read_socket):
1146 * process.c (wait_reading_process_output):
1147 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1148 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1149 (emacs_write):
1150 * xterm.c (XTread_socket):
1151 Assume SYNC_INPUT.
1152 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1153 * eval.c (handling_signal): Remove. All uses removed.
1154 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1155 All uses replaced with the SYNC_INPUT version.
1156 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1157 Remove decls.
1158 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1159 Now static.
1160
1161 * font.c (Ffont_shape_gstring): Remove unused local.
1162
1163 2012-09-16 Glenn Morris <rgm@gnu.org>
1164
1165 * Makefile.in (clean): No longer run nextstep's clean.
1166
1167 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1168 (ns_frag): Remove.
1169 (ns-app): Move here from ns.mk, and simplify.
1170 (clean): Simplify nextstep entry.
1171 * ns.mk: Remove file.
1172
1173 2012-09-17 Kenichi Handa <handa@gnu.org>
1174
1175 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1176 not covert the last few charactes.
1177
1178 2012-09-16 Kenichi Handa <handa@gnu.org>
1179
1180 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1181 here, but just check the validity of glyphs in the glyph-string.
1182
1183 2012-09-16 Martin Rudalics <rudalics@gmx.at>
1184
1185 * window.c (Fwindow_parameter, Fset_window_parameter):
1186 Accept any window as argument (Bug#12452).
1187
1188 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1189
1190 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1191 to ns_term_init to avoid memory leak.
1192
1193 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1194 explicit retain/release.
1195 (ns_term_init): Only allow one display. Initialize outerpool and
1196 ns_*_types.
1197
1198 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1199
1200 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1201 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1202 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1203 the Microsoft problem in a different way, by altering ../nt/config.nt.
1204
1205 2012-09-15 Eli Zaretskii <eliz@gnu.org>
1206
1207 * w32xfns.c:
1208 * w32uniscribe.c:
1209 * w32term.c:
1210 * w32select.c:
1211 * w32reg.c:
1212 * w32proc.c:
1213 * w32menu.c:
1214 * w32inevt.c:
1215 * w32heap.c:
1216 * w32font.c:
1217 * w32fns.c:
1218 * w32console.c:
1219 * w32.c:
1220 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1221 by lisp.h. This completes removal of setjmp.h inclusion
1222 erroneously announced in the previous commit. (Bug#12446)
1223
1224 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1225 more accurate.
1226
1227 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1228 not defined as a macro. The latter happens on MS-Windows.
1229 (Bug#12446)
1230
1231 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1232
1233 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1234 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1235 Some instances of '#include <setjmp.h>' removed, if the
1236 only reason for the instance was because "lisp.h" was included.
1237 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1238 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1239 and _longjmp with the new symbols. Emacs already uses _setjmp if
1240 available, so this change affects only POSIXish hosts that have
1241 sigsetjmp but not _setjmp, such as some versions of Solaris and
1242 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1243 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1244 (png_load_body) [HAVE_PNG]:
1245 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1246 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1247 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1248 since PNG requires jmp_buf. This is the only exception to the
1249 general rule that we now use sys_setjmp and sys_longjmp.
1250 This exception is OK since this code does not change the signal
1251 mask or longjmp out of a signal handler.
1252
1253 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1254
1255 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1256 Include "syssignal.h", for 'main_thread'.
1257
1258 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1259
1260 Avoid out-of-range marker position (Bug#12426).
1261 * insdel.c (replace_range, replace_range_2):
1262 Adjust markers before overlays, as suggested by comments.
1263 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1264 Remove redundant check before calling offset_intervals.
1265
1266 2012-09-14 Martin Rudalics <rudalics@gmx.at>
1267
1268 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1269 current buffer (Bug#12387).
1270
1271 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
1272
1273 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1274
1275 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1276
1277 Use a more backwards-compatible timer format (Bug#12430).
1278 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1279 vector element, not from the 4th, since PSECS is now at the end.
1280 (Fcurrent_idle_time): Doc fix.
1281
1282 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1283
1284 Function to mark objects and remove killed buffers at once.
1285 * alloc.c (discard_killed_buffers): Rename to ...
1286 (mark_discard_killed buffers) ... new name. Add marking
1287 of remaining objects. Fix comment. Adjust users.
1288 (mark_object): Do not touch frame buffer lists here.
1289 * frame.c (delete_frame): Reset frame buffer lists here.
1290
1291 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1292
1293 Better workaround for GNOME bug when --enable-gcc-warnings.
1294 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1295 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1296 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1297
1298 Simplify SIGIO usage (Bug#12408).
1299 The code that dealt with SIGIO was crufty and confusing, e.g., it
1300 played tricks like "#undef SIGIO" but these tricks were not used
1301 consistently. Simplify mostly by not #undeffing standard symbols,
1302 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1303 or not as we please) rather than "defined SIGIO" (standard symbol
1304 that we probably shouldn't #undef).
1305 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1306 Modules that need it can include it.
1307 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1308 * dispextern.h (ignore_sigio): New decl.
1309 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1310 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1311 * emacs.c (shut_down_emacs):
1312 * keyboard.c (kbd_buffer_store_event_hold):
1313 Use ignore_sigio rather than invoking 'signal' directly.
1314 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1315 for FIONREAD.
1316 (FIONREAD, SIGIO): Do not #undef.
1317 (tty_read_avail_input): Use #error rather than a syntax error.
1318 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1319 for I_PIPE, used by SETUP_SLAVE_PTY.
1320 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1321 * sysdep.c (croak): Remove; no longer needed. This bit of
1322 temporary code, with Fred N. Fish's comment that it's temporary,
1323 has been in Emacs since at least 1992!
1324 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1325 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1326 * syssignal.h (croak): Remove decl.
1327 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1328 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1329 now that we're termios-only.
1330 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1331 * term.c (dissociate_if_controlling_tty): Use #error rather than
1332 a run-time error.
1333
1334 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1335 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1336 to work around GNOME bug 683906.
1337 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1338 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1339 This works around GCC bug 54561.
1340
1341 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1342
1343 More fixes for 'volatile' and setjmp/longjmp.
1344 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1345 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1346 (png_load_body) [HAVE_PNG]:
1347 (jpeg_load_body) [HAVE_JPEG]:
1348 New function, with most of the old parent function's body.
1349 (png_load) [HAVE_PNG]:
1350 (jpeg_load) [HAVE_JPEG]:
1351 Invoke the new function, to avoid longjmp munging our locals.
1352 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1353 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1354 longjmp is passed 2, as the C standard doesn't guarantee this.
1355 Instead, store the failure code into mgr->failure_code.
1356
1357 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1358
1359 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1360 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1361 (syms_of_keyboard): Remove support for unread-command-char.
1362
1363 2012-09-12 Eli Zaretskii <eliz@gnu.org>
1364
1365 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1366 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1367 violation. (Bug#12426)
1368
1369 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1370
1371 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1372
1373 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1374
1375 * eval.c: Add `inhibit-debugger'.
1376 (Qinhibit_debugger): New symbol.
1377 (call_debugger): Bind it instead of Qdebug_on_error.
1378 (maybe_call_debugger): Test Vinhibit_debugger.
1379 (syms_of_eval): Define inhibit-debugger.
1380 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1381 (syms_of_xdisp): Remove inhibit-debug-on-message.
1382
1383 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1384
1385 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1386 If a nonvolatile local variable is written before a _longjmp to
1387 the frame containing the variable, and is read after the _longjmp,
1388 the value read is indeterminate. Some local variables of type
1389 'struct handler' and 'struct catchtag' are used in this way, so
1390 mark each of their slots as volatile if the slot can be set before
1391 _longjmp and read afterwards.
1392 * lisp.h (struct handler): var and chosen_clause are now volatile.
1393 (struct catchtag): val, next, and pdlcount are now volatile.
1394
1395 * bidi.c (bidi_push_it, bidi_pop_it):
1396 * fns.c (copy_hash_table):
1397 * image.c (define_image_type):
1398 * keyboard.c (kbd_buffer_store_event_hold):
1399 * process.c (Fprocess_send_eof):
1400 * xfaces.c (x_create_gc) [HAVE_NS]:
1401 * xgselect.c (xg_select):
1402 Prefer assignment to memcpy when either will do.
1403
1404 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1405 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1406 time an item is removed. No need to mark this function 'inline';
1407 the compiler knows better than we do.
1408
1409 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1410
1411 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1412 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1413 to change_frame_size (Bug#12388).
1414 (windowDidResize:): Pass YES to updateFrameSize.
1415
1416 * nsterm.h: Add delay parameter to updateFrameSize.
1417
1418 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1419
1420 Discard killed buffers from deleted window and frame objects.
1421 This reduces an amount of references to killed buffers and
1422 helps GC to reclaim them faster.
1423 * alloc.c (discard_killed_buffers): New function.
1424 (mark_object): Use it for deleted windows and frames.
1425 (mark_object): If symbol's value is set up for a killed buffer
1426 or deleted frame, restore it's global binding.
1427 * data.c (swap_in_global_binding): Add GC notice.
1428 (swap_in_symval_forwarding): Use convenient set_blv_where.
1429 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1430 * window.h: ... to here.
1431
1432 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1433
1434 Convenient macro to check whether the buffer is live.
1435 * buffer.h (BUFFER_LIVE_P): New macro.
1436 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1437 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1438
1439 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1440
1441 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1442 composition cases (Bug#12364).
1443
1444 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1445 overhang of succeeding glyphs overlapping box cursor.
1446
1447 * w32term.c (x_draw_glyph_string): Likewise.
1448
1449 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1450
1451 Simplify, document, and port floating-point (Bug#12381).
1452 The porting part of this patch fixes bugs on non-IEEE platforms
1453 with frexp, ldexp, logb.
1454 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1455 Now static.
1456 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1457 support, by removing commented-out code and briefly listing the
1458 C89 functions excluded. The commented-out stuff was confusing
1459 maintenance, e.g., we thought we needed cbrt but it was commented out.
1460 (logb): Remove decl; no longer needed.
1461 (isfinite): New macro, if not already supplied.
1462 (isnan): Don't replace any existing macro.
1463 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1464 are present on all C89 platforms.
1465 (Ffrexp): Do not special-case zero, as frexp does the right thing
1466 for that case.
1467 (Flogb): Do not use logb, as it doesn't have the desired meaning
1468 on hosts that use non-base-2 floating point. Instead, stick with
1469 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1470 frexp, to avoid getting an unspecified result.
1471
1472 * xdisp.c (Qinhibit_debug_on_message): Now static.
1473
1474 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1475
1476 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1477 NSBezierPath (Bug#12131).
1478
1479 2012-09-10 Chong Yidong <cyd@gnu.org>
1480
1481 * fns.c (Fdelq, Fdelete): Doc fix.
1482
1483 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1484
1485 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1486 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1487
1488 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1489
1490 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1491 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1492 Use it.
1493
1494 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1495
1496 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1497 left fringe if the window has a left margin. This avoids leaving
1498 traces of the cursor because its leftmost pixel is not drawn over.
1499
1500 * dispnew.c (update_window_line): When the left margin area of a
1501 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1502 that screen line. (Bug#12277)
1503
1504 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1505
1506 Assume C89 or later for math functions (Bug#12381).
1507 This simplifies the code, and makes it a bit smaller and faster,
1508 and (most important) makes it easier to clean up signal handling
1509 since we can stop worring about floating-point exceptions in
1510 library code. That was a problem before C89, but the problem
1511 went away many years ago on all practical Emacs targets.
1512 * data.c, image.c, lread.c, print.c:
1513 Don't include <math.h>; no longer needed.
1514 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1515 might be autoconfigured, as that never happens.
1516 * data.c (fmod):
1517 * doprnt.c (DBL_MAX_10_EXP):
1518 * print.c (DBL_DIG):
1519 Remove. C89 or later always defines these.
1520 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1521 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1522 (arith_error, domain_error, domain_error2):
1523 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1524 no longer needed -- we simply return what C returns. All uses removed.
1525 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1526 the wrapped code.
1527 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1528 Remove. All uses expanded, as these macros are no longer used
1529 more than once and are now more trouble than they're worth.
1530 (Ftan): Use tan, not sin / cos.
1531 (Flogb): Assume C89 frexp.
1532 (fmod_float): Assume C89 fmod.
1533 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1534 (init_floatfns): Remove. All uses removed.
1535
1536 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1537
1538 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1539 compositeToPoint for OSX < 10.6 (Bug#12390).
1540
1541 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1542
1543 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1544 This produces more-accurate results.
1545
1546 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1547
1548 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1549 changes (Bug#12088).
1550
1551 2012-09-08 Chong Yidong <cyd@gnu.org>
1552
1553 * syntax.c (Fstring_to_syntax): Doc fix.
1554
1555 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1556
1557 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1558 in the internal border.
1559 (x_set_window_size): Remove static variables and their usage.
1560 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1561 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1562 Remove fringe/internal border adjustment (Bug#11052).
1563 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1564 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1565 (ns_fix_rect_ibw): Remove.
1566 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1567 (ns_dumpglyphs_box_or_relief): Ditto.
1568 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1569 adjustment.
1570 (ns_dumpglyphs_image): Ditto.
1571 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1572 border adjustment.
1573 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1574 their usage. Add fringe_extended_p and its use as in other terms.
1575 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1576 scroll bar was removed.
1577 (updateFrameSize): New function.
1578 (windowDidResize): Move code to updateFrameSize and call it.
1579
1580 * nsterm.h (EmacsView): Add updateFrameSize.
1581
1582 2012-09-07 Chong Yidong <cyd@gnu.org>
1583
1584 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1585
1586 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1587
1588 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1589
1590 More signal-handler cleanup (Bug#12327).
1591 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1592 Problem introduced when merging patches. Noted by Eli Zaretskii in
1593 <http://bugs.gnu.org/12327#67>.
1594 * floatfns.c: Comment fix.
1595 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1596 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1597 and anyway the declaration is harmless even if SIGDANGER is not defined.
1598 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1599 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1600 source files not surprisingly expected syssignal.h to define, or
1601 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1602 Include <sys/ioctl.h>, for FIONREAD.
1603 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1604 This eliminates a problem whereby other files mysteriously had
1605 to include "syssignal.h" before including "systty.h" if they
1606 wanted to use "#ifdef SIGIO".
1607
1608 2012-09-07 Eli Zaretskii <eliz@gnu.org>
1609
1610 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1611
1612 * w32.c (sigemptyset): Empty the set.
1613 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1614
1615 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1616
1617 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1618
1619 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1620 (mark_object): Likewise for frame objects.
1621
1622 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1623
1624 * syssignal.h (handle_on_main_thread): Always declare,
1625 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1626 This ports to platforms without HAVE_PTHREAD.
1627
1628 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1629
1630 Signal-handler cleanup (Bug#12327).
1631 Emacs's signal handlers were written in the old 4.2BSD style with
1632 sigblock and sigmask and so forth, and this led to some
1633 inefficiencies and confusion. Rewrite these to use
1634 pthread_sigmask etc. without copying signal sets around. Also,
1635 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1636 'signal', and instead use functions that do not attempt to take
1637 over the system name space. This patch causes Emacs's text
1638 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1639 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1640 Do not include <signal.h> or "syssignal.h", as these
1641 modules do not use signals.
1642 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1643 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1644 Do not include <signal.h>, as "syssignal.h" does that for us now.
1645 * atimer.c (sigmask_atimers): New function.
1646 (block_atimers, unblock_atimers): New functions,
1647 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1648 All uses replaced.
1649 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1650 no longer needed here.
1651 * emacs.c (main): Inspect existing signal handler with sigaction,
1652 so that there's no need to block and unblock SIGHUP.
1653 * sysdep.c (struct save_signal): New member 'action', replacing
1654 old member 'handler'.
1655 (save_signal_handlers, restore_signal_handlers):
1656 Use sigaction instead of 'signal' to save and restore.
1657 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1658 New function. All users of 'signal' modified to use set_sighandler
1659 if they're writeonly, and to use sys_signal if they're read+write.
1660 (emacs_sigaction_init, forwarded_signal): New functions.
1661 (sys_signal): Remove. All uses replaced by calls to sigaction
1662 and emacs_sigaction_init, or by direct calls to 'signal'.
1663 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1664 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1665 all uses replaced by pthread_sigmask etc. calls.
1666 * syssignal.h: Include <signal.h>.
1667 (emacs_sigaction_init, forwarded_signal): New decls.
1668 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1669 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1670 (sigmask, sys_sigmask): Remove; no longer needed.
1671 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1672 (sigblock, sigunblock, sigfree):
1673 (sigsetmask) [!defined sigsetmask]:
1674 Remove. All uses replaced by pthread_sigmask.
1675 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1676 no longer need to be replaced, and its typical old uses
1677 are now done via emacs_sigaction_init and sigaction.
1678 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1679 (sys_sigdel): Remove; unused.
1680 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1681
1682 2012-09-06 Eli Zaretskii <eliz@gnu.org>
1683
1684 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1685 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1686
1687 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1688
1689 Explicitly mark buffer_defaults and buffer_local_symbols.
1690 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1691 mark_local_symbols here.
1692 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1693 since special buffers aren't marked here any more.
1694 (allocate_buffer): Chain new buffer with all_buffers here...
1695 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1696 not here.
1697 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1698 (syms_of_buffer): Remove staticpro of the above.
1699 (init_buffer_once): Set names for buffer_defaults and
1700 buffer_local_symbols.
1701
1702 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1703
1704 Use bool for booleans in font-related modules.
1705 * font.c (font_intern_prop, font_style_to_value)
1706 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1707 (generate_otf_features, font_check_otf_features, font_check_otf)
1708 (font_match_p, font_list_entities, font_at):
1709 * fontset.c (fontset_id_valid_p, reorder_font_vector
1710 (fontset_find_font, Fset_fontset_font)
1711 (face_suitable_for_char_p) [0]:
1712 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1713 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1714 (m17n_flt_initialized, ftfont_shape_by_flt):
1715 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1716 * nsfont.m (nsfont_draw):
1717 * w32font.c (w32font_draw):
1718 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1719 Use bool for booleans.
1720 * font.h: Adjust to above API changes.
1721 (struct font, struct font_driver, struct font_driver_list):
1722 Use bool for booleans.
1723 (struct font): Remove useless member encoding_type.
1724 All users removed.
1725 * fontset.c, xftfont.c: Omit unnecessary static decls.
1726
1727 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1728
1729 * alloc.c (mark_object): Revert window marking code
1730 since it's unsafe for the Fset_window_configuration.
1731
1732 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1733
1734 Fix race conditions with signal handlers and errno (Bug#12327).
1735 Be more systematic about preserving errno whenever a signal
1736 handler returns, even if it's not in the main thread. Do this by
1737 renaming signal handlers to distinguish between signal delivery
1738 and signal handling. All uses changed.
1739 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1740 * data.c (deliver_arith_signal): Rename from arith_error.
1741 * dispnew.c (deliver_window_change_signal): Rename from
1742 window_change_signal.
1743 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1744 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1745 * keyboard.c (deliver_input_available_signal): Rename from
1746 input_available_signal.
1747 (deliver_user_signal): Rename from handle_user_signal.
1748 (deliver_interrupt_signal): Rename from interrupt_signal.
1749 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1750 (deliver_child_signal): Rename from sigchld_handler.
1751 * atimer.c (handle_alarm_signal):
1752 * data.c (handle_arith_signal):
1753 * dispnew.c (handle_window_change_signal):
1754 * emacs.c (handle_fatal_signal, handle_danger_signal):
1755 * keyboard.c (handle_input_available_signal):
1756 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1757 * process.c (handle_pipe_signal, handle_child_signal):
1758 New functions, with the actual signal-handling code taken from the
1759 original respective signal handlers, sans the sporadic attempts to
1760 preserve errno, since that's now done by handle_on_main_thread.
1761 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1762 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1763 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1764 Move to sysdep.c.
1765 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1766 Move initialization of main_thread to sysdep.c's init_signals.
1767 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1768 our usage, and simplifies the mainline code.
1769 (record_child_status_change): New static function, as a helper
1770 for handle_child_signal, and with most of the old child handler's
1771 contents.
1772 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1773 (handle_child_signal): Use the above.
1774 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1775 Moved here from emacs.c.
1776 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1777 code moved here from emacs.c's main function.
1778 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1779 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1780 This lets callers save and restore errno properly.
1781
1782 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1783
1784 Remove redundant or unused things here and there.
1785 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1786 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1787 * editfns.c (Fcompare_buffer_substrings): Likewise.
1788 * frame.h (struct terminal, struct font_driver_list):
1789 Remove redundant declarations.
1790 * window.h (Qleft, Qright): Likewise.
1791
1792 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1793
1794 Do not mark objects from deleted buffers, windows and frames.
1795 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1796 (mark_object): Likewise for windows and frames.
1797
1798 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1799
1800 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1801 buffer_defaults and buffer_local_symbols as valid objects.
1802 Return special value to denote them.
1803
1804 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1805
1806 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1807 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1808 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1809 (file_name_absolute_p, Fsubstitute_in_file_name):
1810 (check_executable, check_writable, Ffile_accessible_directory_p)
1811 (Fset_file_selinux_context, Fdefault_file_modes)
1812 (Finsert_file_contents, choose_write_coding_system)
1813 (Fwrite_region, build_annotations, a_write, e_write)
1814 (Fdo_auto_save):
1815 * filelock.c (boot_time_initialized, get_boot_time)
1816 (get_boot_time_1, lock_file_1, within_one_second):
1817 * floatfns.c (in_float):
1818 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1819 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1820 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1821 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1822 * window.c (compare_window_configurations):
1823 Use bool for booleans.
1824 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1825 (Fdefault_file_modes): Now mode_t, not int, for modes.
1826 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1827 (internal_delete_file): Now returns void, not a (boolean) int,
1828 since nobody was looking at the return value.
1829 * lisp.h, window.h: Adjust to above API changes.
1830
1831 * xdisp.c (set_message): Simplify and reindent last change.
1832
1833 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
1834
1835 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1836
1837 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1838
1839 * eval.c (call_debugger): Make the function non-static so that we
1840 can call it from set_message.
1841
1842 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1843 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1844
1845 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1846
1847 Give more-useful info on a fatal error (Bug#12328).
1848 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1849 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1850 of doing the work ourselves.
1851 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1852 do most of the work.
1853 (fatal_error_backtrace): New function, taken from the guts
1854 of the old fatal_error_signal, but with a new option to output
1855 a backtrace.
1856 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1857 info about the signal than just its number.
1858 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1859 * sysdep.c: Include <execinfo.h>
1860 (emacs_backtrace): New function, taken partly from the previous
1861 code of the 'die' function.
1862 (emacs_abort): Call fatal_error_backtrace rather than abort.
1863
1864 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1865
1866 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1867 eager (load-time) macro-expansion.
1868 * lisp.mk (lisp): Add macroexp.
1869
1870 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1871
1872 Simplify redefinition of 'abort' (Bug#12316).
1873 Do not try to redefine the 'abort' function. Instead, redo
1874 the code so that it calls 'emacs_abort' rather than 'abort'.
1875 This removes the need for the NO_ABORT configure-time macro
1876 and makes it easier to change the abort code to do a backtrace.
1877 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1878 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1879 Remove; sysdep.c's emacs_abort now takes its place.
1880 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1881 'abort' changed to use 'emacs_abort'.
1882 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1883 (abort) [!defined abort]: Rename to ...
1884 (emacs_abort): ... new name.
1885 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1886 the place of the old 'abort' in emacs.c.
1887 * w32.c, w32fns.c (abort): Do not #undef.
1888 * w32.c (emacs_abort): Rename from w32_abort.
1889
1890 2012-09-04 Eli Zaretskii <eliz@gnu.org>
1891
1892 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1893 offsets[j].dv, since the y axis of the screen coordinates points
1894 down, while the y axis of the font definition coordinates points
1895 up. This fixes display of Arabic diacritics such as KASRA and
1896 KASRATAN. (Bug#11860)
1897
1898 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1899
1900 Be more systematic about _setjmp vs setjmp.
1901 * alloc.c (test_setjmp, mark_stack):
1902 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1903 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1904 (png_load, my_error_exit, jpeg_load):
1905 * process.c (send_process_trap, send_process):
1906 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1907 The underscored versions are up to 30x faster on some hosts.
1908 Formerly, the code used setjmp+longjmp sometimes and
1909 _setjmp+_longjmp at other times, with no particular reason to
1910 prefer setjmp+longjmp.
1911
1912 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1913
1914 Fix minor problem found by static checking.
1915 * buffer.c (Fdelete_all_overlays): Return nil.
1916
1917 2012-09-03 Martin Rudalics <rudalics@gmx.at>
1918
1919 * buffer.c (Fdelete_all_overlays): New function.
1920
1921 2012-09-03 Chong Yidong <cyd@gnu.org>
1922
1923 * gtkutil.c: Add extern decl for Qxft.
1924
1925 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1926
1927 * emacs.c, eval.c: Use bool for boolean.
1928 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1929 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1930 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1931 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1932 (main, decode_env_path, Fdaemon_initialized):
1933 * eval.c (call_debugger, Finteractive_p, interactive_p):
1934 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1935 (maybe_call_debugger, Fbacktrace):
1936 * process.c (read_process_output, exec_sentinel):
1937 Use bool for booleans.
1938 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1939 All callers changed.
1940 * eval.c (interactive_p): Omit always-true boolean argument
1941 EXCLUDE_SUBRS_P. All callers changed.
1942 * dispextern.h, lisp.h: Reflect above API changes.
1943 * firstfile.c (dummy): Use the address of 'main', whose signature
1944 won't change, instead of the address of 'initialize', whose
1945 signature just changed from int to bool.
1946 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1947 * msdos.c (fatal_error_in_progress): ... from here.
1948 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1949 of incrementing it.
1950 (redisplay_internal, unwind_redisplay): Simply clear
1951 REDISPLAYING_P when unwinding, instead of saving its previous,
1952 always-false value and then restoring it.
1953
1954 Clean up some extern decls.
1955 Mostly, this hoists extern decls out of .c files and into .h files.
1956 That way, we're more likely to catch errors if the interfaces change.
1957 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1958 declare xg_mark_data.
1959 * dispextern.h (x_frame_parm_handlers):
1960 * font.h (Qxft):
1961 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1962 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1963 (Qultra_bold, Qoblique, Qitalic):
1964 Move extern decl here from .c file.
1965 * alloc.c (xg_mark_data) [USE_GTK]:
1966 * doc.c (Qclosure):
1967 * eval.c (Qlexical_binding):
1968 * fns.c (time) [!HAVE_UNISTD_H]:
1969 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1970 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1971 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1972 * lread.c (Qinternal_interpreter_environment):
1973 * minibuf.c (Qbuffer):
1974 * process.c (QCfamily, QCfilter):
1975 * widget.c (free_frame_faces):
1976 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1977 * xfont.c (x_clear_errors):
1978 * xterm.c (x_frame_parm_handlers):
1979 Remove now-redundant extern decls.
1980 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1981 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1982 Now static.
1983 * xfaces.c: Remove unnecessary static decls.
1984 * xterm.c (updating_frame): Remove decl of nonexistent object.
1985
1986 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1987 when building globals.h, as the objects that are not built on
1988 this host are not needed to compile C files on this host.
1989
1990 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1991
1992 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1993
1994 * frame.h: Add missing prototype for x_wm_set_size_hint.
1995
1996 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1997
1998 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1999 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2000 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2001 (Fsubstitute_command_keys):
2002 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2003 (save_excursion_save, save_excursion_restore)
2004 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2005 (format_time_string, general_insert_function)
2006 (make_buffer_string, make_buffer_string_both)
2007 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2008 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2009 (copy_text, insert_1, insert_1_both, insert_from_string)
2010 (insert_from_string_before_markers, insert_from_string_1)
2011 (insert_from_buffer, insert_from_buffer_1, replace_range)
2012 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2013 (del_range_2, modify_region):
2014 * intervals.c (intervals_equal, balance_possible_root_interval)
2015 (adjust_intervals_for_insertion, merge_properties_sticky)
2016 (graft_intervals_into_buffer, lookup_char_property)
2017 (adjust_for_invis_intang, set_point_both)
2018 (get_property_and_range, compare_string_intervals)
2019 (set_intervals_multibyte_1, set_intervals_multibyte):
2020 * keyboard.c (decode_timer):
2021 Use bool for boolean.
2022 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2023 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2024
2025 2012-09-02 Chong Yidong <cyd@gnu.org>
2026
2027 * keymap.c (push_key_description): Print M-TAB as C-M-i
2028 (Bug#11758).
2029
2030 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2031
2032 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2033 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2034 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2035 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2036 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2037 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2038 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2039
2040 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2041
2042 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2043 more than one grapheme cluster passed to the shaper: compute the
2044 offset adjustment values separately for each cluster. (Bug#11860)
2045
2046 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2047 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2048 about implicit conversions from integer to pointer.
2049
2050 2012-09-01 Daniel Colascione <dancol@dancol.org>
2051
2052 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2053 system used too early.
2054
2055 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2056
2057 Better seed support for (random).
2058 * emacs.c (main): Call init_random.
2059 * fns.c (Frandom): Set the seed from a string argument, if given.
2060 Remove long-obsolete Gentzel cruft.
2061 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2062 (init_random): New function.
2063
2064 2012-09-01 Daniel Colascione <dancol@dancol.org>
2065
2066 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2067 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2068 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2069 x_wm_set_size_hint, x_query_colors, x_real_positions,
2070 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2071 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2072 all of which have been moved to common code.
2073
2074 * xfaces.c: Include TERM_HEADER instead of listing all possible
2075 window-system headers.
2076
2077 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2078 to match header.
2079
2080 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2081 directly accessing frame internals.
2082
2083 * w32font.h: Include font.h. Define syms_of_w32font and
2084 globals_of_w32font.
2085
2086 * process.c: Include TERM_HEADER instead of listing all possible
2087 window-system headers.
2088
2089 * nsterm.h: Remove declarations now in frame.h.
2090 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2091
2092 * menu.c: Include TERM_HEADER instead of listing all possible
2093 window-system headers.
2094
2095 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2096 window system.
2097
2098 * keyboard.c: Include TERM_HEADER instead of listing all possible
2099 window-system headers.
2100
2101 * image.c: Include TERM_HEADER instead of listing all possible
2102 window-system headers. Declare Vlibrary_cache when compiling for
2103 Windows.
2104
2105 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2106 window system declarations.
2107
2108 * frame.h: Move common functions here: set_frame_menubar,
2109 x_set_window_size, x_sync, x_get_focus_frame,
2110 x_set_mouse_position, x_set_mouse_pixel_position,
2111 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2112 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2113 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2114 x_activate_menubar, x_real_positions, x_bitmap_icon,
2115 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2116 and x_query_colors.
2117
2118 * frame.c: Include TERM_HEADER instead of listing all possible
2119 window-system headers.
2120
2121 * font.c: Include TERM_HEADER instead of listing all possible
2122 window-system headers.
2123
2124 * emacs.c: Include TERM_HEADER.
2125
2126 * dispnew.c: Include TERM_HEADER instead of listing all possible
2127 window-system headers.
2128
2129 * ccl.h: Include character.h.
2130
2131 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2132 the current window system; include in list of objects to link into
2133 Emacs.
2134
2135 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2136
2137 Remove mark_ttys function and fix tty_display_info initialization.
2138 * lisp.h (mark_ttys): Remove prototype.
2139 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2140 to mark_ttys because all possible values of 'top_frame' slot are
2141 the frames which are reachable from Vframe_list.
2142 * term.c (mark_ttys): Remove.
2143 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2144
2145 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2146
2147 Change struct frame bitfields from unsigned char to unsigned.
2148 * frame.h (struct frame): Change type of 'display_preempted',
2149 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2150 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2151 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2152 bitfields from unsigned char to unsigned.
2153
2154 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2155
2156 Remove unused member of struct x_output and struct w32_output.
2157 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2158 * w32term.h (struct w32_output): Likewise.
2159
2160 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2161
2162 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2163 does not become zero (Bug#12234).
2164
2165 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2166
2167 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2168 for GCC 4.7.1 x86-64.
2169
2170 2012-08-30 Glenn Morris <rgm@gnu.org>
2171
2172 * lread.c (init_lread): For out-of-tree builds, only add the
2173 source directory's site-lisp dir to the load-path if it exists,
2174 consistent with in-tree builds. (Bug#12302)
2175
2176 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2177
2178 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2179 button_values to NULL. Call setStykeMask so dialogs get a close button.
2180 (windowShouldClose:): Set window_closed.
2181 (dealloc): New member, free button_values.
2182 (process_dialog:): Make member function. Remove window argument,
2183 replace window with self. Count buttons and allocate and store values
2184 in button_values.
2185 (addButton:value:row:): value is int with the name tag. Call setTag
2186 with tag. Remove return self, declare return value as void.
2187 (addString:row:): Remove return self, declare return value as void.
2188 (addSplit): Remove return self, declare return value as void.
2189 (clicked:): Remove return self, declare return value as void.
2190 Set dialog_return to button_values[seltag]. Code formatting change.
2191 (initFromContents:isQuestion:): Adjust call to process_dialog.
2192 Code formatting change.
2193 (timeout_handler:): Set timer_fired to YES.
2194 (runDialogAt:): Set timer_fired to NO.
2195 Handle click on close button as quit.
2196
2197 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2198 Add window_closed and button_values. Add void as return value for
2199 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2200 Add process_dialog as new member.
2201
2202 2012-08-28 Eli Zaretskii <eliz@gnu.org>
2203
2204 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2205 is not one of the heaps we manage. (Bug#12242)
2206
2207 2012-08-28 Glenn Morris <rgm@gnu.org>
2208
2209 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2210
2211 2012-08-28 Martin Rudalics <rudalics@gmx.at>
2212
2213 * window.c (Fset_window_configuration): Remove handling of
2214 auto-buffer-name window parameter. Install revision of reverted
2215 fix.
2216
2217 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2218
2219 Do not allow to set major mode for a dead buffer.
2220 * buffer.c (Fset_buffer_major_mode): Signal an error
2221 if the buffer is dead.
2222 (Fother_buffer, other_buffer_safely): Remove redundant
2223 nested declaration.
2224
2225 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2226
2227 Always use set_buffer_if_live to restore original buffer at unwind.
2228 * buffer.h (record_unwind_current_buffer): New function.
2229 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2230 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2231 * undo.c, window.c: Adjust users.
2232 * buffer.c (set_buffer_if_live): Fix comment.
2233
2234 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2235
2236 Fix usage of set_buffer_internal.
2237 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2238 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2239 * coding.c (decode_coding): Omit redundant test.
2240 * fileio.c (decide_coding_unwind): Likewise.
2241 * fns.c (secure_hash): Likewise.
2242 * insdel.c (modify_region): Likewise.
2243 * keyboard.c (command_loop_1): Likewise.
2244 * print.c (PRINTFINISH): Likewise.
2245 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2246
2247 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2248
2249 * dispnew.c: Use bool for boolean.
2250 (frame_garbaged, display_completed, delayed_size_change)
2251 (fonts_changed_p, add_window_display_history)
2252 (add_frame_display_history, verify_row_hash)
2253 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2254 (row_equal_p, realloc_glyph_pool)
2255 (allocate_matrices_for_frame_redisplay)
2256 (showing_window_margins_p)
2257 (adjust_frame_glyphs_for_frame_redisplay)
2258 (build_frame_matrix_from_leaf_window, make_current)
2259 (mirrored_line_dance, mirror_line_dance, update_frame)
2260 (update_window_tree, update_single_window)
2261 (check_current_matrix_flags, update_window, update_text_area)
2262 (update_window_line, set_window_update_flags, scrolling_window)
2263 (update_frame_1, scrolling, buffer_posn_from_coords)
2264 (do_pending_window_change, change_frame_size)
2265 (change_frame_size_1, sit_for):
2266 Use bool for boolean.
2267 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2268 and remove last int (actually boolean) argument, which was always 0.
2269 All callers changed.
2270 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2271 * dispextern.h (struct composition_it): Use bool for boolean.
2272 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2273 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2274 * dired.c (file_name_completion):
2275 Use bool for boolean. (This was missed in an earlier change.)
2276
2277 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2278
2279 * window.c (Fset_window_configuration): Revert first part of
2280 last change.
2281
2282 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2283
2284 * nsterm.h (NSPanel): New class variable dialog_return.
2285
2286 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2287 Initialize dialog_return.
2288 (windowShouldClose:): Use stop instead of stopModalWithCode.
2289 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2290 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2291 event.
2292 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2293 modal loop returns.
2294
2295 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2296
2297 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2298 * composite.c (find_composition, composition_gstring_p)
2299 (composition_reseat_it, find_automatic_composition):
2300 * data.c (let_shadows_buffer_binding_p)
2301 (let_shadows_global_binding_p, set_internal, make_blv)
2302 (Fmake_variable_buffer_local, Fmake_local_variable)
2303 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2304 (cons_to_signed, arith_driver):
2305 * dbusbind.c (xd_in_read_queued_messages):
2306 * dired.c (directory_files_internal, file_name_completion):
2307 Use bool for booleans.
2308 * dired.c (file_name_completion):
2309 * process.h (fd_callback):
2310 Omit int (actually boolean) argument. It wasn't being used.
2311 All uses changed.
2312 * composite.h, lisp.h: Reflect above API changes.
2313
2314 * cmds.c, coding.c: Use bool for booleans.
2315 * cmds.c (move_point, Fself_insert_command):
2316 * coding.h (struct composition status, struct coding_system):
2317 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2318 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2319 (emacs_mule_char, decode_coding_emacs_mule)
2320 (encode_coding_emacs_mule, detect_coding_iso_2022)
2321 (decode_coding_iso_2022, encode_invocation_designation)
2322 (encode_designation_at_bol, encode_coding_iso_2022)
2323 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2324 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2325 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2326 (encode_coding_raw_text, detect_coding_charset)
2327 (decode_coding_charset, encode_coding_charset, detect_eol)
2328 (detect_coding, get_translation_table, produce_chars)
2329 (consume_chars, reused_workbuf_in_use)
2330 (make_conversion_work_buffer, code_conversion_save)
2331 (decode_coding_object, encode_coding_object)
2332 (detect_coding_system, char_encodable_p)
2333 (Funencodable_char_position, code_convert_region)
2334 (code_convert_string, code_convert_string_norecord)
2335 (Fset_coding_system_priority):
2336 * fileio.c (Finsert_file_contents):
2337 Use bool for booleans.
2338 * coding.h, lisp.h: Reflect above API changes.
2339 * coding.c: Remove unnecessary static function decls.
2340 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2341 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2342 not a boolean 'int', since callers never look at the return value.
2343 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2344 * coding.h (decoding_buffer_size, encoding_buffer_size)
2345 (emacs_mule_string_char): Remove unused extern decls.
2346 (struct iso_2022_spec, struct coding_system):
2347 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2348 (struct emacs_mule_spec): Remove unused field 'full_support'.
2349 All initializations removed.
2350 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2351
2352 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2353
2354 Fix spare memory change (Bug#12286).
2355 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2356 (valid_lisp_object_p): Likewise.
2357
2358 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2359
2360 * window.c (Fset_window_configuration): Record any window's old
2361 buffer if it's replaced (see Bug#8789). If the new current
2362 buffer doesn't appear in the selected window, go to its old
2363 point (Bug#12208).
2364
2365 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2366
2367 Special MEM_TYPE_SPARE to denote reserved memory.
2368 * alloc.c (enum mem_type): New memory type.
2369 (refill_memory_reserve): Use new type for spare memory.
2370 This prevents live_cons_p and live_string_p from incorrect
2371 detection of uninitialized objects from spare memory as live.
2372
2373 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2374
2375 Spelling fixes.
2376 * Makefile.in (.PHONY): versioclean -> versionclean.
2377
2378 Remove unused external symbols.
2379 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2380 * window.c (Qwindow_valid_p, decode_valid_window):
2381 Now static, not extern.
2382 * data.c (Qinterval): Remove; unused.
2383 (syms_of_data): Do not define 'interval'.
2384 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2385 * window.h (decode_valid_window):
2386 Remove decls.
2387
2388 * character.c, charset.c, chartab.c: Use bool for booleans.
2389 * character.c (lisp_string_width, string_count_byte8)
2390 (string_escape_byte8):
2391 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2392 (load_charset_map_from_file, map_charset_chars)
2393 (Fdefine_charset_internal, define_charset_internal)
2394 (Fdeclare_equiv_charset, find_charsets_in_text)
2395 (Ffind_charset_region, char_charset, Fiso_charset):
2396 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2397 (sub_char_table_set, sub_char_table_set_range)
2398 (char_table_set_range, optimize_sub_char_table)
2399 (map_sub_char_table):
2400 Use bool for boolean.
2401 * character.c (str_to_unibyte): Omit last boolean argument; it was
2402 always 0. All callers changed.
2403 * character.h, charset.h: Adjust to match previous changes.
2404 * character.h (char_printable_p): Remove decl of nonexistent function.
2405 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2406 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2407 are all boolean, so make them single-bit bitfields.
2408
2409 * lisp.h (ASET): Remove attempt to detect side effects.
2410 It was meant to be temporary and it often doesn't work,
2411 because when IDX has side effects the behavior of IDX==IDX
2412 is undefined. See Stefan Monnier in
2413 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2414
2415 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2416
2417 * lisp.h (functionp): New function (extracted from Ffunctionp).
2418 (FUNCTIONP): Use it.
2419 * eval.c (Ffunctionp): Use it.
2420
2421 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2422
2423 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2424 as that's faster and simpler than static storage. Don't bother
2425 with the g_main_context_query overhead if g_main_context_pending
2426 says no events are pending.
2427 (gfds, gfds_size): Remove these static vars.
2428 (xgselect_initialize): Remove; no longer needed.
2429 All uses and decls removed.
2430
2431 * emacs.c (fatal_error_signal_hook): Remove.
2432 All uses removed. This leftover from old code was always 0.
2433
2434 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2435 * casefiddle.c (casify_object, casify_region):
2436 * casetab.c (set_case_table):
2437 * category.c, category.h (word_boundary_p):
2438 * category.h (CHAR_HAS_CATEGORY):
2439 Use bool for booleans, instead of int.
2440
2441 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2442
2443 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2444
2445 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2446
2447 On assertion failure, print backtrace if available.
2448 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2449 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2450 * Makefile.in (LIB_EXECINFO): New macro.
2451 (LIBES): Use it.
2452
2453 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2454 * bytecode.c (exec_byte_code):
2455 * callint.c (check_mark, Fcall_interactively):
2456 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2457 (getenv_internal, sync_process_alive, call_process_exited):
2458 * lisp.h (USE_SAFE_ALLOCA):
2459 Use bool for booleans, instead of int.
2460 * lisp.h, process.h: Adjust prototypes to match above changes.
2461 * callint.c (Fcall_interactively): Don't assume the mark's
2462 offset fits in 'int'.
2463
2464 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2465
2466 * buffer.c, buffer.h: Use bool for boolean.
2467 * buffer.c (reset_buffer_local_variables)
2468 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2469 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2470 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2471 (overlay_touches_p, overlay_strings, Foverlay_put)
2472 (report_overlay_modification, call_overlay_mod_hooks):
2473 (mmap_enlarge, mmap_set_vars):
2474 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2475 Use bool for booleans, instead of int.
2476 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2477 since the 1-or-0 return value is always ignored anyway.
2478 (mmap_initialized_p):
2479 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2480 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2481
2482 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2483
2484 * bidi.c: Use bool for boolean.
2485 This is a bit more readable, and makes the text segment of bidi.o
2486 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2487 Presumably it's faster too.
2488 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2489 Now bool.
2490 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2491 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2492 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2493 (bidi_explicit_dir_char, bidi_level_of_next_char)
2494 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2495 Use bool for booleans, instead of int.
2496 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2497 (bidi_unshelve_cache): Adjust decls to match code.
2498
2499 2012-08-23 Martin Rudalics <rudalics@gmx.at>
2500
2501 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2502 argument.
2503
2504 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2505
2506 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2507 * atimer.h: Include <stdbool.h>.
2508
2509 2012-08-22 Dan Nicolaescu <dann@gnu.org>
2510
2511 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2512 compile time tests instead of run time tests on systems that do
2513 not use them.
2514 (FRAME_MAC_P): Remove leftover from deleted code.
2515 * frame.c (syms_of_frame): Remove leftover from deleted code.
2516
2517 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2518
2519 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2520
2521 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2522
2523 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2524 Otherwise, the compiler complains about (A?B:C) where B is void
2525 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2526 (fontset_add): Return void, for FONTSET_ADD.
2527
2528 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2529
2530 * alloc.c: Use bool for booleans.
2531 (gc_in_progress, abort_on_gc)
2532 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2533 (dont_register_blocks) [GC_MALLOC_CHECK]:
2534 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2535 (check_string_bytes, make_specified_string, memory_full)
2536 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2537 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2538 (mark_stack, valid_pointer_p, make_pure_string)
2539 (Fgarbage_collect, survives_gc_p, gc_sweep):
2540 Use bool for booleans, instead of int.
2541 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2542 Remove unused local.
2543 * alloc.c (PURE_POINTER_P):
2544 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2545 * editfns.c (Fformat):
2546 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2547 (Fdo_auto_save):
2548 * fns.c (sweep_weak_table):
2549 * lisp.h (suppress_checking, push_message, survives_gc_p)
2550 (make_pure_string, gc_in_progress, abort_on_gc):
2551 * lread.c (readchar, read1):
2552 * print.c (Fprin1_to_string):
2553 * xdisp.c (push_message):
2554 Use bool for booleans affected directly or indirectly by
2555 alloc.c's changes.
2556
2557 Make recently-introduced setters macros.
2558 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2559 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2560 (set_fontset_default, set_fontset_fallback): Rename from their
2561 upper-case counterparts, and make them functions rather than macros.
2562 This is more consistent with the other recently-introduced setters.
2563 These don't need to be inline, since they're local.
2564
2565 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2566
2567 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2568 the loop (Bug#12247).
2569
2570 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2571
2572 * lisp.h (vcopy): Use memcpy rather than our own loop.
2573 This fixes a performance regression introduced by the recent
2574 addition of vcopy. This means 'vcopy' will need to be modified
2575 for a copying collector, but that's OK. Also, tighten the
2576 checking in the assertion.
2577
2578 2012-08-21 Eli Zaretskii <eliz@gnu.org>
2579
2580 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2581 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2582 non-base glyph for the width of the base character, according to
2583 what x_draw_composite_glyph_string_foreground expects.
2584 Generate WADJUST value according to composition_gstring_width's
2585 expectations, to produce correct width of the composed character.
2586 Reverse the sign of the DU offset produced by ScriptPlace.
2587
2588 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2589
2590 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2591
2592 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2593
2594 Avoid direct writes to contents member of struct Lisp_Vector.
2595 * lisp.h (vcopy): New function to copy data into vector.
2596 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2597 * fns.c (Ffillarray): Use ASET.
2598 * keyboard.c (timer_check_2): Use AREF and ASET.
2599 (append_tool_bar_item, Frecent_keys): Use vcopy.
2600 * lread.c (read_vector): Use ASET.
2601 * msdos.c (Frecent_doskeys): Use vcopy.
2602 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2603 (Finternal_merge_in_global_face): Use ASET and vcopy.
2604 * xfont.c (xfont_list_pattern): Likewise.
2605
2606 2012-08-21 Martin Rudalics <rudalics@gmx.at>
2607
2608 * window.c (Fwindow_point): For the selected window always return
2609 the position of its buffer's point.
2610 (Fset_window_point): For the selected window always go in its
2611 buffer to the specified position.
2612
2613 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2614
2615 Setter macros for fontsets.
2616 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2617 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2618 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2619 Adjust users.
2620
2621 2012-08-20 Glenn Morris <rgm@gnu.org>
2622
2623 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2624 Don't assume that `ln -f' works.
2625
2626 2012-08-20 Eli Zaretskii <eliz@gnu.org>
2627
2628 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2629 and later about non-assignments with no effect. See discussion at
2630 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2631 details.
2632
2633 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2634
2635 Inline setter functions for Lisp_Objects slots of struct specbinding.
2636 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2637 Adjust users.
2638
2639 2012-08-20 Martin Rudalics <rudalics@gmx.at>
2640
2641 * window.c (select_window): Always make selected window's buffer
2642 current.
2643
2644 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2645
2646 Use AREF and ASET for docstrings of category tables.
2647 * category.h (CATEGORY_DOCSTRING): Use AREF.
2648 (SET_CATEGORY_DOCSTRING): Use ASET.
2649 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2650
2651 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2652
2653 Inline setter functions for hash table members.
2654 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2655 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2656 (set_hash_key_and_value, set_hash_index, set_hash_next)
2657 (set_hash_hash): New functions.
2658 * charset.c, fns.c: Adjust users.
2659
2660 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2661
2662 Inline getter and setter functions for per-buffer values.
2663 * buffer.h (per_buffer_default, set_per_buffer_default)
2664 (per_buffer_value, set_per_buffer_value): New functions.
2665 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2666 * buffer.c, data.c: Adjust users.
2667
2668 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
2669
2670 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2671
2672 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2673
2674 Rely on <config.h> + <unistd.h> to declare 'environ',
2675 as gnulib does this if the system doesn't.
2676 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2677 Remove declaration. MS-Windows declares it on stdlib.h which is
2678 included by conf_post.h.
2679 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2680 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2681 * vm-limit.c: Include <unistd.h>, for 'environ'.
2682
2683 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2684 (start_of_data): Remove decl; mem-limits.h provides it.
2685
2686 * xdisp.c (handle_invisible_prop): Make it a bit faster
2687 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2688
2689 2012-08-19 Chong Yidong <cyd@gnu.org>
2690
2691 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2692 ends (Bug#3874).
2693
2694 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2695
2696 * .gdbinit: Use call instead of set when calling a function in the
2697 inferior.
2698
2699 * data.c (set_internal): Don't use set_blv_found.
2700 (Fkill_local_variable): Likewise.
2701
2702 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2703
2704 * nsfont.m (ns_ascii_average_width): Ensure the string
2705 ascii_printable is initialized with a null-terminated character
2706 array. Otherwise, it can contain undesired extra characters.
2707
2708 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2709
2710 port new setting code to Sun C 5.8 2005/10/13
2711 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2712 Return void, not Lisp_Object. Otherwise, the compiler
2713 complains about (A?B:C) where B is void and C is Lisp_Object
2714 when compiling CHAR_TABLE_SET, due to the recent change to
2715 the API of sub_char_table_set_contents.
2716
2717 2012-08-18 Chong Yidong <cyd@gnu.org>
2718
2719 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2720 for the string case (Bug#3874).
2721
2722 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2723
2724 * buffer.h (BSET): Remove (Bug#12215).
2725 Replace all uses with calls to new setter functions.
2726 (bset_bidi_paragraph_direction, bset_case_canon_table)
2727 (bset_case_eqv_table, bset_directory, bset_display_count)
2728 (bset_display_time, bset_downcase_table)
2729 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2730 (bset_last_selected_window, bset_local_var_alist)
2731 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2732 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2733 (bset_width_table):
2734 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2735 (bset_auto_fill_function, bset_auto_save_file_format)
2736 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2737 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2738 (bset_cache_long_line_scans, bset_case_fold_search)
2739 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2740 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2741 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2742 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2743 (bset_header_line_format, bset_indicate_buffer_boundaries)
2744 (bset_indicate_empty_lines, bset_invisibility_spec)
2745 (bset_left_fringe_width, bset_major_mode, bset_mark)
2746 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2747 (bset_name, bset_overwrite_mode, bset_pt_marker)
2748 (bset_right_fringe_width, bset_save_length)
2749 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2750 (bset_scroll_up_aggressively, bset_selective_display)
2751 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2752 (bset_word_wrap, bset_zv_marker):
2753 * category.c (bset_category_table):
2754 * syntax.c (bset_syntax_table):
2755 New setter functions.
2756
2757 * process.h (PSET): Remove (Bug#12215).
2758 Replace all uses with calls to new setter functions.
2759 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2760 (PROCESS_INLINE): New macro.
2761 (pset_childp): New setter function.
2762 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2763 * process.c (PROCESS_INLINE):
2764 Define to EXTERN_INLINE, so that the corresponding functions
2765 are compiled into code.
2766 (pset_buffer, pset_command, pset_decode_coding_system)
2767 (pset_decoding_buf, pset_encode_coding_system)
2768 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2769 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2770 (pset_type, pset_write_queue): New setter functions.
2771
2772 * window.h (WSET): Remove (Bug#12215).
2773 Replace all uses with calls to new setter functions.
2774 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2775 (WINDOW_INLINE): New macro.
2776 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2777 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2778 (wset_total_lines, wset_vertical_scroll_bar)
2779 (wset_window_end_pos, wset_window_end_valid)
2780 (wset_window_end_vpos): New setter functions.
2781 * window.c (WINDOW_INLINE):
2782 Define to EXTERN_INLINE, so that the corresponding functions
2783 are compiled into code.
2784 (wset_combination_limit, wset_dedicated, wset_display_table)
2785 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2786 (wset_new_normal, wset_new_total, wset_next_buffers)
2787 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2788 (wset_prev_buffers, wset_right_fringe_width)
2789 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2790 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2791 (wset_window_parameters):
2792 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2793 (wset_column_number_displayed, wset_region_showing):
2794 New setter functions.
2795
2796 * termhooks.h (TSET): Remove (Bug#12215).
2797 Replace all uses with calls to new setter functions.
2798 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2799 (TERMHOOKS_INLINE): New macro.
2800 (tset_charset_list, tset_selection_alist): New setter functions.
2801 * terminal.c (TERMHOOKS_INLINE):
2802 Define to EXTERN_INLINE, so that the corresponding functions
2803 are compiled into code.
2804 (tset_param_alist): New setter function.
2805
2806 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2807
2808 * keyboard.h (KSET): Remove (Bug#12215).
2809 Replace all uses with calls to new setter functions.
2810 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2811 (KEYBOARD_INLINE): New macro.
2812 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2813 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2814 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2815 New setter functions.
2816 * keyboard.c (KEYBOARD_INLINE):
2817 Define to EXTERN_INLINE, so that the corresponding functions
2818 are compiled into code.
2819 (kset_echo_string, kset_kbd_queue)
2820 (kset_keyboard_translate_table, kset_last_prefix_arg)
2821 (kset_last_repeatable_command, kset_local_function_key_map)
2822 (kset_overriding_terminal_local_map, kset_real_last_command)
2823 (kset_system_key_syms): New setter functions.
2824
2825 * frame.h (FSET): Remove (Bug#12215).
2826 Replace all uses with calls to new setter functions.
2827 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2828 (FRAME_INLINE): New macro.
2829 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2830 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2831 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2832 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2833 (fset_param_alist, fset_root_window, fset_scroll_bars)
2834 (fset_selected_window, fset_title, fset_tool_bar_items)
2835 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2836 * frame.c (FRAME_INLINE):
2837 Define to EXTERN_INLINE, so that the corresponding functions
2838 are compiled into code.
2839 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2840
2841 A few more naming-convention fixes for getters and setters.
2842 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2843 and rename from buffer_overlays_set_before.
2844 (set_buffer_overlays_after): Move here from buffer.h, and rename
2845 from buffer_overlays_set_after.
2846 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2847 All uses changed.
2848 (set_buffer_intervals): Rename from buffer_set_intervals.
2849 * intervals.c (set_interval_object): Move here from intervals.h,
2850 and rename from interval_set_object.
2851 (set_interval_left): Move here from intervals.h, and rename from
2852 interval_set_left.
2853 (set_interval_right): Move here from intervals.h, and rename from
2854 interval_set_right.
2855 (copy_interval_parent): Move here from intervals.h, and rename from
2856 interval_copy_parent.
2857 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2858 (set_interval_plist): Rename from interval_set_plist.
2859 Return void, not Lisp_Object, since no caller uses the result.
2860 * lisp.h (string_intervals): Rename from string_get_intervals.
2861 (set_string_intervals): Rename from string_set_intervals.
2862
2863 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2864 (set_char_table_contents): Rename from char_table_set_contents.
2865 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2866 All uses changed. See the end of
2867 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2868
2869 * lisp.h (CSET): Remove (Bug#12215).
2870 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2871 (set_char_table_purpose): New functions,
2872 replacing CSET. All uses changed. For example, replace
2873 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2874 "set_char_table_parent (char_table, parent);".
2875 The old version was confusing because it used the same name
2876 'parent' for two different things.
2877
2878 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2879
2880 Functions to get and set Lisp_Object fields of buffer-local variables.
2881 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2882 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2883 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2884 * data.c, eval.c, frame.c: Adjust users.
2885
2886 2012-08-17 Chong Yidong <cyd@gnu.org>
2887
2888 * xfaces.c (merge_face_vectors): If the target font specfies a
2889 font spec, make the font's attributes take precedence over
2890 directly-specified attributes.
2891 (merge_face_ref): Recognize :font.
2892
2893 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2894
2895 Do not use memcpy for copying intervals.
2896 * intervals.c (reproduce_interval): New function.
2897 (reproduce_tree, reproduce_tree_obj): Use it.
2898 (reproduce_tree_obj): Remove prototype.
2899
2900 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2901
2902 * lisp.h (duration_to_sec_usec): Remove unused decl.
2903
2904 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2905
2906 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2907 to an allocated instance of NSString, not to the class itself.
2908
2909 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
2910
2911 * makefile.w32-in (C_CTYPE_H): New macro.
2912 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2913 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2914 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2915
2916 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2917
2918 Use ASCII tests for character types.
2919 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2920 * xfns.c, xterm.c:
2921 Don't include <ctype.h>; was not needed.
2922 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2923 * sysdep.c, xfaces.c:
2924 Include <c-ctype.h> instead of <ctype.h>.
2925 * nsterm.m: Include <c-ctype.h>.
2926 * charset.c (read_hex):
2927 * doc.c (Fsnarf_documentation):
2928 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2929 (DRIVE_LETTER) [DOS_NT]:
2930 (Ffile_name_directory, Fexpand_file_name)
2931 (Fsubstitute_in_file_name):
2932 * font.c (font_parse_xlfd, font_parse_fcname):
2933 * frame.c (x_set_font_backend):
2934 * gtkutil.c (xg_get_font):
2935 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2936 * nsimage.m (hexchar):
2937 * nsterm.m (ns_xlfd_to_fontname):
2938 * sysdep.c (system_process_attributes):
2939 * xfaces.c (hash_string_case_insensitive):
2940 Use C-locale tests instead of locale-specific tests for character
2941 types, since we want the ASCII interpretation here, not the
2942 interpretation suitable for whatever happens to be the current locale.
2943
2944 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2945
2946 Consistently check windows for validity/liveness
2947 (Bug#11984, Bug#12025, Bug#12026).
2948 * lisp.h (CHECK_VALID_WINDOW): New macro.
2949 * window.c (decode_window): Rename to decode_live_window.
2950 (decode_valid_window, Fwindow_valid_p): New functions.
2951 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2952 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2953 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2954 (Fwindow_prev_sibling, Fwindow_combination_limit)
2955 (Fset_window_combination_limit, Fwindow_use_time)
2956 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2957 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2958 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2959 (Fwindow_hscroll, Fset_window_hscroll)
2960 (Fwindow_redisplay_end_trigger)
2961 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2962 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2963 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2964 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2965 (Fwindow_end, Fset_window_point, Fset_window_start)
2966 (Fpos_visible_in_window_p, Fwindow_line_height)
2967 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2968 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2969 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2970 (Fset_window_parameter, Fwindow_display_table)
2971 (Fset_window_display_table, Fdelete_other_windows_internal)
2972 (Fset_window_buffer, Fset_window_new_total)
2973 (Fset_window_new_normal, Fdelete_window_internal)
2974 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2975 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2976 (Fwindow_scroll_bars): Check whether argument window is a valid or
2977 live window. Update doc-strings.
2978 (syms_of_window): New symbol Qwindow_valid_p.
2979 * keyboard.c (Fposn_at_x_y): Check whether argument
2980 frame_or_window denotes a valid window.
2981
2982 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2983
2984 Fix previous char table change.
2985 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2986 * chartab.c (optimize_sub_char_table): Likewise.
2987
2988 2012-08-16 Chong Yidong <cyd@gnu.org>
2989
2990 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2991
2992 * xfont.c (xfont_open):
2993 * xftfont.c (xftfont_open): Set the font's max_width field.
2994
2995 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2996 min_width to space_width and average_width to the average over
2997 printable ASCII characters.
2998 (ns_char_width): Code cleanup.
2999 (ns_ascii_average_width): New utility function.
3000
3001 * font.h (struct font): Update comments.
3002
3003 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3004
3005 Simple interface to set Lisp_Object fields of character tables.
3006 * lisp.h (CSET): New macro.
3007 (char_table_set_extras, char_table_set_contents)
3008 (sub_char_table_set_contents): New function.
3009 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3010 * syntax.c: Adjust users.
3011
3012 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3013
3014 * eval.c (eval_sub): Bind lexical-binding.
3015 * lread.c (Qlexical_binding): Make non-static.
3016
3017 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3018
3019 * nsmenu.m (popupSession): Remove.
3020 (pop_down_menu): Remove endModalSession.
3021 (timeout_handler:): New method.
3022 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3023 Call runModalForWindow. Check timer_fired when it returns.
3024 If not set, cancel timer and break out of loop.
3025 Otherwise loop again, with a new timeout.
3026
3027 * nsterm.m: Include fcntl.h if present.
3028 (fd_entry, t_readfds, inNsSelect): Remove.
3029 (select_writefds, select_valid, select_timeout, selfds)
3030 (select_mutex, apploopnr): Add.
3031 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3032 Otherwise call kbd_buffer_store_event.
3033 (ns_send_appdefined): Remove release of fd_entry.
3034 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3035 Increment and decrement apploopnr.
3036 (ns_select): If no file descriptors, just do a NSTimer.
3037 Otherwise copy read/write masks and start select thread (fd_handler).
3038 Start main loop and wait for application defined event.
3039 Inform select thread to stop selecting after main loop is exited.
3040 (ns_term_init): Create selfds pipe and set non-blocking.
3041 Initialize select_mutex. Start the select thread (fd_handler).
3042 (fd_handler:): Loop forever, wait for info from the main thread
3043 to either start or stop selecting. When select returns, send
3044 and appdefined event.
3045 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3046 If not call kbd_buffer_store_event.
3047
3048 * nsterm.h (EmacsApp): fd_handler takes id argument.
3049 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3050
3051 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3052
3053 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3054
3055 * region-cache.c (move_cache_gap): Update gap_len using the actual
3056 growth of the boundaries array. Do not change cache_len.
3057 (Bug#12196)
3058
3059 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3060
3061 Generalize and cleanup font subsystem checks.
3062 * font.h (FONT_DEBUG, font_assert): Remove.
3063 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3064 Change font_assert to eassert. Use eassert where appropriate.
3065
3066 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3067
3068 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3069
3070 2012-08-15 Chong Yidong <cyd@gnu.org>
3071
3072 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3073 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3074 extract the font descriptor instead of just the font name.
3075 In that case, return a font spec instead of a string.
3076 (x_last_font_name): Move to this file from xfns.c.
3077
3078 * xfns.c (Fx_select_font): The return value can also be a font
3079 spec. Move x_last_font_name management to gtkutil.c.
3080
3081 * xfaces.c: Make font weight and style symbols non-static.
3082
3083 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3084
3085 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3086 (bug#12117).
3087
3088 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3089
3090 * alloc.c (Fgarbage_collect): Use plural form consistently.
3091
3092 2012-08-14 Eli Zaretskii <eliz@gnu.org>
3093
3094 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3095 iteration through the command loop. Fixes a problem whereby mouse
3096 movements are ignored until the first mouse click.
3097
3098 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3099
3100 Use bool, not int, for Lisp booleans.
3101 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3102 makes Emacs a bit smaller and presumably a bit faster.
3103 * lisp.h: Include <stdbool.h>.
3104 (struct Lisp_Boolfwd, defvar_bool):
3105 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3106 * regex.c [!emacs]: Include <stdbool.h>.
3107 (false, true): Remove; <stdbool.h> does this for us now.
3108
3109 2012-08-14 Chong Yidong <cyd@gnu.org>
3110
3111 * character.c (Fcharacterp): Doc fix (Bug#12076).
3112
3113 * data.c (Findirect_variable): Doc fix (Bug#11040).
3114
3115 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3116
3117 * editfns.c (Fformat): Doc fix (Bug#12059).
3118 (Fsave_current_buffer): Doc fix (Bug#11542).
3119
3120 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3121
3122 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3123 (bug#12022).
3124
3125 2012-08-14 Martin Rudalics <rudalics@gmx.at>
3126
3127 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3128 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3129 * minibuf.c (choose_minibuf_frame, read_minibuf):
3130 * w32fns.c (x_create_tip_frame):
3131 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3132 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3133
3134 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3135
3136 * intervals.c (offset_intervals): Remove obsolete comment.
3137
3138 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3139
3140 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3141
3142 2012-08-14 Gergely Risko <gergely@risko.hu>
3143
3144 * coding.c (decode_coding): Record buffer modification before
3145 disabling undo_list (Bug#11773).
3146
3147 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3148
3149 Revert and cleanup some recent overlay changes.
3150 * buffer.h (enum overlay_type): Remove.
3151 (buffer_get_overlays, buffer_set_overlays): Likewise.
3152 (buffer_set_overlays_before, buffer_set_overlays_after):
3153 New function. Adjust users.
3154 (unchain_both): Add eassert.
3155
3156 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3157
3158 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3159
3160 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3161
3162 * gtkutil.c (xg_mark_data): Don't assume C99.
3163
3164 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3165
3166 * gtkutil.c (xg_frame_tb_info): New struct.
3167 (TB_INFO_KEY): New define.
3168 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3169 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3170 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3171 if not present.
3172 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3173 is up to date. Otherwise store new data.
3174 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3175
3176 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3177
3178 Use KSET for write access to Lisp_Object members of struct kboard.
3179 * keyboard.h (KSET): New macro.
3180 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3181 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3182 * xterm.c: Adjust users.
3183
3184 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3185
3186 Use BSET for write access to Lisp_Object members of struct buffer.
3187 * buffer.h (BSET): New macro.
3188 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3189 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3190 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3191 * window.c, xdisp.c, xfns.c: Adjust users.
3192
3193 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3194
3195 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3196
3197 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3198
3199 * nsterm.m (not_in_argv): New function.
3200 (application:openFile, application:openTempFile:):
3201 (application:openFileWithoutUI:, application:openFiles:): Open file
3202 if not_in_argv returns non-zero (bug#12171).
3203
3204 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3205 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3206 Define for Gtk+ versions less than 3.2.
3207 (xg_get_font_name): Use those functions/macros here.
3208 Reported by Frans Oilinki <moilinki@gmail.com>.
3209
3210 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3211
3212 * unexmacosx.c (copy_data_segment): Copy initialized data in
3213 statically linked libraries from input file rather than memory.
3214
3215 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3216 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3217 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3218
3219 2012-08-10 Glenn Morris <rgm@gnu.org>
3220
3221 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3222 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3223
3224 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3225
3226 Fix last change to allow compilation with low optimization levels.
3227 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3228 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3229
3230 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3231
3232 Use common inline syntax in intervals.h.
3233 * intervals.h (INTERVALS_INLINE): New macro.
3234 Change all users from LISP_INLINE.
3235
3236 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3237
3238 Define Qnone once for all platforms.
3239 * frame.c (Qnone): Define here.
3240 (syms_of_frame): DEFSYM it.
3241 * lisp.h (Qnone): New declaration.
3242 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3243 * xfns.c: Remove duplication. Adjust users.
3244
3245 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3246
3247 Remove unused macros from intervals.h.
3248 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3249 * intervals.c: Adjust comment.
3250
3251 2012-08-10 Eli Zaretskii <eliz@gnu.org>
3252
3253 * w32fns.c <w32_unicode_gui>: New static variable.
3254 (globals_of_w32fns): Initialize it according to os_subtype.
3255 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3256 testing os_subtype.
3257
3258 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
3259 Eli Zaretskii <eliz@gnu.org>
3260
3261 Fix bug #10299 with Unicode characters sent by customized
3262 keyboards created by MSKLC.
3263 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3264 (w32_init_class): Use it to initialize the Emacs class with either
3265 ANSI or Unicode API calls.
3266 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3267 later.
3268 (w32_wnd_proc): If the character code sent by WM_CHAR or
3269 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3270 original message. Call DefWindowProcW on NT and later.
3271
3272 2012-08-10 Glenn Morris <rgm@gnu.org>
3273
3274 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3275
3276 * lisp.h (DIRECTORY_SEP): Let configure set it.
3277
3278 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3279
3280 Use TSET for write access to Lisp_Object slots of struct terminal.
3281 * termhooks.h (TSET): New macro.
3282 * coding.c, terminal.c, xselect.c: Adjust users.
3283
3284 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3285
3286 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3287 the failing expression, include them in the error message.
3288 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3289 * lisp.h (internal_condition_case_n): Update declaration.
3290
3291 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3292
3293 Inline functions to examine and change buffer overlays.
3294 * buffer.c (unchain_both): New function.
3295 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3296 (buffer_has_overlays): New function.
3297 (enum overlay_type): New enum.
3298 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3299 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3300
3301 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3302
3303 Inline functions to examine and change buffer intervals.
3304 * alloc.c (mark_interval_tree): Remove.
3305 (MARK_INTERVAL_TREE): Simplify.
3306 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3307 * intervals.c (buffer_balance_intervals): New function.
3308 (graft_intervals_into_buffer): Adjust indentation.
3309 (set_intervals_multibyte): Simplify.
3310 * buffer.h (BUF_INTERVALS): Remove.
3311 (buffer_get_intervals, buffer_set_intervals): New function.
3312 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3313 * intervals.c, textprop.c: Adjust users.
3314
3315 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3316
3317 Inline functions to examine and change string intervals.
3318 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3319 (string_get_intervals, string_set_intervals): New function.
3320 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3321 * lread.c, print.c, textprop.c: Adjust users.
3322
3323 2012-08-08 Glenn Morris <rgm@gnu.org>
3324
3325 * lisp.mk (lisp): Remove language/persian.elc.
3326
3327 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3328
3329 Cleanup intervals.
3330 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3331 (NULL_INTERVAL_P): Likewise. Adjust users.
3332 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3333 Adjust comment. Move under #if 0.
3334 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3335 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3336
3337 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3338
3339 Check total length of intervals with eassert.
3340 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3341 * intervals.c: Change all users to eassert.
3342
3343 2012-08-07 Eli Zaretskii <eliz@gnu.org>
3344
3345 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3346 Rename fields to match removal of FGET and WGET and disuse of
3347 INTERNAL_FIELD in Lisp_Cons.
3348
3349 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3350
3351 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3352 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3353 name since all xname users are fixed long time ago. Do not
3354 use INTERNAL_FIELD.
3355 (set_symbol_name, set_symbol_function, set_symbol_plist):
3356 (set_symbol_next, set_overlay_plist): New function.
3357 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3358 (struct Lisp_Overlay): Likewise.
3359 (CVAR, MVAR, SVAR): Remove.
3360 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3361 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3362 * xterm.c: Adjust users.
3363 * .gdbinit: Change to use name field of struct Lisp_Symbol
3364 where appropriate.
3365
3366 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3367
3368 Basic functions to set Lisp_Object and pointer slots of intervals.
3369 * intervals.h (interval_set_parent, interval_set_object):
3370 (interval_set_left, interval_set_right, interval_set_plist):
3371 (interval_copy_parent): New function.
3372 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
3373 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3374 Adjust indentation.
3375 (INTERVAL_SIZE): Remove. Adjust users.
3376 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3377
3378 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3379
3380 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3381 * process.h (PGET): Remove.
3382 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3383 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3384
3385 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3386
3387 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3388 * window.h (WGET): Remove.
3389 (struct window): Do not use INTERNAL_FIELD.
3390 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3391 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3392 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3393 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3394 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3395 Adjust users.
3396
3397 2012-08-07 Chong Yidong <cyd@gnu.org>
3398
3399 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3400 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3401 (Fdelete_window_internal): Signal an error if the window is not on
3402 a live frame (Bug#12025).
3403
3404 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3405
3406 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3407 * frame.h (FGET): Remove.
3408 (struct frame): Do not use INTERNAL_FIELD.
3409 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3410 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3411 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3412 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3413
3414 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
3415
3416 * w32.c: Silence compiler warnings.
3417 (map_w32_filename): Remove unused variable `is_fat'.
3418 (chase_symlinks): Add parentheses around expression.
3419
3420 2012-08-06 Glenn Morris <rgm@gnu.org>
3421
3422 * sysdep.c: Respect BROKEN_GETWD.
3423
3424 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3425 Let configure handle it.
3426 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3427
3428 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3429
3430 Use GCALIGNMENT where appropriate.
3431 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3432 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3433 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3434
3435 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3436
3437 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3438 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3439
3440 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3441
3442 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3443 that should be sufficient for everyone.
3444
3445 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3446
3447 * keyboard.c (timer_check_2): Add break so timer_check returns next
3448 timeout.
3449
3450 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3451
3452 Fix Windows build errors introduced after converting to WGET and WSET.
3453 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3454 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3455
3456 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3457
3458 * nsterm.m (ns_frame_rehighlight): Use FSET.
3459
3460 * nsmenu.m (ns_update_menubar): Use FSET.
3461
3462 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3463
3464 Separate read and write access to Lisp_Object slots of Lisp_Process.
3465 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3466 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3467
3468 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3469
3470 Separate read and write access to Lisp_Object slots of struct window.
3471 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3472 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3473 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3474 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3475 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3476 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3477 Adjust users.
3478
3479 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3480
3481 Fix Windows build errors introduced after converting to FGET and FSET.
3482 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3483 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3484 (w32_judge_scroll_bars): Change to use FSET.
3485 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3486
3487 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3488
3489 Fix replacement typo.
3490 * window.c (replace_window): Set root_window instead of
3491 selected_window. This fixes a total window subsystem
3492 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3493
3494 2012-08-06 Glenn Morris <rgm@gnu.org>
3495
3496 * lisp.mk (lisp): Add language/persian.elc.
3497
3498 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3499
3500 Separate read and write access to Lisp_Object slots of struct frame.
3501 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3502 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3503 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3504 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3505 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3506
3507 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3508
3509 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3510
3511 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3512
3513 Generalize common compile-time constants.
3514 * lisp.h (header_size, bool_header_size, word_size): Now here.
3515 (struct Lisp_Vector): Add comment.
3516 (struct Lisp_Bool_Vector): Move up to define handy constants.
3517 (VECSIZE, PSEUDOVECSIZE): Simplify.
3518 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3519 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3520 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3521 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3522 * xfont.c, xmenu.c: Use word_size where appropriate.
3523
3524 2012-08-05 Lawrence Mitchell <wence@gmx.li>
3525
3526 * search.c (Freplace_match): Treat \? in the replacement text
3527 literally (Bug#8161).
3528
3529 2012-08-05 Chong Yidong <cyd@gnu.org>
3530
3531 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3532 * frame.c (Vdelete_frame_functions):
3533 * emacs.c (Vkill_emacs_hook): Doc fix.
3534
3535 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3536
3537 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3538 --with-x-toolkit=no builds.
3539 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3540
3541 2012-08-04 Chong Yidong <cyd@gnu.org>
3542
3543 * syntax.c (Fmodify_syntax_entry): Doc fix.
3544
3545 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3546
3547 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3548 * w32.c (init_environment): Change the default values of many
3549 environment variables in dflt_envvars[] to NULL, to avoid pushing
3550 them into environment when they were not already defined.
3551 Remove the code that deletes site-lisp subdirectories from the default
3552 value of EMACSLOADPATH, as it is no longer needed.
3553 (check_windows_init_file): Now external, not static.
3554 Use Vload_path as is, without adding anything, as this function is now
3555 called when Vload_path is already set up.
3556
3557 * w32.h (check_windows_init_file): Add prototype.
3558
3559 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3560 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3561 compatibility with Posix platforms.
3562 (main): Move the call to check_windows_init_file to here from
3563 w32.c.
3564 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3565 any, in the DEFALT argument into the root of the Emacs build or
3566 installation tree, as appropriate.
3567
3568 * callproc.c (init_callproc_1): Call decode_env_path instead of
3569 doing its equivalent by hand.
3570 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3571 the code that sets Vexec_path run on MS-Windows.
3572
3573 * lread.c (init_lread): Add comments to #ifdef's.
3574
3575 * msdos.c (dos_set_window_size, IT_update_begin)
3576 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3577 instead of direct references.
3578
3579 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3580
3581 Export DEFAULT_REHASH_* to GDB.
3582 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3583 Now constants, not macros.
3584
3585 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 Remove unnecessary casts involving pointers.
3588 These casts are no longer needed now that we assume C89 or later,
3589 since they involve casting to or from void *.
3590 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3591 (make_pure_float, make_pure_vector):
3592 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3593 * macros.c (Fstart_kbd_macro):
3594 * menu.c (find_and_return_menu_selection):
3595 * minibuf.c (read_minibuf_noninteractive):
3596 * sysdep.c (closedir):
3597 * xdisp.c (x_produce_glyphs):
3598 * xfaces.c (compare_fonts_by_sort_order):
3599 * xfns.c (x_real_positions, select_visual):
3600 * xselect.c (x_stop_queuing_selection_requests)
3601 (x_get_window_property, x_get_window_property_as_lisp_data):
3602 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3603 Remove unnecessary pointer casts.
3604 * alloc.c (record_xmalloc): New function.
3605 * lisp.h (record_xmalloc): New decl.
3606 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3607 more like a function. This is because the pointer cast is not
3608 needed. All uses changed.
3609 * print.c (print_string, print_error_message): Avoid length recalc.
3610
3611 Improve fix for macroexp crash with debugging (Bug#12118).
3612 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3613 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3614 not supposed to be invoked from the garbage collector.
3615 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3616 (gc_aset): New function, which is like ASET but can be
3617 used in the garbage collector.
3618 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3619 (set_hash_index): Use it instead of ASET.
3620
3621 2012-08-03 Eli Zaretskii <eliz@gnu.org>
3622
3623 Support symlinks on latest versions of MS-Windows.
3624 * w32.c: Include winioctl.h and aclapi.h.
3625 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3626 (revert_to_self): Forward declarations of static functions.
3627 <static BOOL g_b_init_get_security_info>:
3628 <g_b_init_create_symbolic_link>: New static flags.
3629 (globals_of_w32): Initialize them to zero.
3630 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3631 (map_w32_filename): Improve commentary. Simplify switch.
3632 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3633 headers (most versions of MinGW w32api don't).
3634 (get_security_info, create_symbolic_link)
3635 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3636 New functions.
3637 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3638 in the argument file name.
3639 (sys_access): Call unc_volume_file_attributes only if
3640 GetFileAttributes fails with network-related error codes.
3641 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3642 have the required privileges.
3643 (get_file_security_desc_by_name): Rename from
3644 get_file_security_desc.
3645 (stat_worker): New function, with most of the guts of 'stat', and
3646 with addition of handling of symlinks and support for 'lstat'.
3647 If possible, get file's attributes and security information by
3648 handle, not by name. Produce S_IFLNK bit for symlinks, when
3649 called from 'lstat'.
3650 (stat, lstat): New functions, call 'stat_worker'.
3651 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3652 symlinks when the underlying filesystem supports them.
3653
3654 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3655
3656 Fix macroexp crash on Windows with debugging (Bug#12118).
3657 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3658 checking subscripts; problem introduced with the recent
3659 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3660 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3661 since it's used in non-static inline functions now.
3662
3663 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3664 Don't assume buffer size fits in 'int'. Remove unused local.
3665
3666 Use C99-style 'extern inline' if available.
3667 * buffer.h (BUFFER_INLINE):
3668 * category.h (CATEGORY_INLINE):
3669 * character.h (CHARACTER_INLINE):
3670 * charset.h (CHARSET_INLINE):
3671 * composite.h (COMPOSITE_INLINE):
3672 * dispextern.h (DISPEXTERN_INLINE):
3673 * lisp.h (LISP_INLINE):
3674 * systime.h (SYSTIME_INLINE):
3675 New macro, replacing 'static inline' in this header.
3676 * buffer.h, category.h, character.h, charset.h, composite.h:
3677 * dispextern.h, lisp.h, systime.h:
3678 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3679 * alloc.c (LISP_INLINE):
3680 * buffer.c (BUFFER_INLINE):
3681 * category.c (CATEGORY_INLINE):
3682 * character.c (CHARACTER_INLINE):
3683 * charset.c (CHARSET_INLINE):
3684 * composite.c (COMPOSITE_INLINE):
3685 * dispnew.c (DISPEXTERN_INLINE):
3686 * sysdep.c (SYSTIME_INLINE):
3687 Define to EXTERN_INLINE, so that the corresponding functions
3688 are compiled into code.
3689 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3690 (INLINE_HEADER_END): New macros.
3691 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3692 since it's used in non-static inline functions now.
3693 (VALMASK) [!USE_LSB_TAG]: Likewise.
3694
3695 2012-08-02 Glenn Morris <rgm@gnu.org>
3696
3697 * s/: Remove empty directory.
3698
3699 * s/ms-w32.h: Move to ../nt/inc.
3700 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3701 Update for new ms-w32.h location.
3702
3703 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3704
3705 Port to Solaris 8.
3706 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3707
3708 2012-08-02 Glenn Morris <rgm@gnu.org>
3709
3710 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3711 hard-coding the path separator.
3712
3713 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3714
3715 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3716 This how ASET and AREF are supposed to work, and makes
3717 it easier to think about future improvements. See
3718 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3719 * charset.h (set_charset_attr): New function.
3720 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3721 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3722 (aref_addr): New function. All uses of &AREF(...) changed.
3723 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3724 (set_hash_index): New functions. All lvalue-style uses of
3725 HASH_KEY etc. changed.
3726 * keyboard.c (set_prop): New function. All lvalue-style uses
3727 of PROP changed.
3728
3729 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3730
3731 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3732 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3733 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3734 * nsfns.m (ns_set_name_as_filename): Likewise.
3735 * nsmenu.m (ns_update_menubar): Likewise.
3736 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3737
3738 2012-08-01 Eli Zaretskii <eliz@gnu.org>
3739
3740 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3741 Adapt to latest changes in field names of the corresponding Lisp
3742 objects.
3743
3744 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3745
3746 2012-08-01 Glenn Morris <rgm@gnu.org>
3747
3748 * s/msdos.h: Remove file.
3749 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3750 * Makefile.in (S_FILE): Remove.
3751 (config_h): Remove S_FILE.
3752
3753 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3754
3755 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3756 Remove; moved to nt/config.nt.
3757
3758 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3759
3760 Use INTERNAL_FIELD for conses and overlays.
3761 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3762 Remove obsolete comment.
3763 (MVAR): New macro.
3764 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3765 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3766
3767 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3768
3769 Use INTERNAL_FIELD for symbols.
3770 * lisp.h (SVAR): New macro. Adjust users.
3771 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3772 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3773
3774 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3775
3776 Use INTERNAL_FIELD for processes.
3777 * process.h (PVAR): New macro. Adjust style.
3778 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3779 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3780
3781 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3782
3783 Use INTERNAL_FIELD for windows.
3784 * window.h (WVAR): New macro.
3785 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3786 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3787 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3788 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3789 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3790 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3791
3792 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3793
3794 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3795
3796 2012-08-01 Glenn Morris <rgm@gnu.org>
3797
3798 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3799 Move to configure.ac.
3800
3801 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3802
3803 * makefile.w32-in (CONFIG_H): Update dependencies.
3804 (CONF_POST_H): New macro.
3805
3806 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3807
3808 2012-07-31 Glenn Morris <rgm@gnu.org>
3809
3810 * Makefile.in (S_FILE): No longer set by configure.
3811
3812 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3813 is available.
3814 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3815
3816 * process.h (NULL_DEVICE):
3817 * emacs.c (SEPCHAR):
3818 * editfns.c (USER_FULL_NAME): Let configure set them.
3819
3820 * s/README, s/template.h: Remove files.
3821
3822 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3823
3824 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3825 Move to configure.ac.
3826
3827 2012-07-31 Eli Zaretskii <eliz@gnu.org>
3828
3829 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3830 resulting renaming of 'struct frame' members.
3831
3832 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3833
3834 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3835 after introduction of FVAR.
3836
3837 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3838
3839 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3840
3841 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3842 instead of compositeToPoint.
3843 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3844
3845 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3846
3847 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3848
3849 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3850 * lisp.h (INTERNAL_FIELD): New macro.
3851 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3852 (BVAR): Change to use INTERNAL_FIELD.
3853 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3854 (KVAR): Change to use INTERNAL_FIELD.
3855 * frame.h (FVAR): New macro.
3856 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3857 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3858 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3859 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3860 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3861
3862 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3863
3864 Miscellaneous fixes for non-default X toolkits.
3865 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3866 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3867 Move under #ifdef USE_LUCID.
3868 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3869 definition and usage to avoid warnings.
3870
3871 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3872
3873 * nsterm.m (openFiles): Fix previous checkin.
3874
3875 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3876
3877 * indent.c (compute_motion): Remove unused local.
3878
3879 2012-07-31 Glenn Morris <rgm@gnu.org>
3880
3881 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3882
3883 * conf_post.h [USG5_4]:
3884 Move remaining contents of s/usg5-4-common.h here.
3885 * s/usg5-4-common.h: Remove file.
3886
3887 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3888 * s/irix6-5.h: Remove file.
3889
3890 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3891 * s/darwin.h: Remove file.
3892
3893 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3894 * s/hpux10-20.h: Remove file, which is now empty.
3895
3896 2012-07-30 Glenn Morris <rgm@gnu.org>
3897
3898 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3899 * Makefile.in (config_h): Add conf_post.h.
3900 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3901
3902 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3903
3904 * nsterm.m (ns_do_open_file): New variable.
3905 (ns_term_init): Set ns_do_open_file to YES after run returns.
3906 (openFile, openTempFile, openFileWithoutUI, openFiles):
3907 Open files only if ns_do_open_file.
3908
3909 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3910
3911 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3912 This no-op macro hasn't been needed for many years.
3913 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3914
3915 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3916 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3917 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3918 gdb_make_enums_visible.
3919 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3920 (DIRECTORY_SEP): Now a constant, not a macro.
3921
3922 2012-07-30 Eli Zaretskii <eliz@gnu.org>
3923
3924 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3925 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3926
3927 * w32term.c <w32_keyboard_codepage>: Renamed from
3928 keyboard_codepage and now external. All users changed.
3929
3930 * w32term.h: Add declaration of w32_keyboard_codepage.
3931
3932 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3933 the codepage to translate keys to Unicode. If this argument is
3934 -1, use the value returned by GetConsoleCP. All callers changed.
3935
3936 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3937
3938 Update .PHONY listings in makefiles.
3939 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3940 bootstrap-clean, distclean, maintainer-clean, versioclean,
3941 extraclean, frc.
3942
3943 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3944 This is a bit clearer. Fix some commentary typos.
3945
3946 2012-07-30 Glenn Morris <rgm@gnu.org>
3947
3948 * s/netbsd.h: Let configure include signal.h if needed.
3949 Remove file, which is now empty.
3950
3951 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3952 Let configure set them.
3953 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3954 No more need to undefine.
3955
3956 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3957
3958 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3959 non-single-byte char when adding meta modifier. (Bug#12090)
3960
3961 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3962
3963 Convert safe_call to use variable number of arguments.
3964 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3965 (safe_call2): Fix comment.
3966 * lisp.h (safe_call): Adjust prototype.
3967 * coding.c (encode_coding_object): Change to use safe_call2.
3968 * xfaces.c (merge_face_heights): Change to use safe_call1.
3969
3970 2012-07-30 Glenn Morris <rgm@gnu.org>
3971
3972 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3973 does that unconditionally. Remove file, which is now empty.
3974
3975 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3976 Remove empty files.
3977
3978 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3979
3980 Export to GDB most of lisp.h's remaining object-like macros.
3981 * lisp.h (min, max): Move earlier, because they're used earlier now.
3982 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3983 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3984 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3985 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3986 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3987 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3988 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3989 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3990 Now constants, for GDB. They need not be macros.
3991 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3992 Now constants, for GDB, as well as macros, for static initializers.
3993 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3994 Move to after the definition of struct Lisp_Char_Table,
3995 since the former now needs that type defined.
3996 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3997 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3998 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3999 New enums, for gdb_make_enums_visible.
4000 (GLYPH_MODE_LINE_FACE): Remove; unused.
4001 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4002 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4003 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4004 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4005 enum maxargs, enum MAX_ALLOCA.
4006 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4007 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4008 no longer needed, now that they are done in lisp.h.
4009
4010 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4011
4012 Cleanup string bytes checking.
4013 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4014 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4015 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4016 (check_sblock, compact_small_strings): Simplify.
4017
4018 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4019
4020 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4021 These macros are confusing and no longer need to be defined, as
4022 the enum values now suffice. All uses replaced with definiens.
4023 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4024
4025 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4026
4027 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4028 ($(BLD)/w32console.$(O)): Update dependencies.
4029
4030 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4031
4032 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4033 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4034 time. Adjust users.
4035 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4036
4037 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4038
4039 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4040 setting sitelisp (Bug#12010).
4041
4042 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4043
4044 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4045
4046 * w32heap.c (cache_system_info):
4047 * w32.c (sys_rename):
4048 * w32proc.c (find_child_console, sys_kill): All users changed.
4049
4050 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4051
4052 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4053
4054 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4055
4056 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4057
4058 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4059
4060 Cleanup statistics calculation in Fgarbage_collect.
4061 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4062 Fix zombies percentage calculation. Simplify elapsed time calculation.
4063
4064 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4065
4066 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4067 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4068 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4069 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4070 (replace_range, replace_range_2, del_range_2): Change to eassert.
4071 * marker.c (byte_char_debug_check): Adjust style.
4072
4073 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4074
4075 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4076 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4077 long-ago-commented-out code that talks about "WIN32".
4078 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4079 All uses changed.
4080
4081 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4082
4083 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4084 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4085 Simplify by using alignof.
4086 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4087 * lisp.h: Include <stdalign.h>.
4088 (GCALIGNMENT): New macro and constant.
4089 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4090 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4091 (stdalign): New macro, if not already defined.
4092
4093 2012-07-28 Eli Zaretskii <eliz@gnu.org>
4094
4095 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4096 * w32inevt.c: Include w32inevt.h.
4097 (w32_read_console_input): New inline function, calls either
4098 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4099 w32_console_unicode_input.
4100 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4101 (w32_kbd_patch_key, key_event): Use the codepage returned by
4102 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4103 (key_event): use uChar.UnicodeChar only if
4104 w32_console_unicode_input is non-zero.
4105
4106 * w32console.c: Include w32heap.h.
4107 <w32_console_unicode_input>: New global variable.
4108 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4109 family of Windows, zero otherwise.
4110
4111 * w32inevt.h: Declare w32_console_unicode_input.
4112
4113 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4114 --without-x. (Bug#11742)
4115
4116 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4117
4118 Adjust GDB to reflect pvec_type changes (Bug#12036).
4119 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4120 2012-07-04 changes to pseudovector representation.
4121 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4122
4123 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
4124
4125 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4126 bus address.
4127 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4128
4129 2012-07-27 Eli Zaretskii <eliz@gnu.org>
4130
4131 * alloc.c (listn): Fix the order the arguments are consed onto the
4132 list.
4133
4134 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4135 enumeration constants, as PURE and HEAP are too general, and clash
4136 with other headers and sources, such as gmalloc.c and the
4137 MS-Windows system headers. All users changed.
4138
4139 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4140
4141 Revert last save_excursion_save and save_excursion_restore changes.
4142 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4143 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4144
4145 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4146
4147 Fix recently-introduced typos in Windows port.
4148 Reported by Martin Rudalics <rudalics@gmx.at>.
4149 * w32.c (init_environment): Replace comma with semicolon.
4150 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4151
4152 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4153
4154 Improve GDB symbol export (Bug#12036).
4155 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4156 arms of an 'if', not using conditional expressions; otherwise GDB
4157 complains about the types in the unevaluated arm when the argument
4158 is an integer literal.
4159 (xgetint): Simplify expression.
4160 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4161 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4162 Zaretskii in <http://bugs.gnu.org/12036#13>.
4163 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4164 needed now that we have gdb_make_enums_visible.
4165 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4166 (enum enum_USE_LSB_TAG):
4167 New enum types, packaging up enums that need to be exported to GDB.
4168
4169 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4170
4171 Utility function to make a list from specified amount of objects.
4172 * lisp.h (enum constype): New datatype.
4173 (listn): New prototype.
4174 * alloc.c (listn): New function.
4175 (Fmemory_use_count, syms_of_alloc): Use it.
4176 * buffer.c (syms_of_buffer): Likewise.
4177 * callint.c (syms_of_callint): Likewise.
4178 * charset.c (define_charset_internal): Likewise.
4179 * coding.c (syms_of_coding): Likewise.
4180 * keymap.c (syms_of_keymap): Likewise.
4181 * search.c (syms_of_search): Likewise.
4182 * syntax.c (syms_of_syntax): Likewise.
4183 * w32.c (init_environment): Likewise.
4184 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4185 * xdisp.c (syms_of_xdisp): Likewise.
4186 * xfns.c (syms_of_xfns): Likewise.
4187
4188 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4189
4190 Fast save_excursion_save and save_excursion_restore.
4191 * lisp.h (struct Lisp_Excursion): New data type.
4192 (PVEC_EXCURSION): New pseudovector type.
4193 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4194 to deal with it. Adjust comments.
4195 (init_marker, attach_marker): New prototype.
4196 (unchain_marker): Adjust prototype.
4197 * marker.c (attach_marker): Change to global.
4198 (init_marker): New function.
4199 * alloc.c (Fmake_marker, build_marker): Use it.
4200 (build_marker): More easserts.
4201 (mark_object): Handle struct Lisp_Excursion.
4202 * editfns.c (save_excursion_save, save_excursion_restore):
4203 Reimplement to use struct Lisp_Excursion. Add comments.
4204
4205 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4206
4207 Fix export of symbols to GDB (Bug#12036).
4208 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4209 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4210 emacs.c, as this is a more-suitable home. Had this been done earlier
4211 the fix for 12036 would have avoided some of the problems noted in
4212 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4213 would have been more obvious.
4214 * emacs.c: Do not include <verify.h>; no longer needed.
4215 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4216 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4217 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4218 Remove; now done in lisp.h.
4219 * lisp.h (PUBLISH_TO_GDB): New macro.
4220 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4221 (DATA_SEG_BITS): Use it.
4222 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4223 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4224 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4225 not be usable in #if. This simplifies things.
4226
4227 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
4228
4229 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4230
4231 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4232
4233 Simplify export of symbols to GDB (Bug#12036).
4234 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4235 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4236 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4237 Adjust to changes in lisp.h and emacs.c, by using
4238 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4239 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4240 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4241 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4242 instead of gdb_valbits.
4243 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4244 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4245 instead of gdb_array_mark_flag.
4246 (xboolvector): Get size from $->size, not $->header.size.
4247 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4248 (xreload, hook-run, hookpost-run): Remove.
4249 * emacs.c: Include <verify.h>.
4250 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4251 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4252 Remove.
4253 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4254 (gdb_USE_LSB_TAG): New enum constants.
4255 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4256 Also define these as enum constants, so they're visible to GDB.
4257 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4258 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4259 as constants, so they're visible to GDB.
4260 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4261 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4262 Now enum constants, not macros, so they're visible to GDB.
4263 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4264 more convenient now. All uses changed.
4265 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4266 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4267
4268 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4269
4270 Explicitly free restriction data that are not needed anymore.
4271 * editfns.c (save_restriction_restore): Free restriction data.
4272
4273 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4274
4275 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4276 add argument, tune behavior, and adjust all callers.
4277
4278 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4279
4280 Use typedef for EMACS_INT, EMACS_UINT.
4281 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4282 than macros. This simplifies debugging in the usual case, since
4283 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4284 and it allows expressions involving EMACS_INT casts.
4285 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4286
4287 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4288
4289 * nsterm.m (ns_read_socket): Return early if there is a modal
4290 window (Bug#12043).
4291
4292 2012-07-25 Martin Rudalics <rudalics@gmx.at>
4293
4294 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4295 that FOCUS-FRAME can be omitted.
4296
4297 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4298
4299 Adjust buffer text indirection counters at the end of Fkill_buffer.
4300 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4301 buffer is definitely dead. This should really fix an issue reported
4302 by Christoph Scholtes again. (Bug#12007).
4303 (init_buffer_once): Initialize indirection counters of
4304 buffer_defaults and buffer_local_symbols (for sanity and safety).
4305
4306 2012-07-24 Eli Zaretskii <eliz@gnu.org>
4307
4308 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4309 and continuation glyphs on tooltip frames, leave them at zero.
4310 Avoids continued lines in tooltips. (Bug#11832)
4311
4312 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4313
4314 Simplify copy_overlay.
4315 * buffer.c (copy_overlay): Simplify. Use build_marker.
4316 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4317
4318 2012-07-23 Eli Zaretskii <eliz@gnu.org>
4319
4320 * print.c (print_object): Don't crash when a frame's name is nil
4321 or invalid. (Bug#12025)
4322
4323 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4324 it signals an error when a tooltip frame is being created.
4325
4326 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4327
4328 Cleanup miscellaneous objects allocation and initialization.
4329 * alloc.c (allocate_misc): Change to static. Add argument to
4330 specify the subtype. Adjust comment and users.
4331 (build_overlay): New function.
4332 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4333 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4334 (allocate_misc): Remove prototype.
4335 (build_overlay): Add prototype.
4336
4337 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4338
4339 Swap buffer text indirection counters in Fbuffer_swap_text.
4340 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4341 This avoids crash reported by Christoph Scholtes at
4342 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4343
4344 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4345
4346 * nsmenu.m (Popdown_data): New struct.
4347 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4348 free Popdown_data.
4349 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4350 (initWithContentRect): Make imgView and contentView non-static
4351 and autorelease them. Also autorelease img and matrix (Bug#12005).
4352 (dealloc): Remove (Bug#12005).
4353
4354 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4355
4356 Adjust consing_since_gc when objects are explicitly freed.
4357 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4358 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4359 (free_cons, free_misc): Subtract object size from consing_since_gc.
4360
4361 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4362
4363 Simplify and cleanup markers positioning code.
4364 * marker.c (attach_marker): More useful eassert.
4365 (live_buffer, set_marker_internal): New function.
4366 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4367 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4368
4369 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4370
4371 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4372 as it's limited by the amount of memory, not by INT_MAX.
4373
4374 2012-07-21 Eli Zaretskii <eliz@gnu.org>
4375
4376 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4377 in special-event-map. See the discussion at
4378 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4379 for the reasons.
4380
4381 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4382 info.dwItemData. Fixes crashes on 64-bit Windows.
4383 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4384
4385 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4386
4387 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4388 (conversationIdentifier): Return value is NSInteger.
4389 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4390
4391 2012-07-21 Chong Yidong <cyd@gnu.org>
4392
4393 * window.c (decode_any_window): Signal an error if the window is
4394 on a dead frame (Bug#11984).
4395
4396 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4397
4398 Add indirection counting to speed up Fkill_buffer.
4399 * buffer.h (struct buffer): New member.
4400 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4401 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4402 base buffer indirection counter.
4403 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4404 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4405 through buffer list if indirection counter is 0.
4406
4407 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4408
4409 Extend the value returned by Fgarbage_collect with heap statistics.
4410 * alloc.c (Qheap): New symbol.
4411 (syms_of_alloc): DEFSYM it.
4412 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4413 (Fmemory_free): Remove.
4414 (syms_of_alloc): Don't defsubr it.
4415 * buffer.c (Fcompact_buffer): Remove.
4416 (syms_of_buffer): Don't defsubr it.
4417
4418 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4419
4420 Make maybe_gc inline.
4421 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4422 * lisp.h (consing_since_gc, gc_relative_threshold)
4423 (memory_full_cons_threshold): Revert declaration.
4424 (maybe_gc): Remove prototype, define as inline.
4425 * alloc.c: Remove old commented-out code.
4426 (consing_since_gc, gc_relative_threshold)
4427 (memory_full_cons_threshold): Revert to global.
4428 (maybe_gc): Remove.
4429
4430 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4431
4432 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4433 * lisp.h (build_unibyte_string): New function.
4434 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4435 * sysdep.c, w32fns.c, xfns.c: Use it.
4436 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4437 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4438 Adjust users accordingly.
4439 * font.h (font_open_by_name): Adjust prototype.
4440
4441 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4442
4443 Cleanup calls to Fgarbage_collect.
4444 * lisp.h (maybe_gc): New prototype.
4445 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4446 Remove declarations.
4447 * alloc.c (maybe_gc): New function.
4448 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4449 Make them static.
4450 * bytecode.c (MAYBE_GC): Use maybe_gc.
4451 * eval.c (eval_sub, Ffuncall): Likewise.
4452 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4453 to avoid dependency from auto-save feature.
4454
4455 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4456
4457 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4458 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4459 'for_each_per_buffer_object_at'.
4460 All uses changed. It's better to use upper-case for macros that
4461 cannot be implemented as functions, to give the reader a clue
4462 that they're special.
4463
4464 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4465
4466 * alloc.c (Fgarbage_collect): Tweak docstring.
4467
4468 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4469
4470 Tweak the value returned from Fgarbage_collect again.
4471 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4472 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4473 Adjust documentation.
4474 (total_vector_bytes): Rename to total_vector_slots, adjust
4475 accounting.
4476 (total_free_vector_bytes): Rename to total_free_vector_slots,
4477 adjust accounting.
4478 (Qstring_bytes, Qvector_slots): New symbols.
4479 (syms_of_alloc): DEFSYM them.
4480
4481 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4482
4483 Buffer compaction primitive which may be used from Lisp.
4484 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4485 (syms_of_buffer): Register Fcompact_buffer.
4486 * alloc.c (Fgarbage_collect): Use compact_buffer.
4487 * buffer.h (compact_buffer): New prototype.
4488 (struct buffer_text): New member.
4489
4490 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4491
4492 New macro to iterate over all buffers, miscellaneous cleanups.
4493 * lisp.h (all_buffers): Remove declaration.
4494 * buffer.h (all_buffers): Add declaration, with comment.
4495 (for_each_buffer): New macro.
4496 * alloc.c (Fgarbage_collect, mark_object): Use it.
4497 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4498 (init_buffer): Likewise.
4499 * data.c (Fset_default): Likewise.
4500 * coding.c (code_conversion_restore): Remove redundant check
4501 for dead buffer.
4502 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4503
4504 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4505
4506 Fix bug that created negative-length intervals.
4507 * intervals.c (merge_interval_right, merge_interval_left):
4508 Do not zero out this interval if it is absorbed by its children,
4509 as this interval's total length doesn't change in that case. See
4510 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4511
4512 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4513
4514 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4515 when invoking (make-bool-vector N t) and N is a positive
4516 multiple of 8 -- the last 8 bits were mistakenly cleared.
4517
4518 Remove some struct layout assumptions in bool vectors.
4519 * alloc.c (bool_header_size): New constant.
4520 (header_size, word_size): Move earlier, as they're now used earlier.
4521 Use 'word_size' in a few more places, where it's appropriate.
4522 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4523 padding before the data member of a bool vector.
4524 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4525 than doing the check by hand with an abort ().
4526
4527 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4528
4529 * eval.c (Fdefvar): Don't check constants since we only set the var if
4530 it's not yet defined anyway (bug#11904).
4531
4532 * lisp.h (last_undo_boundary): Declare new var.
4533 * keyboard.c (command_loop_1): Set it.
4534 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4535 were auto-added by the command loop (bug#11774).
4536
4537 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4538
4539 * w32font.c (Qsymbol): Remove local definition.
4540 (syms_of_w32font): Don't DEFSYM it.
4541
4542 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4543
4544 Fix sweep_vectors to handle large bool vectors correctly.
4545 * alloc.c (sweep_vectors): Account total_vector_bytes for
4546 bool vectors larger than VBLOCK_BYTES_MAX.
4547
4548 2012-07-18 Chong Yidong <cyd@gnu.org>
4549
4550 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4551 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4552
4553 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4554
4555 Return more descriptive data from Fgarbage_collect.
4556 Suggested by Stefan Monnier in
4557 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4558 * alloc.c (bounded_number): New function.
4559 (total_buffers, total_vectors): New variable.
4560 (total_string_size): Rename to total_string_bytes, adjust users.
4561 (total_vector_size): Rename to total_vector_bytes, adjust users.
4562 (sweep_vectors): Account total_vectors and total_vector_bytes.
4563 (Fgarbage_collect): New return value. Adjust documentation.
4564 (gc_sweep): Account total_buffers.
4565 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4566 (VECTOR_SIZE): Remove.
4567 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4568 (Qinterval, Qmisc): New symbols.
4569 (syms_of_data): Initialize them.
4570 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4571 (Qcons, Qbuffer): New declarations.
4572
4573 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4574
4575 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4576 Round up, not down. Improve doc.
4577
4578 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4579
4580 Restore old code in allocate_string_data to avoid Faset breakage.
4581 Reported by Julien Danjou <julien@danjou.info> in
4582 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4583 * alloc.c (allocate_string_data): Restore old code with minor
4584 adjustments, fix comment to explain this subtle issue.
4585
4586 2012-07-17 Eli Zaretskii <eliz@gnu.org>
4587
4588 Remove FILE_SYSTEM_CASE.
4589 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4590
4591 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4592 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4593 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4594 call-process-region passes it through expand-file-name.
4595
4596 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4597
4598 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4599
4600 Fix crash when creating indirect buffer (Bug#11917)
4601 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4602 Don't handle unbound variables specially if non-zero.
4603 (Fbuffer_local_variables): Pass zero.
4604 (clone_per_buffer_values): Pass non-zero.
4605
4606 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4607
4608 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4609 to make the loop interruptible.
4610
4611 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4612
4613 * gnutls.c (emacs_gnutls_handshake): Only retry if
4614 GNUTLS_E_INTERRUPTED.
4615
4616 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4617
4618 Cleanup and convert miscellaneous checks to eassert.
4619 * alloc.c (mark_interval): Fix comment, partially rephrase
4620 old comment from intervals.h (see below).
4621 * intervals.c (find_interval, adjust_intervals_for_insertion)
4622 (delete_interval, adjust_intervals_for_deletion)
4623 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4624 Convert to eassert.
4625 (adjust_intervals_for_insertion, make_new_interval):
4626 Remove obsolete and unused code.
4627 * intervals.h (struct interval): Remove obsolete comment.
4628 * textprotp.c (erase_properties): Remove unused code.
4629 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4630 (Fremove_list_of_text_properties): Convert to eassert.
4631
4632 2012-07-17 Chong Yidong <cyd@gnu.org>
4633
4634 * editfns.c (Finsert_char): Doc fix.
4635
4636 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4637
4638 Fix previous change to make Fmemory_free always accurate.
4639 * alloc.c (make_interval): Update total_free_intervals.
4640 (make_float): Likewise for total_free_floats.
4641 (free_cons, Fcons): Likewise for total_free_conses.
4642 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4643 Likewise for total_free_vector_bytes.
4644 (Fmake_symbol): Likewise for total_free_symbols.
4645 (bytes_free): Remove.
4646
4647 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4648
4649 Simple free memory accounting feature.
4650 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4651 (sweep_vectors): Accumulate size of free vectors.
4652 (Fgarbage_collect): Setup bytes_free.
4653 (Fmemory_free): New function.
4654 (syms_of_alloc): Register it.
4655
4656 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4657
4658 Cleanup overlays checking.
4659 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4660 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4661 eassert and OVERLAYP.
4662 (sort_overlays): Change to use OVERLAYP.
4663
4664 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4665
4666 * editfns.c (Finsert_char): Make it interactive, and make the
4667 second arg optional. Copy interactive spec and docstring from
4668 ucs-insert.
4669
4670 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4671
4672 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4673 Unlike the other wrapped functions, fabs has an unspecified
4674 effect on errno.
4675
4676 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4677
4678 * nsterm.m (keyDown): Interpret flags without left/right bits
4679 as the left key (Bug#11670).
4680
4681 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4682
4683 Remove empty and useless init functions.
4684 * lisp.h (init_character_once, init_fns, init_image)
4685 (init_filelock, init_sound): Remove prototype.
4686 * character.c (init_character_once): Remove.
4687 * filelock.c (init_filelock): Likewise.
4688 * fns.c (init_fns): Likewise.
4689 * image.c (init_image): Likewise.
4690 * sound.c (init_sound): Likewise.
4691 * emacs.c (main): Adjust accordingly.
4692
4693 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4694
4695 * gtkutil.h: Tiny cleanups.
4696 (use_old_gtk_file_dialog): Remove useless declaration.
4697 (xg_uses_old_file_dialog): Add suggested const attribute.
4698
4699 2012-07-15 Eli Zaretskii <eliz@gnu.org>
4700
4701 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4702 (bidi_paragraph_init): Use it to limit search forward for a strong
4703 directional character in abnormally large paragraphs full of
4704 neutral or weak characters. (Bug#11943)
4705
4706 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4707
4708 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4709 the toolbar (Bug#9451).
4710 (xg_make_tool_item): Give the widget event box a transparent
4711 background.
4712
4713 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4714
4715 Cleanup basic allocation variables and functions.
4716 * alloc.c (ignore_warnings, init_intervals, init_float)
4717 (init_cons, init_symbol, init_marker): Remove.
4718 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4719 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4720 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4721 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4722 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4723 (staticidx, init_alloc_once, init_strings, free_ablock):
4724 Remove redundant initialization.
4725 * fns.c (init_weak_hash_tables): Remove.
4726 * lisp.h (init_weak_hash_tables): Remove prototype.
4727
4728 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4729
4730 Use zero_vector where appropriate.
4731 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4732 accordingly.
4733 * lisp.h (zero_vector): New declaration.
4734 * font.c (null_vector): Remove.
4735 (syms_of_font): Remove initialization and staticpro.
4736 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4737 * keymap.c (Faccessible_keymaps): Likewise.
4738
4739 2012-07-15 Leo Liu <sdl.web@gmail.com>
4740
4741 * fringe.c: Fix typo in comments.
4742
4743 2012-07-14 Leo Liu <sdl.web@gmail.com>
4744
4745 * fringe.c: Add a new bitmap exclamation-mark.
4746
4747 2012-07-14 Eli Zaretskii <eliz@gnu.org>
4748
4749 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4750
4751 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4752 (HAVE_MENUS): Don't define, defined by editing config.in with
4753 msdos/sed2v2.inp.
4754 (GMALLOC_INHIBIT_VALLOC): Don't define.
4755 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4756
4757 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
4758
4759 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4760
4761 2012-07-14 Glenn Morris <rgm@gnu.org>
4762
4763 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4764 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4765 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4766
4767 2012-07-13 Glenn Morris <rgm@gnu.org>
4768
4769 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4770
4771 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4772 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4773
4774 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4775
4776 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4777 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4778 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4779 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4780 where appropriate.
4781 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4782 as boolean expression.
4783 (x_set_window_size): Remove unused variable toolbar.
4784 (ns_get_color_default, ns_mod_to_lisp): Remove.
4785 (ns_mouse_position): Remove unused variables xchar and ychar.
4786 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4787 (ns_set_vertical_scroll_bar): Remove unused variable count.
4788 (ns_delete_terminal): Remove unused variable i.
4789 (ns_term_init): Remove unused variables r, g and b.
4790 (mouseDown): Remove unused variable window.
4791 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4792 (initFrameFromEmacs): Remove unused variable vbextra.
4793 (mouseEntered): Remove unused variables p and dpyinfo.
4794 (mouseExited): Remove unused variables p and r.
4795 (ns_define_frame_cursor, ns_clear_frame_area)
4796 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4797 (menuDown): Assign [sender tag] to variable and cast the variable.
4798
4799 * nsterm.h (menuDown): Add id as type to argument sender.
4800 (ns_display_info_for_name): Add Lisp_Object argument.
4801 (ns_term_init): Add Lisp_Object argument.
4802 (ns_map_event_to_object): Add void argument.
4803 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4804 prototype with arguments and only declare if __OBJC__.
4805 (nxatoms_of_nsselect): Add void argument.
4806 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4807 (ns_alloc_autorelease_pool): Add void argument.
4808 (ns_release_autorelease_pool): Add void* argument.
4809 (ns_get_defaults_value): Add const char* argument.
4810
4811 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4812 (initFromContents): Use SSDATA where appropriate.
4813 (ns_update_menubar): Add braces to ambigous if-else.
4814 (initWithTitle): Put () around assignment in if statement.
4815 (ns_menu_show): Remove unused variables window and keymap.
4816 (update_frame_tool_bar): Remove unused variable selected_p.
4817 (initWithContentRect): Remove unused variable this_cmd_name.
4818
4819 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4820 appropriate.
4821 (setXBMColor): Remove unused variable len.
4822 (setPixmapData): Put () around assignment in loop statement.
4823
4824 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4825 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4826 where appropriate.
4827 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4828 around assignment in loop statement.
4829 (nsfont_open): Remove unused variable i.
4830 (nsfont_open): Remove unused variable len.
4831 (nsfont_draw): Remove unused variable cs.
4832
4833 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4834 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4835 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4836 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4837 (Fns_font_name, Fns_perform_service)
4838 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4839 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4840 (ns_set_name): Remove unused variable view.
4841 (x_set_menu_bar_lines): Remove unused variable olines.
4842 (x_set_tool_bar_lines): Remove unused variable root_window.
4843 (Fns_list_colors): Put () around assignment in while statement.
4844 (Fns_perform_service): Remove unused variable len.
4845 (Fns_display_usable_bounds): Remove unused variable top.
4846 (syms_of_nsfns): Remove unused variable i.
4847
4848 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4849 memcpy (Bug#11907).
4850
4851 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4852
4853 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4854 and free it with DestroyExceptionInfo (Bug#11558).
4855
4856 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
4857
4858 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4859 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4860 Set here, not in nt/config.nt.
4861
4862 2012-07-13 Eli Zaretskii <eliz@gnu.org>
4863
4864 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4865 cursor overflow into the last glyph on display line when the right
4866 fringe is off. (Bug#11832)
4867
4868 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4869
4870 * xdisp.c (produce_special_glyphs): Now static.
4871 * dispextern.h (produce_special_glyphs): Remove decl.
4872
4873 2012-07-13 Glenn Morris <rgm@gnu.org>
4874
4875 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4876 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4877
4878 * s/usg5-4-common.h (USG, USG5):
4879 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4880 * s/sol2-6.h (SOLARIS2):
4881 * s/irix6-5.h (IRIX6_5):
4882 * s/hpux10-20.h (USG, USG5, HPUX):
4883 * s/gnu-linux.h (USG, GNU_LINUX):
4884 * s/freebsd.h (BSD_SYSTEM):
4885 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4886 * s/cygwin.h (CYGWIN):
4887 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4888 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4889
4890 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4891
4892 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4893
4894 2012-07-13 Glenn Morris <rgm@gnu.org>
4895
4896 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4897
4898 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4899
4900 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4901 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4902
4903 2012-07-12 Glenn Morris <rgm@gnu.org>
4904
4905 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4906
4907 * process.c (init_process_emacs): Rename from init_process.
4908 The old name is also the name of a Mach system call.
4909 * lisp.h, emacs.c: Update for this name change.
4910 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4911 longer needed.
4912
4913 2012-07-12 Eli Zaretskii <eliz@gnu.org>
4914
4915 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4916 memmove call that removes glyphs covered by the left truncation
4917 glyph. Improve commentary.
4918 (display_line): Fix display of continuation glyphs on GUI frames
4919 when the right fringe is turned off and variable-size fonts are
4920 used in the window. Move the code that appends a stretch glyph to
4921 produce_special_glyphs, so that it could be used for truncation
4922 and continuation glyphs alike.
4923 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4924 glyph of a suitably computed width, to align the special glyphs at
4925 the window margin. Code moved from display_line. (Bug#11832)
4926
4927 2012-07-12 Glenn Morris <rgm@gnu.org>
4928
4929 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4930
4931 * s/gnu-linux.h, s/hpux10-20.h:
4932 Do not unconditionally define HAVE_XRMSETDATABASE.
4933
4934 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4935
4936 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4937
4938 Fix typos that broke OS X build.
4939 Reported by Randal L. Schwartz in
4940 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4941 * nsterm.m (ns_timeout): Add missing local decl.
4942 (ns_get_color): snprintf -> sprintf, to fix typo.
4943
4944 2012-07-12 Glenn Morris <rgm@gnu.org>
4945
4946 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4947 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4948 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4949 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4950
4951 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4952 Move PTY_OPEN to configure.
4953
4954 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4955 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4956 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4957
4958 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4959
4960 Use empty_unibyte_string where applicable.
4961 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4962 * lread.c (read1): Likewise.
4963 * xsettings.c (syms_of_xsettings): Likewise.
4964
4965 2012-07-12 Glenn Morris <rgm@gnu.org>
4966
4967 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4968 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4969 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4970 * s/hpux10-20.h (RUN_TIME_REMAP):
4971 * s/bsd-common.h (TABDLY): Move to configure.
4972
4973 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4974
4975 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4976
4977 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4978 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4979
4980 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4981
4982 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4983 * s/template.h: Move NARROWPROTO to configure.
4984
4985 2012-07-11 Glenn Morris <rgm@gnu.org>
4986
4987 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4988 unused since 2011-01-17 change to systty.h.
4989
4990 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4991 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4992 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4993
4994 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4995
4996 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4997
4998 2012-07-11 Glenn Morris <rgm@gnu.org>
4999
5000 * s/darwin.h, s/gnu-linux.h, s/template.h:
5001 Move INTERRUPT_INPUT to configure.
5002
5003 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5004
5005 Minor adjustments to interning code.
5006 * lisp.h (intern, intern_c_string): Redefine as static inline
5007 wrappers for intern_1 and intern_c_string_1, respectively.
5008 (intern_1, intern_c_string_1): Rename prototypes.
5009 * lread.c (intern_1, intern_c_string_1, oblookup):
5010 Simplify Vobarray checking.
5011 * font.c (font_intern_prop): Likewise. Adjust comment.
5012 * w32font.c (intern_font_name): Likewise.
5013
5014 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5015
5016 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5017
5018 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5019 of Fcar/Fcdr if possible.
5020 * font.c (check_otf_features): Likewise.
5021 * fontset.c (Fnew_fontset): Likewise.
5022 * gnutls.c (Fgnutls_boot): Likewise.
5023 * minibuf.c (read_minibuf): Likewise.
5024 * msdos.c (IT_set_frame_parameters): Likewise.
5025 * xmenu.c (Fx_popup_dialog): Likewise.
5026 * w32menu.c (Fx_popup_dialog): Likewise.
5027
5028 2012-07-11 Glenn Morris <rgm@gnu.org>
5029
5030 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5031 since nothing has defined it on these platforms.
5032
5033 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5034 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5035
5036 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5037 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5038 Move CLASH_DETECTION to configure.
5039
5040 * s/gnu.h: Remove file, which is now empty.
5041
5042 * s/gnu.h, s/gnu-linux.h:
5043 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5044
5045 2012-07-11 John Wiegley <johnw@newartisans.com>
5046
5047 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5048 function attribute, so we only use it if it exists in the
5049 compiler.
5050
5051 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5052
5053 Avoid call to strlen in fast_c_string_match_ignore_case.
5054 * search.c (fast_c_string_match_ignore_case): Change to use
5055 length argument. Adjust users accordingly.
5056 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5057
5058 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5059
5060 Assume mkdir, rmdir.
5061 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5062 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5063
5064 Assume rename.
5065 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5066
5067 Assume perror.
5068 * s/hpux10-20.h (HAVE_PERROR): Remove.
5069 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5070 Remove dummy definition, as this problem was obsolete long ago.
5071
5072 Assume strerror.
5073 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5074
5075 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5076
5077 Avoid calls to strlen in font processing functions.
5078 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5079 (font_open_by_name): Change to use length argument.
5080 Adjust users accordingly.
5081 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5082 Adjust prototypes.
5083 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5084 Change to return ptrdiff_t.
5085 (xfont_list_pattern, xfont_match): Use length returned by
5086 xfont_decode_coding_xlfd.
5087 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5088
5089 2012-07-11 Glenn Morris <rgm@gnu.org>
5090
5091 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5092 Move DONT_REOPEN_PTY to configure.
5093
5094 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5095 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5096
5097 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5098
5099 Remove "#define unix" that is no longer needed (Bug#11905).
5100 * s/aix4-2.h (unix): Remove; no longer needed.
5101
5102 EMACS_TIME simplification (Bug#11875).
5103 This replaces macros (which typically do not work in GDB)
5104 with functions, typedefs and enums, making the code easier to debug.
5105 The functional style also makes code easier to read and maintain.
5106 * systime.h: Include <sys/time.h> on all hosts, not just if
5107 WINDOWSNT, since 'struct timeval' is needed in general.
5108 (EMACS_TIME): Now a typedef, not a macro.
5109 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5110 not macros.
5111 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5112 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5113 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5114 (EMACS_TIME_LE): Now functions, not macros.
5115 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5116 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5117 which are not functions. All uses rewritten to use:
5118 (make_emacs_time): New function.
5119 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5120 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5121 not functions. All uses rewritten to use the following, respectively:
5122 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5123 (add_emacs_time, sub_emacs_time): New functions.
5124 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5125 * fileio.c (Fcopy_file):
5126 * xterm.c (XTflash): Get the current time closer to when it's used.
5127 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5128
5129 * bytecode.c (targets): Suppress -Woverride-init warnings.
5130
5131 Simplify by avoiding confusing use of strncpy etc.
5132 * doc.c (Fsnarf_documentation):
5133 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5134 * frame.c (Fmake_terminal_frame):
5135 * gtkutil.c (get_utf8_string):
5136 * lread.c (openp):
5137 * nsmenu.m (ns_update_menubar):
5138 * regex.c (regerror):
5139 Prefer memcpy to strncpy and strncat when either will do.
5140 * fileio.c (Fsubstitute_in_file_name):
5141 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5142 (menu_separator_name_p):
5143 * nsmenu.m (ns_update_menubar):
5144 Prefer memcmp to strncmp when either will do.
5145 * nsterm.m: Include <ftoastr.h>.
5146 (ns_get_color):
5147 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5148 Prefer snprintf to strncpy.
5149 * nsterm.m (ns_term_init):
5150 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5151 * nsterm.m (ns_term_init):
5152 Avoid the need for strncpy, by using build_string or
5153 make_unibyte_string directly. Use dtoastr, not snprintf.
5154 * process.c (Fmake_network_process): Diagnose service names that
5155 are too long, rather than silently truncating them or creating
5156 non-null-terminated names.
5157 (Fnetwork_interface_info): Likewise, for interface names.
5158 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5159 Prefer sprintf to strncat.
5160 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5161 Prefer vsnprintf to vsprintf + strncpy.
5162
5163 2012-07-10 Glenn Morris <rgm@gnu.org>
5164
5165 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5166 Clarify fallback case.
5167
5168 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5169
5170 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5171 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5172 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5173 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5174 where argument type is known to be a Lisp_Cons.
5175
5176 2012-07-10 Tom Tromey <tromey@redhat.com>
5177
5178 * bytecode.c (BYTE_CODE_THREADED): New macro.
5179 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5180 (enum byte_code_op): New type.
5181 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5182 (exec_byte_code): Use them. Use token threading when applicable.
5183
5184 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5185
5186 Optimize pure C strings initialization.
5187 * lisp.h (make_pure_string): Fix prototype.
5188 (build_pure_c_string): New function, defined as static inline. This
5189 provides a better opportunity to optimize away calls to strlen when
5190 the function is called with compile-time constant argument.
5191 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5192 argument, adjust users accordingly. Use build_pure_c_string where
5193 appropriate.
5194 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5195 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5196 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5197
5198 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5199
5200 Avoid calls to strlen in miscellaneous functions.
5201 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5202 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5203 * lread.c (openp): Likewise.
5204
5205 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5206
5207 Avoid calls to strlen in path processing functions.
5208 * fileio.c (file_name_as_directory): Add comment. Change to add
5209 srclen argument and return the length of result. Adjust users
5210 accordingly.
5211 (directory_file_name): Fix comment. Change to add srclen argument,
5212 swap 1st and 2nd arguments to obey the common convention.
5213 Adjust users accordingly.
5214 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5215
5216 2012-07-10 Glenn Morris <rgm@gnu.org>
5217
5218 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5219 Move PENDING_OUTPUT_COUNT definition to configure.
5220
5221 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5222 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5223 * s/gnu.h (DATA_START): Move definitions to configure.
5224
5225 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5226 We include usg5-4-common.h, which defines them both.
5227
5228 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5229 O_RDONLY already includes it).
5230
5231 Stop ns builds setting the EMACSLOADPATH environment variable.
5232 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5233 Now it does not set EMACSLOADPATH, just returns the load-path string.
5234 * nsterm.h: Update accordingly.
5235 * lread.c [HAVE_NS]: Include nsterm.h.
5236 (init_lread) [HAVE_NS]: Use ns_load_path.
5237 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5238
5239 2012-07-09 Glenn Morris <rgm@gnu.org>
5240
5241 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5242 since the included bsd-common.h does so.
5243
5244 Stop ns builds setting the EMACSPATH environment variable.
5245 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5246 (ns_init_paths): Do not set EMACSPATH.
5247 * nsterm.h (ns_exec_path): Add it.
5248 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5249 Use ns_exec_path.
5250
5251 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5252
5253 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5254
5255 * process.c (wait_reading_process_output): 'waitchannels' was unset
5256 when read_kbd || !NILP (wait_for_cell); fix this.
5257
5258 Add GCC-style 'const' attribute to functions that can use it.
5259 * character.h (char_resolve_modifier_mask):
5260 * keyboard.h (make_ctrl_char):
5261 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5262 (init_character_once, next_almost_prime, init_fns, init_image)
5263 (flush_pending_output, init_sound):
5264 * mem-limits.h (start_of_data):
5265 * menu.h (finish_menu_items):
5266 Add ATTRIBUTE_CONST.
5267 * emacs.c (DEFINE_DUMMY_FUNCTION):
5268 Declare the dummy function with ATTRIBUTE_CONST.
5269 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5270 Add decls with ATTRIBUTE_CONST.
5271
5272 Minor improvements to make_formatted_string.
5273 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5274 where int is good enough, as vsprintf returns an int.
5275 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5276
5277 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5278
5279 Use make_formatted_string to avoid double length calculation.
5280 * lisp.h (make_formatted_string): New prototype.
5281 * alloc.c (make_formatted_string): New function.
5282 * buffer.c (Fgenerate_new_buffer_name): Use it.
5283 * dbus.c (syms_of_dbusbind): Likewise.
5284 * editfns.c (Fcurrent_time_zone): Likewise.
5285 * filelock.c (get_boot_time): Likewise.
5286 * frame.c (make_terminal_frame, set_term_frame_name)
5287 (x_report_frame_params): Likewise.
5288 * image.c (gs_load): Likewise.
5289 * minibuf.c (get_minibuffer): Likewise.
5290 * msdos.c (dos_set_window_size): Likewise.
5291 * process.c (make_process): Likewise.
5292 * xdisp.c (ensure_echo_area_buffers): Likewise.
5293 * xsettings.c (apply_xft_settings): Likewise.
5294
5295 2012-07-09 Glenn Morris <rgm@gnu.org>
5296
5297 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5298 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5299 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5300 * nsterm.h (ns_etc_directory): Add it.
5301 * callproc.c [HAVE_NS]: Include nsterm.h.
5302 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5303
5304 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5305
5306 Move marker debugging code under MARKER_DEBUG.
5307 * marker.c (MARKER_DEBUG): Move marker debugging code under
5308 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5309 for bootstrap with --enable-checking (~3x slowdown reported
5310 by Juanma Barranquero <lekktu@gmail.com>).
5311 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5312
5313 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5314
5315 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5316 See <http://bugs.gnu.org/11825#29>.
5317
5318 2012-07-08 Eli Zaretskii <eliz@gnu.org>
5319
5320 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5321 has no font, use the frame's font. (Bug#11813)
5322 (display_line): Add commentary about displaying truncation glyphs
5323 on GUI frames.
5324 (produce_special_glyphs): Move here from term.c.
5325
5326 * term.c (produce_special_glyphs): Move to xdisp.c.
5327
5328 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5329 section.
5330
5331 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5332
5333 * xdisp.c (display_line): Avoid warning about implicit declaration
5334 of FRAME_FONT.
5335
5336 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5337
5338 * lisp.h: Remove empty conditional.
5339
5340 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5341
5342 * lread.c (load_path_check): Now static.
5343
5344 Fix some minor --with-ns problems found by static checking.
5345 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5346 (x_set_font) [!HAVE_X_WINDOWS]:
5347 * image.c (xpm_load_image) [HAVE_NS]:
5348 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5349 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5350 Remove unused local.
5351 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5352 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5353 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5354 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5355 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5356 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5357 Fix pointer signedness problem.
5358 * xfaces.c (FRAME_X_FONT_TABLE):
5359 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5360
5361 2012-07-07 Glenn Morris <rgm@gnu.org>
5362
5363 * lread.c (load_path_check): New function, split from init_lread.
5364 (init_lread): Reorganize. Motivation:
5365 If EMACSLOADPATH is set, check/warn about that rather than the
5366 defaults, which we are not going to use. Hence we can remove
5367 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5368 Don't warn if site-lisp directories are missing.
5369 If not installed, start from a blank load-path, since
5370 PATH_LOADSEARCH refers to the eventual installation directories.
5371
5372 2012-07-07 Eli Zaretskii <eliz@gnu.org>
5373
5374 Support truncation and continuation glyphs on GUI frames, when
5375 fringes are disabled. (Bug#11832)
5376 * xdisp.c (init_iterator): Get dimensions of truncation and
5377 continuation glyphs even if on GUI frames.
5378 Adjust it->last_visible_x on GUI frames when the left or right fringes,
5379 or both, are absent.
5380 (start_display, move_it_in_display_line_to): Handle the case of a
5381 GUI frame without a fringe to display continuation or truncation
5382 glyphs.
5383 (insert_left_trunc_glyphs): Support GUI frames: make sure
5384 truncation glyphs overwrite enough glyphs from the current line to
5385 have sufficient space in pixels.
5386 (display_line): Support truncation and continuation glyphs on GUI
5387 frames. If some spare pixels are left on the line after inserting
5388 the truncation glyphs, fill that space with a stretch glyph of a
5389 suitably computed width.
5390
5391 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5392 produce_glyphs, to support GUI sessions.
5393
5394 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5395
5396 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5397
5398 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5399
5400 Do not require float-time's arg to fit in time_t (Bug#11825).
5401 This works better on hosts where time_t is unsigned, and where
5402 float-time is applied to the (negative) difference between two times.
5403 * editfns.c (decode_time_components): Last arg is now double *,
5404 not int *, and means to store all the result as a double, without
5405 worrying about whether the seconds part fits in time_t.
5406 All callers changed.
5407 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5408 All callers changed.
5409 (Ffloat_time): Do not fail merely because the specified time falls
5410 outside of time_t range.
5411
5412 2012-07-07 Glenn Morris <rgm@gnu.org>
5413
5414 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5415 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5416 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5417
5418 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
5419
5420 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5421 Update dependencies.
5422
5423 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5424
5425 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5426
5427 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5428 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5429 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5430 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5431 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5432 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5433
5434 * xfont.c (compare_font_names): Redo to omit the need for casts.
5435
5436 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5437
5438 * xfns.c (Fx_change_window_property): Doc fix.
5439 * w32fns.c (Fx_change_window_property): Doc fix.
5440
5441 * w32fns.c (Fx_window_property): Accept the same arguments as the
5442 X Windows version. Doc fix.
5443 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5444
5445 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5446 Eli Zaretskii <eliz@gnu.org>
5447
5448 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5449 Windows-specific code from nt/config.nt moved here.
5450 Obsolete settings removed.
5451
5452 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5453
5454 * process.c: Avoid unnecessary calls to gettime.
5455 (wait_reading_process_output): Don't get the time of day
5456 when gobbling data immediately and not waiting, as there's no need
5457 for it in that case. This removes a FIXME.
5458
5459 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5460
5461 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5462 is defined (Bug#11768).
5463
5464 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5465
5466 Fix marker debugging code.
5467 * marker.c (byte_char_debug_check): Do not perform the check
5468 if buffer is not multibyte.
5469 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5470 Call byte_char_debug_check with correct arguments.
5471
5472 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5473
5474 Compile marker debugging code only if ENABLE_CHECKING is defined.
5475 * marker.c (byte_char_debug_check, count_markers):
5476 Use only if ENABLE_CHECKING is defined.
5477 (byte_debug_flag): Remove.
5478 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5479 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5480
5481 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5482
5483 Avoid code repetition in marker-related functions.
5484 * marker.c (attach_marker): New function.
5485 (Fset_marker, set_marker_restricted, set_marker_both)
5486 (set_marker_restricted_both): Use it.
5487 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5488 Consistently rename charno to charpos.
5489 (marker_position): Add eassert.
5490 (marker_byte_position): Convert to eassert.
5491
5492 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5493
5494 Simplify list operations in unchain_overlay and unchain_marker.
5495 * buffer.c (unchain_overlay): Simplify. Add comment.
5496 * marker.c (unchain_marker): Simplify. Fix comments.
5497
5498 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5499
5500 Introduce fast path for the widely used marker operation.
5501 * alloc.c (build_marker): New function.
5502 * lisp.h (build_marker): New prototype.
5503 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5504 * composite.c (autocmp_chars): Likewise.
5505 * editfns.c (buildmark): Remove.
5506 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5507 (save_restriction_save): Use build_marker.
5508 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5509 * window.c (save_window_save): Likewise.
5510
5511 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5512
5513 Do not use Fdelete_overlay in delete_all_overlays
5514 to avoid redundant calls to unchain_overlay.
5515 * buffer.c (drop_overlay): New function.
5516 (delete_all_overlays, Fdelete_overlay): Use it.
5517 * minibuf.c (get_minibuffer): Fix comment.
5518
5519 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5520
5521 Port to OpenBSD 5.1 amd64.
5522 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5523 This is needed for OpenBSD, and should be harmless on all BSD systems.
5524 Also, include <sys/sysctl.h>, as it should be available on all
5525 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5526 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5527 use p_pid member, not kp_proc.pid.
5528
5529 2012-07-06 Glenn Morris <rgm@gnu.org>
5530
5531 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5532
5533 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5534
5535 More xmalloc and related cleanup.
5536 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5537 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5538 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5539 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5540 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5541 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5542 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5543 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5544 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5545 * xterm.c:
5546 Omit needless casts involving void * pointers and allocation.
5547 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5548 as the former is more robust if P's type is changed.
5549 Prefer xzalloc to xmalloc + memset 0.
5550 Simplify malloc-or-realloc to realloc.
5551 Don't worry about xmalloc returning a null pointer.
5552 Prefer xstrdup to xmalloc + strcpy.
5553 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5554 growing it.
5555 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5556 alloca of a constant.
5557
5558 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5559
5560 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5561 hscroll is larger than the line width. Fixes long and futile
5562 looping inside extend_face_to_end_of_line (on a TTY) producing
5563 glyphs that are not needed and thrown away.
5564
5565 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5566
5567 * marker.c (set_marker_restricted_both): Simplify by using
5568 clip_to_bounds.
5569
5570 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5571
5572 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5573
5574 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5575
5576 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5577 not defined (Bug#11768).
5578 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5579 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5580 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5581 followed by gtk_box_set_homogeneous (Bug#11768).
5582 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5583 (update_theme_scrollbar_width, xg_create_scroll_bar):
5584 Use gtk_scrollbar_new (Bug#11768).
5585 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5586 (is_box_type): New function (Bug#11768).
5587 (xg_tool_item_stale_p): Call is_box_type.
5588 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5589 with default display (Bug#11768).
5590
5591 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5592
5593 * xdisp.c (window_hscroll_limited): New function.
5594 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5595 coordinates when window's hscroll is set to insanely large
5596 values. (Bug#11857)
5597
5598 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
5599
5600 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5601 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5602
5603 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5604
5605 Cleanup xmalloc.
5606 * lisp.h (xzalloc): New prototype. Omit needless casts.
5607 * alloc.c (xzalloc): New function. Omit needless casts.
5608 * charset.c: Omit needless casts. Convert all calls to
5609 xmalloc with following memset to xzalloc.
5610 * dispnew.c: Likewise.
5611 * fringe.c: Likewise.
5612 * image.c: Likewise.
5613 * sound.c: Likewise.
5614 * term.c: Likewise.
5615 * w32fns.c: Likewise.
5616 * w32font.c: Likewise.
5617 * w32term.c: Likewise.
5618 * xfaces.c: Likewise.
5619 * xfns.c: Likewise.
5620 * xterm.c: Likewise.
5621 * atimer.c: Omit needless casts.
5622 * buffer.c: Likewise.
5623 * callproc.c: Likewise.
5624 * ccl.c: Likewise.
5625 * coding.c: Likewise.
5626 * composite.c: Likewise.
5627 * doc.c: Likewise.
5628 * doprnt.c: Likewise.
5629 * editfns.c: Likewise.
5630 * emacs.c: Likewise.
5631 * eval.c: Likewise.
5632 * filelock.c: Likewise.
5633 * fns.c: Likewise.
5634 * gtkutil.c: Likewise.
5635 * keyboard.c: Likewise.
5636 * lisp.h: Likewise.
5637 * lread.c: Likewise.
5638 * minibuf.c: Likewise.
5639 * msdos.c: Likewise.
5640 * print.c: Likewise.
5641 * process.c: Likewise.
5642 * region-cache.c: Likewise.
5643 * search.c: Likewise.
5644 * sysdep.c: Likewise.
5645 * termcap.c: Likewise.
5646 * terminal.c: Likewise.
5647 * tparam.c: Likewise.
5648 * w16select.c: Likewise.
5649 * w32.c: Likewise.
5650 * w32reg.c: Likewise.
5651 * w32select.c: Likewise.
5652 * w32uniscribe.c: Likewise.
5653 * widget.c: Likewise.
5654 * xdisp.c: Likewise.
5655 * xmenu.c: Likewise.
5656 * xrdb.c: Likewise.
5657 * xselect.c: Likewise.
5658
5659 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5660
5661 * fileio.c (time_error_value): Check the right error number.
5662 Problem reported by Troels Nielsen in
5663 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5664
5665 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5666
5667 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5668 This should be fixed in a better way; see Eli Zaretskii in
5669 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5670 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5671
5672 * fileio.c (time_error_value): Rename from special_mtime.
5673 The old name's problems were noted by Eli Zaretskii in
5674 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5675
5676 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5677 This variable's comment says Emacs needs at least one GDB-visible
5678 symbol of type enum pvec_type, to work around GDB problems.
5679 The symbol's value doesn't matter.
5680
5681 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5682 that causes compilation to fail on pre-C99 compilers.
5683
5684 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
5685
5686 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5687 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5688
5689 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5690
5691 * buffer.c (init_buffer_once): Fix initialization of
5692 headers for buffer_defaults and buffer_local_symbols.
5693 Reported by Juanma Barranquero <lekktu@gmail.com>.
5694
5695 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5696
5697 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5698 * lisp.h (enum pvec_type): Use fewer bits.
5699 (PSEUDOVECTOR_SIZE_BITS): New constant.
5700 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5701 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5702 change in pvec_type.
5703 (PSEUDOVECTOR_TYPEP): New macro.
5704 (TYPED_PSEUDOVECTORP): Use it.
5705 * fns.c (internal_equal): Adapt code to extract pvectype.
5706 * emacs.c (gdb_pvec_type): Update type.
5707 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5708 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5709 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5710 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5711 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5712 abusing vector->header.next.nbytes.
5713 (live_vector_p): Use PVEC_TYPE.
5714 (mark_object): Adapt code to extract pvectype. Use switch.
5715
5716 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5717
5718 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5719 Tighten new eassert a bit.
5720
5721 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5722
5723 Fix compilation with --enable-gcc-warnings and -O1
5724 optimization level.
5725 * doprnt.c (doprnt): Change type of tem to int, initialize
5726 to avoid compiler warning. Add eassert.
5727 * search.c (simple_search): Initialize match_byte to avoid
5728 compiler warning. Add eassert.
5729
5730 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5731
5732 Avoid weird behavior with large horizontal scrolls.
5733 Without this change, for example, large hscroll values would
5734 mess up Emacs's display on Fedora 15 x86, presumably due to
5735 overflows in int calculations in the display code.
5736 Also, if buffers had long lines, Emacs would freeze.
5737 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5738 (set_window_hscroll): New function, containing the old guts of
5739 Fset_window_hscroll. Return the clipped value.
5740 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5741 This avoids the need to check against PTRDIFF_MAX.
5742
5743 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5744
5745 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5746
5747 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5748
5749 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5750
5751 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5752 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5753 since GCC 4.4.6 issues a bogus warning for them.
5754
5755 Fix bugs in file timestamp newness comparisons.
5756 * fileio.c (Ffile_newer_than_file_p):
5757 * lread.c (Fload): Use full timestamp resolution of files,
5758 not just the 1-second resolution, so that files that are only
5759 slightly newer still count as newer.
5760 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5761 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5762
5763 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5764
5765 * fileio.c: Improve handling of file time marker. (Bug#11852)
5766 (special_mtime): New function.
5767 (Finsert_file_contents, Fverify_visited_file_modtime):
5768 Use it to set special mtime values consistently.
5769
5770 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5771
5772 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5773 marker for non-existing file. (Bug#11852)
5774
5775 2012-07-03 Glenn Morris <rgm@gnu.org>
5776
5777 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5778 and did not make it into globals.h).
5779
5780 2012-07-03 Tom Tromey <tromey@redhat.com>
5781
5782 * window.c (Fset_window_margins, Fset_window_fringes)
5783 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5784 * textprop.c (Fprevious_property_change): No longer static.
5785 * syntax.c (Fsyntax_table_p): No longer static.
5786 * process.c (Fget_process, Fprocess_datagram_address): No longer
5787 static.
5788 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5789 * keyboard.c (Fcommand_execute): No longer static.
5790 Remove EXFUN.
5791 * insdel.c (Fcombine_after_change_execute): No longer static.
5792 * image.c (Finit_image_library): No longer static.
5793 * fileio.c (Fmake_symbolic_link): No longer static.
5794 * eval.c (Ffetch_bytecode): No longer static.
5795 * editfns.c (Fuser_full_name): No longer static.
5796 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5797 No longer static.
5798 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5799 static.
5800 * dired.c (Ffile_attributes): No longer static.
5801 * composite.c (Fcomposition_get_gstring): No longer static.
5802 * callproc.c (Fgetenv_internal): No longer static.
5803
5804 * ccl.h: Remove EXFUNs.
5805 * buffer.h: Remove EXFUNs.
5806 * dispextern.h: Remove EXFUNs.
5807 * intervals.h: Remove EXFUNs.
5808 * fontset.h: Remove EXFUN.
5809 * font.h: Remove EXFUNs.
5810 * dosfns.c (system_process_attributes): Remove EXFUN.
5811 * keymap.h: Remove EXFUNs.
5812 * lisp.h: Remove EXFUNs.
5813 * w32term.h: Remove EXFUNs.
5814 * window.h: Remove EXFUNs.
5815 * xsettings.h: Remove EXFUN.
5816 * xterm.h: Remove EXFUN.
5817
5818 2012-07-03 Glenn Morris <rgm@gnu.org>
5819
5820 * lisp.h (Frandom): Make it visible to C.
5821 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5822 buffer for invisible buffers. (Bug#1229)
5823
5824 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5825
5826 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5827 values which aren't power of 2.
5828 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5829 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5830 accordingly.
5831
5832 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5833
5834 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5835
5836 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5837
5838 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5839
5840 * alloc.c (allocate_vector_block): Remove redundant
5841 calls to mallopt if DOUG_LEA_MALLOC is defined.
5842 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5843 avoid calls to mallopt if zero_vector is returned.
5844
5845 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5846
5847 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5848 is enabled, avoid dereferencing NULL current_sblock if
5849 running undumped.
5850
5851 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5852
5853 Cleanup basic buffer management.
5854 * buffer.h (struct buffer): Change layout to use generic vector
5855 marking code. Fix some comments. Change type of 'clip_changed'
5856 to bitfield. Remove unused #ifndef old.
5857 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5858 (GET_OVERLAYS_AT): Fix indentation.
5859 (for_each_per_buffer_object_at): New macro.
5860 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5861 (Fbuffer_local_variables): Use it.
5862 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5863 * alloc.c (allocate_buffer): Adjust to match new layout of
5864 struct buffer. Fix comment.
5865 (mark_overlay): New function.
5866 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5867 Lisp area of struct buffer.
5868 (mark_object): Use it. Adjust marking of misc objects
5869 and related comments.
5870
5871 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5872
5873 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5874 wrapper that is not needed because the wrapped code is a no-op (zero
5875 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5876 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5877
5878 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5879
5880 * alloc.c (mark_buffer): Simplify. Remove prototype.
5881 (mark_object): Add comment. Reorganize marking of vector-like
5882 objects. Use CHECK_LIVE for all vector-like objects except buffers
5883 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5884 Avoid redundant calls to mark_vectorlike for bool vectors.
5885
5886 2012-06-30 Glenn Morris <rgm@gnu.org>
5887
5888 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5889
5890 * epaths.in (PATH_SITELOADSEARCH): New.
5891 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5892 This is rather than relying on --enable-locallisppath elements
5893 having "site-lisp" in their names. (Bug#10208#25, 11658)
5894
5895 2012-06-30 Eli Zaretskii <eliz@gnu.org>
5896
5897 * w32proc.c (sys_select): Accept and ignore one more argument.
5898
5899 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5900
5901 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5902 (pselect) [!MS_DOS]: Redirect to sys_select.
5903
5904 * sysdep.c: Don't include dos.h and dosfns.h.
5905
5906 * process.c (sys_select):
5907 * msdos.c (sys_select): Accept one more argument and ignore it.
5908
5909 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5910 adapt data types and code to that.
5911
5912 * dosfns.c:
5913 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5914 which clashes with the gnulib function of the same name.
5915
5916 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5917
5918 * font.c (font_style_to_value, font_style_symbolic)
5919 (font_prop_validate_style): Add type checks for values in
5920 font_style_table.
5921
5922 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5923 argument.
5924 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5925 uses.
5926
5927 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5928
5929 * xdisp.c (try_window_id): Undo last change.
5930
5931 * w32.c (getwd): Adjust commentary about startup_dir.
5932 (init_environment): Always call sys_access, even in non-MSVC
5933 builds. Don't chdir to the directory of the Emacs executable.
5934 This undoes code from 1997 which was justified by the need to
5935 "avoid conflicts when removing and renaming directories". But its
5936 downside was that every relative file name was being interpreted
5937 relative to the directory of the Emacs executable, which can never
5938 be TRT. In particular, it broke sys_access when called with
5939 relative file names.
5940 (sys_access): Map GetLastError to errno.
5941
5942 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5943
5944 * window.h (struct window): Change type of 'fringes_outside_margins'
5945 to bitfield. Fix comment. Adjust users accordingly.
5946 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5947 Adjust comment.
5948 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5949 to ptrdiff_t.
5950
5951 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5952
5953 * gnutls.c (emacs_gnutls_handshake):
5954 Add QUIT to make the loop interruptible.
5955
5956 2012-06-29 Glenn Morris <rgm@gnu.org>
5957
5958 * charset.c (init_charset): Make lack of etc/charsets fatal.
5959
5960 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5961
5962 * editfns.c (region_limit): Fix type mismatch.
5963
5964 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5965
5966 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5967 undefined. Convert from xassert to eassert.
5968 * nsmenu.m: Convert from xassert to eassert.
5969 * nsterm.m: Likewise.
5970
5971 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5972
5973 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5974
5975 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5976
5977 Avoid integer overflow on scroll-left and scroll-right.
5978 * window.c (HSCROLL_MAX): New macro.
5979 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5980 overflow when requested scroll falls outside ptrdiff_t range.
5981
5982 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5983
5984 * window.h (struct window): Change type of 'hscroll',
5985 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5986 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5987 Adjust users accordingly.
5988 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5989 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5990 from EMACS_INT to ptrdiff_t.
5991 (make_window): Omit redundant initialization.
5992
5993 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5994
5995 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5996
5997 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5998
5999 * window.h (struct window): Change type of 'use_time' and
6000 'sequence_number' from Lisp_Object to int.
6001 * frame.c (make_frame): Adjust users accordingly.
6002 * print.c (print_object): Likewise.
6003 * window.c (select_window, Fwindow_use_time, make_parent_window)
6004 (make_window): Likewise.
6005
6006 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6007
6008 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6009 enabled with --enable-checking=[all,glyphs] configure option.
6010 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6011 adjust comments accordingly.
6012 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6013 undefined, adjust comments accordingly.
6014 * image.c: Likewise.
6015 * scroll.c: Likewise.
6016 * w32fns.c: Likewise.
6017 * w32term.c: Likewise.
6018 * xdisp.c: Likewise.
6019 * xfaces.c: Likewise.
6020 * xfns.c: Likewise.
6021 * xterm.c: Likewise.
6022
6023 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6024
6025 Generalize run-time debugging checks.
6026 * dispextern.h (XASSERTS): Remove.
6027 * fontset.c (xassert): Remove.
6028 Convert from xassert to eassert.
6029 * alloc.c: Convert from xassert to eassert.
6030 * bidi.c: Likewise.
6031 * dispnew.c: Likewise.
6032 * fns.c: Likewise.
6033 * fringe.c: Likewise.
6034 * ftfont.c: Likewise.
6035 * gtkutil.c: Likewise.
6036 * image.c: Likewise.
6037 * keyboard.c: Likewise.
6038 * menu.c: Likewise.
6039 * process.c: Likewise.
6040 * scroll.c: Likewise.
6041 * sound.c: Likewise.
6042 * term.c: Likewise.
6043 * w32console.c: Likewise.
6044 * w32fns.c: Likewise.
6045 * w32term.c: Likewise.
6046 * window.c: Likewise.
6047 * xdisp.c: Likewise.
6048 * xfaces.c: Likewise.
6049 * xfns.c: Likewise.
6050 * xselect.c: Likewise.
6051 * xterm.c: Likewise.
6052
6053 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6054
6055 * fns.c (maybe_resize_hash_table): Output message when growing the
6056 purify-hashtable.
6057
6058 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6059
6060 * alloc.c (allocate_string_data): Remove dead code.
6061 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6062 avoid GCC warning about unused macro.
6063
6064 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6065
6066 * alloc.c (allocate_string): Omit intervals initialization.
6067 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6068 as in make_pure_string and make_pure_c_string.
6069
6070 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6071
6072 * alloc.c (allocate_string): Fix last change.
6073
6074 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6075
6076 * alloc.c (allocate_string): Remove two redundant calls
6077 to memset, add explicit initialization where appropriate.
6078
6079 2012-06-27 Glenn Morris <rgm@gnu.org>
6080
6081 * lisp.mk (lisp): Remove paths.elc.
6082
6083 2012-06-27 Chong Yidong <cyd@gnu.org>
6084
6085 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6086
6087 2012-06-26 John Wiegley <johnw@newartisans.com>
6088
6089 * unexmacosx.c (copy_data_segment): Add two section names used
6090 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6091
6092 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6093 when building with Clang.
6094
6095 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6096
6097 * eval.c (Fapply): Allow calling it with a single argument.
6098
6099 2012-06-26 Eli Zaretskii <eliz@gnu.org>
6100
6101 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6102 _stricmp and _strnicmp.
6103 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6104
6105 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6106
6107 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6108 allocated window.
6109 (allocate_process): Likewise for new process.
6110 (allocate_terminal): Change to use offsetof.
6111 (allocate_frame): Likewise.
6112 * frame.c (make_frame): Omit redundant initialization.
6113 * window.c (make_parent_window): Use memset.
6114 (make_window): Omit redundant initialization.
6115 * process.c (make_process): Omit redundant initialization.
6116 * terminal.c (create_terminal): Likewise.
6117
6118 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6119
6120 * term.c (delete_tty): Remove redundant call to memset.
6121
6122 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6123
6124 * alloc.c: Remove build_string.
6125 * lisp.h: Define build_string as static inline. This provides
6126 a better opportunity to optimize away calls to strlen when the
6127 function is called with compile-time constant argument.
6128 * image.c (imagemagick_error): Convert to build_string.
6129 * w32proc.c (sys_spawnve): Likewise.
6130 * xterm.c (x_term_init): Likewise.
6131
6132 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6133
6134 Use sprintf return value instead of invoking strlen on result.
6135 In the old days this wasn't portable, since some sprintf
6136 implementations returned char *. But they died out years ago and
6137 Emacs already assumes sprintf returns int.
6138 Similarly for float_to_string.
6139 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6140 * ccl.c (ccl_driver):
6141 * character.c (string_escape_byte8):
6142 * data.c (Fnumber_to_string):
6143 * doprnt.c (doprnt):
6144 * print.c (print_object):
6145 * xdisp.c (message_dolog):
6146 * xfns.c (syms_of_xfns):
6147 Use sprintf or float_to_string result to avoid need to call strlen.
6148 * data.c (Fnumber_to_string):
6149 Use make_unibyte_string, since the string must be ASCII.
6150 * lisp.h, print.c (float_to_string): Now returns int length.
6151 * term.c (produce_glyphless_glyph):
6152 Use sprintf result rather than recomputing it.
6153
6154 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6155 * Makefile.in (ALL_CFLAGS):
6156 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6157 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6158
6159 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6160
6161 * dispextern.h (xstrcasecmp): Define to library function
6162 strcasecmp if available.
6163 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6164
6165 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6166
6167 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6168 Avoid comma operator.
6169 * menu.c (push_submenu_start, push_submenu_end)
6170 (push_left_right_boundary, push_menu_pane): Likewise.
6171 * msdos.c (dos_rawgetc): Likewise.
6172
6173 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6174
6175 * xfns.c (xic_create_fontsetname): Remove redundant calls
6176 to memset.
6177
6178 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6179
6180 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6181 sprintf already null-terminates its output.
6182
6183 * xfns.c (x_window): Remove redundant cast.
6184
6185 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6186
6187 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6188 `const char *' to `char *' to avoid compiler warning.
6189
6190 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6191
6192 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6193 instead of truncating it to 63 (admittedly a generous limit).
6194
6195 * process.c: Fix spelling and caps in comments.
6196
6197 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6198
6199 * emacs.c (setpgrp): Remove definition, unused.
6200 * sysdep.c (setpgrp): Remove definition, not used in this file.
6201
6202 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
6203
6204 * makefile.w32-in: Update dependencies.
6205
6206 2012-06-24 Eli Zaretskii <eliz@gnu.org>
6207
6208 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6209 (SYSTIME_H): Add nt/inc/sys/time.h.
6210
6211 * systime.h [WINDOWSNT]: Include sys/time.h.
6212
6213 * s/ms-w32.h (struct timespec): Definition moved from
6214 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6215
6216 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6217
6218 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6219 * buffer.h (buffer_slot_type_mismatch):
6220 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6221 * eval.c (unwind_to_catch):
6222 * image.c (my_png_error, my_error_exit):
6223 * keyboard.c (quit_throw_to_read_char, user_error)
6224 (Fexit_recursive_edit, Fabort_recursive_edit):
6225 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6226 (wrong_type_argument, buffer_overflow, __executable_start)
6227 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6228 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6229 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6230 (fatal):
6231 (child_setup) [!DOS_NT]:
6232 * lread.c (end_of_file_error, invalid_syntax):
6233 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6234 * puresize.h (pure_write_error):
6235 * search.c (matcher_overflow):
6236 * sound.c (sound_perror, alsa_sound_perror):
6237 * sysdep.c, syssignal.h (croak):
6238 * term.c (maybe_fatal, vfatal):
6239 * textprop.c (text_read_only):
6240 * undo.c (user_error):
6241 * unexmacosx.c (unexec_error):
6242 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6243 Use _Noreturn rather than NO_RETURN.
6244 No need for separate decl merely because of _Noreturn.
6245 * sound.c (sound_warning, parse_sound):
6246 Remove unnecessary forward decls.
6247
6248 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6249
6250 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6251 * lisp.h (WAIT_READING_MAX): New macro.
6252 * dispnew.c (Fsleep_for, sit_for):
6253 * keyboard.c (kbd_buffer_get_event):
6254 * process.c (Faccept_process_output):
6255 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6256 This improves on the previous patch, which introduced a bug
6257 when time_t is unsigned and as wide as intmax_t.
6258 See <http://bugs.gnu.org/9000#51>.
6259
6260 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6261
6262 * dispnew.c (sit_for, Fsleep_for):
6263 * keyboard.c (kbd_buffer_get_event):
6264 * process.c (Faccept_process_output): Avoid compiler warnings when
6265 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6266
6267 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
6268
6269 * makefile.w32-in: Update dependencies.
6270
6271 * w32.c (ltime): Add return type and declare static.
6272 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6273
6274 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6275
6276 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6277 Privately reported by Herbert J. Skuhra.
6278 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6279 All uses changed.
6280 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6281 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6282
6283 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6284
6285 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6286 last argument of make_unibyte_string.
6287
6288 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6289 language ID in the event parameters.
6290
6291 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6292 event.code, not the obscure "character set ID".
6293
6294 2012-06-23 Chong Yidong <cyd@gnu.org>
6295
6296 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6297
6298 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6299
6300 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6301 * w32.c (fdutimens): New function.
6302
6303 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6304
6305 * s/ms-w32.h (pselect): Redirect to sys_select.
6306
6307 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6308
6309 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6310 in the logic of incrementing and decrementing the value of
6311 use_relocatable_buffers.
6312
6313 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6314
6315 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6316 Privately reported by Herbert J. Skuhra.
6317 [__FreeBSD__]: Remove "*/" typo after "#include".
6318 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6319 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6320 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6321 Don't assume EMACS_TIME and struct timeval are the same type.
6322
6323 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6324
6325 Support higher-resolution time stamps (Bug#9000).
6326 The time stamps are only nanosecond-resolution at the C level,
6327 since that's the best that any real-world system supports now.
6328 But they are picosecond-resolution at the Lisp level, as that's
6329 easy, and leaves room for future OS improvements.
6330
6331 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6332 (LIBES): Use it.
6333
6334 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6335 Don't get current time unless it's needed.
6336
6337 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6338 now provides it if it's absent.
6339 (start_atimer): Port to higher-res time stamps.
6340 Check for time stamp overflow. Don't get current time more
6341 often than is needed.
6342
6343 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6344 Include systime.h, not time.h.
6345 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6346
6347 * dired.c: Include stat-time.h.
6348 (Ffile-attributes): File times now have higher resolution.
6349
6350 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6351 (struct image): Timestamp now has higher resolution.
6352
6353 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6354 has at least microseconds now. All uses removed.
6355 (update_frame, update_single_window, update_window, update_frame_1)
6356 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
6357 (duration_to_sec_usec): Remove; no longer needed.
6358
6359 * editfns.c (time_overflow): Now extern.
6360 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6361 (float-time, Fformat_time_string, Fcurrent_time_string)
6362 (Fcurrent_time_zone): Accept and generate higher-resolution
6363 time stamps.
6364 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6365 (decode_time_components, lisp_seconds_argument): New functions.
6366 (make_time): Now static.
6367 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6368 Report an error if the time is invalid, rather than having the caller
6369 do that.
6370
6371 * fileio.c: Include <stat-time.h>
6372 (Fcopy_file): Copy higher-resolution time stamps.
6373 Prefer to set the time stamp via a file descriptor if that works.
6374 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6375 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6376 (Fvisited_file_modtime, Fset_visited_file_modtime):
6377 Support higher-resolution time stamps.
6378
6379 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6380
6381 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6382
6383 * image.c (prepare_image_for_display, clear_image_cache)
6384 (lookup_image): Port to higer-resolution time stamps.
6385
6386 * keyboard.c (start_polling, bind_polling_period):
6387 Check for time stamp overflow.
6388 (read_char, kbd_buffer_get_event, timer_start_idle)
6389 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6390 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6391 Port to higher-resolution time stamps. Do not assume time_t is signed.
6392 (decode_timer): New function. Timers are now vectors of length 9,
6393 not 8, to accommodate the picosecond component.
6394 (timer_check_2): Use it.
6395
6396 * nsterm.m (select_timeout, timeval_subtract): Remove.
6397 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6398 as they're a bit more accurate and handle overflow better.
6399 (ns_select): Change prototype to be compatible with pselect.
6400 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6401 * nsterm.h (ns_select): Adjust prototype.
6402
6403 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6404 us-resolution time stamps.
6405 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6406
6407 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6408
6409 * lisp.h (time_overflow): New decl.
6410 (wait_reading_process_output): First arg is now intmax_t, not int,
6411 to accommodate larger waits.
6412
6413 * process.h (struct Lisp_Process.read_output_delay):
6414 Now counts nanoseconds, not microseconds.
6415 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6416 EMACS_HAS_USECS.
6417 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6418 (wait_reading_process_output):
6419 Port to ns-resolution time stamps.
6420 (Faccept_process_output, wait_reading_process_output):
6421 Check for time stamp overflow. Do not assume time_t is signed.
6422 (select_wrapper): Remove; we now use pselect.
6423 (Fprocess_attributes): Now generates ns-resolution time stamps.
6424
6425 * sysdep.c: Include utimens.h. Don't include utime.h
6426 or worry about struct utimbuf; gnulib does that for us now.
6427 (gettimeofday): Remove; gnulib provides a substitute.
6428 (make_timeval): New function.
6429 (set_file_times): Now sets ns-resolution time stamps.
6430 New arg FD; all uses changed.
6431 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6432 (system_process_attributes):
6433 Now returns ns-resolution time stamp. All uses changed.
6434 Check for time stamp overflow.
6435
6436 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6437 provides a substitute now.
6438
6439 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6440 since it guarantees struct timespec.
6441 (EMACS_TIME): Now struct timespec, so that we can support
6442 ns-resolution time stamps.
6443 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6444 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6445 (EMACS_USECS): Remove.
6446 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6447 so multiply the arg by 1000 before storing it.
6448 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6449 New macros.
6450 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6451 Port to ns-resolution time stamps.
6452 (EMACS_TIME_NEG_P): Remove; replaced by....
6453 (EMACS_TIME_SIGN): New macro.
6454 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6455 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6456 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6457 (make_timeval, make_lisp_time, decode_time_components): New decls.
6458 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6459 that it mishandled time_t overflow. You can't compare by subtracting!
6460 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6461 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6462
6463 * term.c: Include <sys/time.h>.
6464 (timeval_to_Time): New function, for proper overflow wraparound.
6465 (term_mouse_position, term_mouse_click): Use it.
6466
6467 * undo.c (record_first_change): Support higher-resolution time stamps
6468 in the undo buffer.
6469 (Fprimitive_undo): Use them when restoring time stamps.
6470
6471 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6472 (w32_get_internal_run_time):
6473 Port to higher-resolution Emacs time stamps.
6474 (ltime): Now accepts single 64-bit integer, as that's more convenient
6475 for callers.
6476
6477 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6478
6479 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6480 for compatibility with pselect. Support ns-resolution time stamps.
6481
6482 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6483
6484 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6485 Check for time stamp overflow, and support ns-resolution time stamps.
6486
6487 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6488 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6489 (timeval_subtract): Remove; no longer needed.
6490 (XTflash, XTring_bell, x_wait_for_event):
6491 Port to ns-resolution time stamps. Don't assume time_t is signed.
6492
6493 2012-06-22 Chong Yidong <cyd@gnu.org>
6494
6495 * xdisp.c (x_consider_frame_title): Revert last change.
6496
6497 2012-06-22 Eli Zaretskii <eliz@gnu.org>
6498
6499 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6500 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6501 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6502 staticidx goes up to 1597 out of 1600 = 0x640.)
6503
6504 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6505
6506 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6507 Otherwise, the umask might be mistakenly 0 while handling input signals.
6508
6509 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6510
6511 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6512
6513 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6514
6515 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6516 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6517 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6518 access to `contents' member of Lisp_Vector objects with AREF and ASET
6519 where appropriate.
6520
6521 2012-06-19 Chong Yidong <cyd@gnu.org>
6522
6523 * frame.c (delete_frame): When selecting a frame on a different
6524 text terminal, do not alter the terminal's top-frame.
6525
6526 * xdisp.c (format_mode_line_unwind_data): Record the target
6527 frame's selected window and its terminal's top-frame.
6528 (unwind_format_mode_line): Restore them.
6529 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6530 Callers changed.
6531 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6532 since tty frames can be explicitly named.
6533 (prepare_menu_bars): Likewise.
6534
6535 * term.c (Ftty_top_frame): New function.
6536
6537 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6538
6539 Port byte-code-meter to modern targets.
6540 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6541 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6542 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6543 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6544 (METER_1, METER_2): Simplify.
6545
6546 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6547
6548 * data.c (Fdefalias): Return `symbol' (bug#11686).
6549
6550 2012-06-18 Martin Rudalics <rudalics@gmx.at>
6551
6552 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6553 gets killed during executing of this function (Bug#11665).
6554 Try to always return Qt when the buffer has been actually killed.
6555 (Vkill_buffer_query_functions): In doc-string say that functions
6556 run by this hook should not change the current buffer.
6557
6558 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6559
6560 Fix recently-introduced process.c problems found by static checking.
6561 * process.c (write_queue_push, write_queue_pop, send_process):
6562 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6563 (write_queue_pop): Fix pointer signedness problem.
6564 (send_process): Remove unused local.
6565
6566 2012-06-17 Chong Yidong <cyd@gnu.org>
6567
6568 * xdisp.c (redisplay_internal): No need to redisplay terminal
6569 frames that are not on top.
6570
6571 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
6572
6573 * process.c (make_process): Initialize write_queue.
6574 (write_queue_push, write_queue_pop): New functions.
6575 (send_process): Use them to maintain correct ordering of process
6576 writes (Bug#10815).
6577
6578 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6579
6580 * lisp.h (eassert): Assume C89 or later.
6581 This removes the need for CHECK.
6582 (CHECK): Remove. Its comments about always evaluating its
6583 argument were confusing, as 'eassert' typically does not evaluate
6584 its argument.
6585
6586 * coding.c (produce_chars): Use ptrdiff_t, not int.
6587
6588 * xterm.c (x_draw_underwave): Check for integer overflow.
6589 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6590
6591 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
6592
6593 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6594 referenced (Bug#11583).
6595
6596 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6597
6598 Implement wave-style variant of underlining.
6599 * dispextern.h (face_underline_type): New enum.
6600 (face): Add field for underline type.
6601 * nsterm.m (ns_draw_underwave): New function.
6602 (ns_draw_text_decoration): Use it.
6603 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6604 New functions.
6605 (x_draw_glyph_string): Use them.
6606 * xfaces.c (Qline, Qwave): New Lisp objects.
6607 (check_lface_attrs, merge_face_ref)
6608 (Finternal_set_lisp_face_attribute, realize_x_face):
6609 Handle wave-style underline face attributes.
6610 * xterm.c (x_draw_underwave): New function.
6611 (x_draw_glyph_string): Use it.
6612
6613 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
6614
6615 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6616 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6617 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6618 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6619 ($(BLD)/w32select.$(O)): Update dependencies.
6620
6621 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6622
6623 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6624 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6625 * character.c (_fetch_multibyte_char_p): Remove.
6626 * alloc.c: Include "character.h" before "buffer.h".
6627 * bidi.c: Likewise.
6628 * buffer.c: Likewise.
6629 * bytecode.c: Likewise.
6630 * callint.c: Likewise.
6631 * callproc.c: Likewise.
6632 * casefiddle.c: Likewise.
6633 * casetab.c: Likewise.
6634 * category.c: Likewise.
6635 * cmds.c: Likewise.
6636 * coding.c: Likewise.
6637 * composite.c: Likewise.
6638 * dired.c: Likewise.
6639 * dispnew.c: Likewise.
6640 * doc.c: Likewise.
6641 * dosfns.c: Likewise.
6642 * editfns.c: Likewise.
6643 * emacs.c: Likewise.
6644 * fileio.c: Likewise.
6645 * filelock.c: Likewise.
6646 * font.c: Likewise.
6647 * fontset.c: Likewise.
6648 * fringe.c: Likewise.
6649 * indent.c: Likewise.
6650 * insdel.c: Likewise.
6651 * intervals.c: Likewise.
6652 * keyboard.c: Likewise.
6653 * keymap.c: Likewise.
6654 * lread.c: Likewise.
6655 * macros.c: Likewise.
6656 * marker.c: Likewise.
6657 * minibuf.c: Likewise.
6658 * nsfns.m: Likewise.
6659 * nsmenu.m: Likewise.
6660 * print.c: Likewise.
6661 * process.c: Likewise.
6662 * regex.c: Likewise.
6663 * region-cache.c: Likewise.
6664 * search.c: Likewise.
6665 * syntax.c: Likewise.
6666 * term.c: Likewise.
6667 * textprop.c: Likewise.
6668 * undo.c: Likewise.
6669 * unexsol.c: Likewise.
6670 * w16select.c: Likewise.
6671 * w32fns.c: Likewise.
6672 * w32menu.c: Likewise.
6673 * window.c: Likewise.
6674 * xdisp.c: Likewise.
6675 * xfns.c: Likewise.
6676 * xmenu.c: Likewise.
6677 * xml.c: Likewise.
6678 * xselect.c: Likewise.
6679
6680 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6681
6682 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6683 If all the glyphs of the glyph row came from strings, and we have no
6684 cursor positioning clues, put the cursor on the first glyph of the
6685 row.
6686 (handle_face_prop): Use chunk-relative overlay string index when
6687 indexing into it->string_overlays array. (Bug#11653)
6688 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6689 the rightmost. (Bug#11720)
6690
6691 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6692
6693 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6694 (CATEGORY_MEMBER): Enforce 1/0 value.
6695 * category.c (_temp_category_set): Remove.
6696
6697 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6698
6699 * window.c (Fdelete_other_windows_internal)
6700 (Fdelete_window_internal): Don't access frame's mouse highlight
6701 info of the initial frame. (Bug#11677)
6702
6703 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6704
6705 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6706 Assume USE_2_TAGS_FOR_INTS.
6707 (xreload): Adjust $tagmask width to match recent lisp.h change.
6708
6709 Simplify lisp.h in minor ways that should not affect code.
6710 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6711 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6712 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6713 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6714 (INTTYPEBITS): New macro, for clarity.
6715 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6716 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6717 Simplify now that USE_LSB_TAG is always defined.
6718 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6719 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6720
6721 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
6722
6723 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6724
6725 2012-06-13 Glenn Morris <rgm@gnu.org>
6726
6727 * s/bsd-common.h (BSD4_3):
6728 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6729
6730 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6731
6732 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6733 instead of union.
6734 (XLI, XIL): Define.
6735 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6736 Use them.
6737 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6738 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6739 * alloc.c (widen_to_Lisp_Object): Remove.
6740 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6741 * frame.c (delete_frame): Remove outdated comment.
6742 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6743 USE_LISP_UNION_TYPE.
6744 (Fw32_unregister_hot_key): Likewise.
6745 (Fw32_toggle_lock_key): Likewise.
6746 * w32menu.c (add_menu_item): Likewise.
6747 (w32_menu_display_help): Use XIL instead of checking
6748 USE_LISP_UNION_TYPE.
6749 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6750 (init_heap): Likewise.
6751 * w32term.c (w32_read_socket): Update comment.
6752
6753 2012-06-13 Glenn Morris <rgm@gnu.org>
6754
6755 * s/usg5-4-common.h, src/s/unixware.h:
6756 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6757
6758 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6759
6760 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6761
6762 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6763 * alloc.c (make_number) [!defined make_number]:
6764 Remove, as lisp.h always defines this now.
6765 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6766 (roundup_size): Verify that it is a power of 2.
6767 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6768 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6769 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6770 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6771 USE_LSB_TAG now is always defined to be either 0 or 1.
6772 All uses changed.
6773 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6774 code works fine either way, and efficiency is not a concern here,
6775 as the union type is for debugging, not for production.
6776 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6777 Use an inline function on all platforms when using the union type,
6778 since this is simpler and 'static inline' can be used portably
6779 within Emacs now.
6780 (LISP_INITIALLY_ZERO): New macro.
6781 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6782 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6783
6784 2012-06-12 Glenn Morris <rgm@gnu.org>
6785
6786 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6787
6788 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6789
6790 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6791 Move BROKEN_SIGIO to configure.
6792
6793 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6794 Move NO_TERMIO to configure.
6795
6796 2012-06-12 Chong Yidong <cyd@gnu.org>
6797
6798 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6799 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6800 MagickExportImagePixels is undefined.
6801
6802 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6803
6804 * image.c (imagemagick_load_image): Remove unused label.
6805
6806 2012-06-11 Glenn Morris <rgm@gnu.org>
6807
6808 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6809 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6810 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6811 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6812
6813 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6814
6815 * alloc.c (make_byte_code): New function.
6816 (Fmake_byte_code): Use it. Don't purify here.
6817 * lread.c (read1): Use it as well to avoid extra allocation.
6818
6819 2012-06-11 Chong Yidong <cyd@gnu.org>
6820
6821 * image.c (imagemagick_load_image): Implement transparency.
6822
6823 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6824
6825 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6826 account for preceding backslashes. (Bug#11663)
6827
6828 2012-06-09 Chong Yidong <cyd@gnu.org>
6829
6830 * term.c: Support italics in capable terminals (Bug#9652).
6831 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6832 (turn_on_face): Output using TS_enter_italic_mode if available.
6833 Don't handle unused blinking and alt-charset cases.
6834 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6835 and tty_alt_charset_p cases.
6836 (tty_capable_p, init_tty): Support italics.
6837
6838 * termchar.h (struct tty_display_info): Add field for italics.
6839 Remove unused blink field.
6840
6841 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6842 Handle slant.
6843
6844 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6845 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6846 tty_alt_charset_p. Add tty_italic_p.
6847
6848 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
6849
6850 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6851 dbus_type_is_basic if available.
6852 (xd_extract_signed, xd_extract_unsigned): Rename from
6853 extract_signed and extract_unsigned, respectively. Adapt callers.
6854
6855 2012-06-09 Chong Yidong <cyd@gnu.org>
6856
6857 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6858
6859 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6860 case (Bug#9752).
6861
6862 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6863
6864 * xdisp.c (vmessage): Treat frame message as multibyte.
6865 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6866 would generate the diagnostic "Making \302\247 buffer-local while
6867 let-bound!".
6868
6869 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6870
6871 * dispnew.c (showing_window_margins_p): Undo last change, which
6872 was done due to an inadvertent commit.
6873 (adjust_frame_glyphs_for_frame_redisplay): Do call
6874 showing_window_margins_p.
6875
6876 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6877
6878 * eval.c (Fmake_var_non_special): New primitive.
6879 (syms_of_eval): Defsubr it.
6880 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6881
6882 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
6883
6884 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6885 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6886
6887 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6888
6889 * alloc.c (allocate_vectorlike): Fix last change.
6890
6891 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6892
6893 Block-based vector allocation of small vectors.
6894 * lisp.h (struct vectorlike_header): New field `nbytes',
6895 adjust comment accordingly.
6896 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6897 to denote vector blocks. Adjust users (live_vector_p,
6898 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6899 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6900 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6901 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6902 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6903 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6904 (roundup_size): New constant.
6905 (struct vector_block): New data type.
6906 (vector_blocks, vector_free_lists, zero_vector): New variables.
6907 (all_vectors): Rename to `large_vectors'.
6908 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6909 (sweep_vectors): New functions.
6910 (allocate_vectorlike): Return `zero_vector' as the only vector of
6911 0 items. Allocate new vector from block if vector size is less than
6912 or equal to VBLOCK_BYTES_MAX.
6913 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6914 (init_alloc_once): Add call to init_vectors.
6915
6916 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6917
6918 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6919
6920 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6921
6922 * doprnt.c (doprnt): Truncate multibyte char correctly.
6923 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6924 would mishandle a string argument "Xc" if X was a multibyte
6925 character of length 2: it would truncate after X's first byte
6926 rather than including all of X.
6927
6928 2012-06-06 Chong Yidong <cyd@gnu.org>
6929
6930 * buffer.c (word_wrap): Doc fix.
6931
6932 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6933
6934 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6935
6936 2012-06-03 Glenn Morris <rgm@gnu.org>
6937
6938 * xdisp.c (tool-bar-style): Doc fix.
6939
6940 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6941
6942 * Makefile.in (PAXCTL): Define.
6943 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6944 binary via PaX flags if the paxctl utility is available.
6945 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6946 Restore PaX flags to their default. (Bug#11398)
6947
6948 2012-06-03 Chong Yidong <cyd@gnu.org>
6949
6950 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6951 buffer (Bug#11226).
6952
6953 2012-06-03 Chong Yidong <cyd@gnu.org>
6954
6955 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6956 (note_mode_line_or_margin_highlight): If there is no help echo,
6957 use mode-line-default-help-echo. Handle the case where the mouse
6958 position is past the end of the mode line string.
6959
6960 * buffer.c (buffer_local_value_1): New function, split from
6961 Fbuffer_local_value; can return Qunbound.
6962 (Fbuffer_local_value): Use it.
6963 (Vmode_line_format): Docstring tweaks.
6964
6965 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6966
6967 * sysdep.c (system_process_attributes): Improve comment.
6968
6969 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6970
6971 * keyboard.c: Export real-this-command to Elisp.
6972 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6973 and DEFVAR it. Update all users.
6974
6975 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6976
6977 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6978
6979 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6980 Convert pctcpu and pctmem to Lisp float properly.
6981 Let the compiler fold better, as 100.0/0x8000 is exact.
6982
6983 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6984
6985 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6986 cons_block.
6987
6988 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6989
6990 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6991
6992 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6993
6994 For a 'struct window', replace some Lisp_Object fields to
6995 bitfields where appropriate, remove unused fields.
6996 * window.h (struct window): Remove unused 'last_mark_x' and
6997 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6998 change it's type from Lisp_Object to bitfield.
6999 Change type of 'force_start', 'optional_new_start',
7000 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7001 fields from Lisp_Object to bitfield. Adjust users accordingly.
7002
7003 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7004
7005 Pacify gcc -Wdouble-precision when using Xaw.
7006 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7007 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7008 Use 'float' consistently, rather than 'float' in most places
7009 and 'double' in a couple of places.
7010
7011 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7012
7013 * xdisp.c (handle_stop): Detect whether we have overlay strings
7014 loaded by testing it->current.overlay_string_index to be
7015 non-negative, instead of checking whether n_overlay_strings is
7016 positive. (Bug#11587)
7017
7018 2012-05-31 Chong Yidong <cyd@gnu.org>
7019
7020 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7021
7022 * doc.c (Fsubstitute_command_keys): Doc fix.
7023
7024 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7025
7026 * search.c (search_buffer): Remove calls to
7027 r_alloc_inhibit_buffer_relocation, as it is now called by
7028 maybe_unify_char, which was the cause of relocation of buffer text
7029 in bug#11519.
7030
7031 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7032
7033 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7034 for the duration of call to load_charset, to avoid problems with
7035 callers of maybe_unify_char that access buffer text through C
7036 pointers.
7037
7038 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7039 decrement the inhibition flag, instead of just setting or
7040 resetting it.
7041
7042 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7043
7044 Remove obsolete '#define static' cruft.
7045 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7046 This #undef was "temporary" in 2000; it is no longer needed
7047 now that '#define static' has gone away.
7048 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7049 (gray_bitmap_bits): Remove; no longer needed.
7050 All uses replaced with definiens.
7051 * xterm.c: Include "bitmaps/gray.xbm".
7052
7053 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7054
7055 Clean up __executable_start, monstartup when --enable-profiling.
7056 The following changes affect the code only when profiling.
7057 * dispnew.c (__executable_start): Rename from safe_bcopy.
7058 Define only on platforms that need it.
7059 * emacs.c: Include <sys/gmon.h> when profiling.
7060 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7061 (__executable_start): Remove decl, since lisp.h does it now.
7062 (safe_bcopy): Remove decl; no longer has that name.
7063 (main): Coalesce #if into single bit of code, for simplicity.
7064 Cast pointers to uintptr_t, since standard libraries want integers
7065 and not pointers.
7066 * lisp.h (__executable_start): New decl.
7067
7068 2012-05-31 Glenn Morris <rgm@gnu.org>
7069
7070 * image.c (Fimagemagick_types): Doc fix.
7071
7072 2012-05-30 Jim Meyering <meyering@redhat.com>
7073
7074 * callproc.c (Fcall_process_region): Include directory component
7075 in mkstemp error message (Bug#11586).
7076
7077 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7078
7079 * alloc.c, lisp.h (make_pure_vector): Now static.
7080
7081 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7082
7083 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7084 Move to byte-run.el.
7085 (Fautoload): Do the hash-doc more carefully.
7086 * data.c (Fdefalias): Purify definition, except for keymaps.
7087 (Qdefun): Move from eval.c.
7088 * lisp.h (Qdefun): Remove.
7089 * lread.c (read1): Tiny simplification.
7090
7091 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
7092
7093 Do not create empty overlays with the evaporate property (Bug#9642).
7094 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7095 Bug#9642, but explicitly check that the buffer the overlay would
7096 be moved to is live and rearrange lines to make sure that errors
7097 will not put the overlay in an inconsistent state.
7098 (Fdelete_overlay): Cosmetics.
7099
7100 2012-05-28 Eli Zaretskii <eliz@gnu.org>
7101
7102 * w32term.c (my_bring_window_to_top): New function.
7103 (x_raise_frame): Use handle returned by DeferWindowPos, which
7104 could be different from the original one.
7105 Call my_bring_window_to_top instead of my_set_foreground_window.
7106 (Bug#11513)
7107
7108 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7109 by calling BringWindowToTop.
7110
7111 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7112 (WM_EMACS_END): Increase by one.
7113
7114 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7115
7116 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7117 This avoids undefined behavior that might cause the eassert
7118 to not catch an out-of-range value.
7119
7120 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
7121
7122 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7123 Update dependencies.
7124
7125 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7126
7127 * bidi.c (bidi_mirror_char): Fix last change.
7128
7129 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7130
7131 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7132 when referring to sectname field in printf format.
7133
7134 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7135
7136 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7137 Only r_alloc_inhibit_buffer_relocation needed to be added;
7138 the others were already declared.
7139
7140 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7141 before checking whether it's out of range. Put the check inside
7142 eassert. See
7143 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7144
7145 2012-05-27 Ken Brown <kbrown@cornell.edu>
7146
7147 * callproc.c (Fcall_process): Restore a line that was accidentally
7148 commented out in the 2011-02-13 change (bug#11547).
7149
7150 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7151
7152 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7153 defined on ralloc.c.
7154
7155 * buffer.c [REL_ALLOC]: Remove prototypes of
7156 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7157 they are now on lisp.h.
7158
7159 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7160
7161 * search.c (search_buffer): Use it to inhibit relocation of buffer
7162 text while re_search_2 is doing its job, because re_search_2 is
7163 passed C pointers to buffer text. (Bug#11519)
7164
7165 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7166 Update value to 24.
7167
7168 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7169 state after an additional call to move_it_in_display_line_to, keep
7170 the values of it->max_ascent and it->max_descent found for the
7171 entire line.
7172 (pos_visible_p): Revert the comparison against bottom_y to what it
7173 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7174 (Bug#11464)
7175
7176 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7177
7178 Fix coding-related core dumps with gcc -ftrapv.
7179 The code was computing A - B, where A and B are pointers, and B is
7180 random garbage. This can lead to core dumps on platforms that
7181 have special pointer registers, and it also leads to core dumps on
7182 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7183 A - B only when B is initialized properly.
7184 * coding.c (coding_set_source, coding_set_destination): Return void.
7185 (coding_change_source, coding_change_destinations): New functions,
7186 with the old behaviors of coding_set_source and coding_set_destination.
7187 All callers that need an offset changed to use these new functions.
7188
7189 2012-05-26 Glenn Morris <rgm@gnu.org>
7190
7191 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7192
7193 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7194
7195 Extend mouse support on W32 text-mode console.
7196 * xdisp.c (draw_row_with_mouse_face):
7197 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7198
7199 * w32console.c: Include window.h.
7200 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7201 New functions.
7202 (initialize_w32_display): Initialize mouse-highlight data.
7203
7204 * w32inevt.c: Include termchar.h and window.h.
7205 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7206 moves, call note_mouse_highlight. If help_echo changed, call
7207 gen_help_event to produce help-echo message in the echo area.
7208 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7209 highlight info.
7210
7211 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7212
7213 * lread.c (read1): Simplify slightly to avoid an overflow warning
7214 with GCC 4.7.0 on x86-64.
7215
7216 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7217
7218 * bidi.c (bidi_mirror_char): Revert last change: an int is
7219 definitely wide enough here.
7220
7221 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
7222
7223 Fix integer width and related bugs (Bug#9874).
7224 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7225 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7226 (string_bytes, check_sblock, allocate_string_data):
7227 (compact_small_strings, Fmake_bool_vector, make_string)
7228 (make_unibyte_string, make_multibyte_string)
7229 (make_string_from_bytes, make_specified_string)
7230 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7231 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7232 (mark_vectorlike):
7233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7234 (allocate_pseudovector):
7235 Use int, not EMACS_INT, where int is wide enough.
7236 (inhibit_garbage_collection, Fgarbage_collect):
7237 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7238 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7239 int might not be wide enough.
7240 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7241 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7242 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7243 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7244 (bidi_level_of_next_char, bidi_move_to_visually_next):
7245 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7246 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7247 (Fkill_buffer, Fset_buffer_major_mode)
7248 (advance_to_char_boundary, Fbuffer_swap_text)
7249 (Fset_buffer_multibyte, overlays_at, overlays_in)
7250 (overlay_touches_p, struct sortvec, record_overlay_string)
7251 (overlay_strings, recenter_overlay_lists)
7252 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7253 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7254 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7255 (Foverlay_recenter, last_overlay_modification_hooks_used)
7256 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7257 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7258 (validate_region): Omit unnecessary test for b <= e,
7259 since that's guaranteed by the previous test.
7260 (adjust_overlays_for_delete): Avoid pos + length overflow.
7261 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7262 (report_overlay_modification):
7263 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7264 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7265 Omit pointer cast, which isn't needed anyway, and doesn't work
7266 after the EMACS_INT -> ptrdiff_t change.
7267 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7268 * buffer.h: Adjust decls to match defn changes elsewhere.
7269 (struct buffer_text, struct buffer):
7270 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7271 Use EMACS_INT, not int, where int might not be wide enough.
7272 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7273 not int, to avoid needless 32-bit limit on 64-bit hosts.
7274 (exec_byte_code): Use tighter memory-full test, one that checks
7275 for alloca overflow. Don't compute the address of the object just
7276 before an array, as that's not portable. Use EMACS_INT, not
7277 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7278 * callint.c (Fcall_interactively):
7279 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7280 * callproc.c (call_process_kill, Fcall_process):
7281 Don't assume pid_t fits into an Emacs fixnum.
7282 (call_process_cleanup, Fcall_process, child_setup):
7283 Don't assume pid_t fits into int.
7284 (call_process_cleanup, Fcall_process, delete_temp_file)
7285 (Fcall_process_region):
7286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7287 (Fcall_process): Simplify handling of volatile integers.
7288 Use int, not EMACS_INT, where int will do.
7289 * casefiddle.c (casify_object, casify_region, operate_on_word)
7290 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7291 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7292 (casify_object): Avoid integer overflow when overallocating buffer.
7293 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7294 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
7295 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7296 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7297 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7298 integers are now checked earlier. All uses replaced with XINT.
7299 (ccl_driver):
7300 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7301 For CCL_MapSingle, check that content and value are in int range.
7302 (ccl_driver, Fregister_code_conversion_map):
7303 Check that Vcode_version_map_vector is a vector.
7304 (resolve_symbol_ccl_program): Check that vector header is in range.
7305 Always copy the vector, so that we can check its contents reliably
7306 now rather than having to recheck each instruction as it's being
7307 executed. Check that vector words fit in 'int'.
7308 (ccl_get_compiled_code, Fregister_ccl_program)
7309 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7310 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7311 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7312 contents are in range.
7313 (Fccl_execute_on_string): Check that status is in range.
7314 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7315 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7316 Accept and return EMACS_INT, not int, because callers can pass values
7317 out of 'int' range.
7318 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7319 (multibyte_chars_in_text, parse_str_as_multibyte)
7320 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7321 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7322 (string_escape_byte8, Fget_byte):
7323 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7324 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7325 avoid mishandling large integers.
7326 * character.h: Adjust decls to match defn changes elsewhere.
7327 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7328 (Ffind_charset_region):
7329 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7330 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7331 (load_charset_map_from_vector, Fdefine_charset_internal):
7332 Don't assume fixnum fits in int.
7333 (load_charset_map_from_vector, Fmap_charset_chars):
7334 Remove now-unnecessary CHECK_NATNUMs.
7335 (Fdefine_charset_internal): Check ranges here, more carefully.
7336 Don't rely on undefined behavior with signed left shift overflow.
7337 Don't assume unsigned int fits into fixnum, or that fixnum fits
7338 into unsigned int. Don't require max_code to be a valid fixnum;
7339 that's not true for gb10830 4-byte on a 32-bit host. Allow
7340 invalid_code to be a cons, for the same reason. Require code_offset
7341 to be a character. Avoid int overflow if max_char is close
7342 to INT_MAX.
7343 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7344 this is intended anyway and avoids some undefined behavior.
7345 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7346 INDEX_TO_CODE_POINT, as that's what it expects.
7347 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
7348 * charset.h (DECODE_CHAR): Return int, not unsigned;
7349 this is what was intended anyway, and it avoids undefined behavior.
7350 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7351 integer-overflow issues.
7352 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7353 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7354 where the argument is EMACS_INT, and this behavior is not intended.
7355 * chartab.c (Fmake_char_table, Fset_char_table_range)
7356 (uniprop_get_decoder, uniprop_get_encoder):
7357 Don't assume fixnum fits in int.
7358 * cmds.c (move_point): New function, that does the gist of
7359 Fforward_char and Fbackward_char, but does so while checking
7360 for integer overflow more accurately.
7361 (Fforward_char, Fbackward_char): Use it.
7362 (Fforward_line, Fend_of_line, internal_self_insert)
7363 (internal_self_insert):
7364 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7365 Fix a FIXME, by checking for integer overflow when calculating
7366 target_clm and actual_clm.
7367 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
7368 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
7369 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7370 (coding_alloc_by_making_gap, alloc_destination)
7371 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7372 (encode_coding_utf_16, detect_coding_emacs_mule)
7373 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7374 (detect_coding_iso_2022, decode_coding_iso_2022)
7375 (encode_invocation_designation, encode_designation_at_bol)
7376 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7377 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7378 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7379 (encode_coding_ccl, encode_coding_raw_text)
7380 (detect_coding_charset, decode_coding_charset)
7381 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7382 (produce_composition, produce_charset, produce_annotation)
7383 (decode_coding, handle_composition_annotation)
7384 (handle_charset_annotation, consume_chars, decode_coding_gap)
7385 (decode_coding_object, encode_coding_object, detect_coding_system)
7386 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7387 (code_convert_region, code_convert_string)
7388 (Fdefine_coding_system_internal)
7389 (coding_set_source, coding_set_destination):
7390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7391 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7392 (Fdefine_coding_system_internal):
7393 Don't assume fixnums fit in int.
7394 (decode_coding_gap, decode_coding_object, encode_coding_object)
7395 (Fread_coding_system, Fdetect_coding_region)
7396 (Funencodable_char_position, Fcheck_coding_systems_region)
7397 (get_translation, handle_composition_annotation, consume_chars):
7398 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7399 (consume_chars): Rewrite to not calculate an address outside buffer.
7400 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7401 Don't access memory outside of the args array.
7402 (Fdefine_coding_system_internal): Check for charset-id overflow.
7403 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7404 result of ENCODE_CHAR.
7405 * coding.h: Adjust decls to match defn changes elsewhere.
7406 (struct coding_system):
7407 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7408 * composite.c (get_composition_id, find_composition)
7409 (run_composition_function, update_compositions)
7410 (compose_text, composition_gstring_put_cache)
7411 (composition_gstring_p, composition_gstring_width)
7412 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7413 (composition_compute_stop_pos, composition_reseat_it)
7414 (composition_update_it, struct position_record)
7415 (find_automatic_composition, composition_adjust_point)
7416 (Fcomposition_get_gstring, Ffind_composition_internal):
7417 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7418 (update_compositions):
7419 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7420 * composite.h: Adjust decls to match defn changes elsewhere.
7421 (struct composition):
7422 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7423 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7424 Do not attempt to compute the address of the object just before a
7425 buffer; this is not portable.
7426 (Faref, Faset):
7427 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7428 (Faset): Use int, not EMACS_INT, where int is wide enough.
7429 (Fstring_to_number): Don't assume fixnums fit in int.
7430 (Frem): Don't assume arg is nonnegative.
7431 * dbusbind.c (xd_append_arg): Check for integers out of range.
7432 (Fdbus_call_method): Don't overflow the timeout int.
7433 (extract_signed, extract_unsigned): New functions.
7434 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7435 (xd_get_connection_references): Return ptrdiff_t, not int.
7436 All uses changed.
7437 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7438 (xd_read_message_1):
7439 Use int, not unsigned, where the dbus API uses int.
7440 (Fdbus_message_internal): Don't overflow mtype.
7441 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7442 * dired.c (directory_files_internal, file_name_completion, scmp)
7443 (file_name_completion_stat):
7444 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7445 (file_name_completion): Don't overflow matchcount.
7446 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7447 * dispextern.h: Adjust decls to match defn changes elsewhere.
7448 (struct text_pos, struct glyph, struct bidi_saved_info)
7449 (struct bidi_string_data, struct bidi_it, struct composition_it)
7450 (struct it):
7451 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7452 (struct display_pos, struct composition_it, struct it):
7453 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7454 * dispnew.c (increment_matrix_positions)
7455 (increment_row_positions, mode_line_string)
7456 (marginal_area_string):
7457 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7458 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7459 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7460 (duration_to_sec_usec): New function, to check for overflow better.
7461 (Fsleep_for, sit_for): Use it.
7462 * doc.c (get_doc_string, store_function_docstring):
7463 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7464 (get_doc_string, Fsnarf_documentation):
7465 Use int, not EMACS_INT, where int is wide enough.
7466 (get_doc_string):
7467 Use SAFE_ALLOCA, not alloca.
7468 Check for overflow when converting EMACS_INT to off_t.
7469 * doprnt.c (doprnt):
7470 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7471 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7472 Don't assume uid_t fits into fixnum.
7473 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7474 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7475 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7476 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7477 (general_insert_function)
7478 (Finsert_char, make_buffer_string, make_buffer_string_both)
7479 (update_buffer_properties, Fbuffer_substring)
7480 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7481 (Fsubst_char_in_region, check_translation)
7482 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7483 (transpose_markers, Ftranspose_regions):
7484 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7485 (clip_to_bounds): Move to lisp.h as an inline function).
7486 (Fconstrain_to_field): Don't assume integers are nonnegative.
7487 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7488 (Fsubst_char_in_region, Fsave_restriction):
7489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7490 (Femacs_pid): Don't assume pid_t fits into fixnum.
7491 (lo_time): Use int, not EMACS_INT, when int suffices.
7492 (lisp_time_argument): Check for usec out of range.
7493 (Fencode_time): Don't assume fixnum fits in int.
7494 (Fuser_login_name, Fuser_full_name): Signal an error
7495 if a uid argument is out of range, rather than relying on
7496 undefined behavior.
7497 (Fformat_time_string): Remove now-unnecessary check.
7498 lisp_time_argument checks for out-of-range usec now.
7499 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7500 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7501 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7502 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7503 (init_cmdargs, Fdump_emacs):
7504 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7505 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7506 the bottom (typically) 32 bits of the fixnum.
7507 * eval.c (specpdl_size, call_debugger):
7508 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7509 (when_entered_debugger, Fbacktrace_debug):
7510 Don't assume fixnum can fit in int.
7511 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7512 the object just before a buffer; this is not portable.
7513 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7514 (grow_specpdl, unbind_to):
7515 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7516 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7517 (grow_specpdl): Simplify allocation by using xpalloc.
7518 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7519 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7520 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7521 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7522 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7523 (a_write, e_write):
7524 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7525 (Fcopy_file, non_regular_nbytes, read_non_regular)
7526 (Finsert_file_contents):
7527 Use int, not EMACS_INT, where int is wide enough.
7528 (READ_BUF_SIZE): Verify that it fits in int.
7529 (Finsert_file_contents): Check that counts are in proper range,
7530 rather than assuming fixnums fit into ptrdiff_t etc.
7531 Don't assume fixnums fit into int.
7532 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7533 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7534 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7535 (string_char_to_byte, string_byte_to_char)
7536 (string_make_multibyte, string_to_multibyte)
7537 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7538 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7539 (substring_both, Fdelete, internal_equal, Ffillarray)
7540 (Fclear_string, mapcar1)
7541 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7542 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7543 (larger_vector, make_hash_table, maybe_resize_hash_table)
7544 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7545 (Fmaphash, secure_hash):
7546 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7547 (concat): Check for string index and length overflow.
7548 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7549 (Frequire):
7550 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7551 (larger_vector): New API (vec, incr_min, size_max) replaces old
7552 one (vec, new_size, init). This catches size overflow.
7553 INIT was removed because it was always Qnil.
7554 All callers changed.
7555 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7556 the upper bound on a hash table index size.
7557 (make_hash_table, maybe_resize_hash_table): Use it.
7558 (secure_hash): Computer start_byte and end_byte only after
7559 they're known to be in ptrdiff_t range.
7560 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7561 (Ffont_get_glyphs, Ffont_at):
7562 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7563 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7564 (Flist_fonts, Fopen_font):
7565 Don't assume fixnum can fit in int.
7566 (check_gstring): Don't assume index can fit in int.
7567 (font_match_p): Check that fixnum is a character, not a nonnegative
7568 fixnum, since the later code needs to stuff it into an int.
7569 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7570 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7571 conversion overflow issues.
7572 (Fopen_font): Check for integer out of range.
7573 (Ffont_get_glyphs): Don't assume index can fit in int.
7574 * font.h: Adjust decls to match defn changes elsewhere.
7575 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7576 integer overflow.
7577 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7578 printmax_t, where ptrdiff_t is wide enough.
7579 (Finternal_char_font):
7580 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7581 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7582 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7583 (Fset_frame_position, x_set_frame_parameters)
7584 (x_set_line_spacing, x_set_border_width)
7585 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7586 Check that fixnums are in proper range for system types.
7587 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7588 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7589 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7590 Use SAFE_ALLOCA_LISP, not alloca.
7591 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7592 intptr_t is wide enough.
7593 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7594 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7595 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7596 Check for fixnum out of range.
7597 * ftfont.c (ftfont_list): Don't assume index fits in int.
7598 Check that fixnums are in proper range for system types.
7599 (ftfont_shape_by_flt):
7600 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7601 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7603 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7604 Check that fixnums are in proper range for system types.
7605 * gnutls.h: Adjust decls to match defn changes elsewhere.
7606 * gtkutil.c (xg_dialog_run):
7607 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7608 (update_frame_tool_bar):
7609 Check that fixnums are in proper range for system types.
7610 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7611 (lookup_image): Check that fixnums are in range for system types.
7612 * indent.c (last_known_column, last_known_column_point):
7613 (current_column_bol_cache):
7614 (skip_invisible, current_column, check_display_width):
7615 (check_display_width, scan_for_column, current_column_1)
7616 (Findent_to, Fcurrent_indentation, position_indentation)
7617 (indented_beyond_p, Fmove_to_column, compute_motion):
7618 (Fcompute_motion, Fvertical_motion):
7619 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7620 (last_known_column_modified): Use EMACS_INT, not int.
7621 (check_display_width):
7622 (Fcompute_motion):
7623 Check that fixnums and floats are in proper range for system types.
7624 (compute_motion): Don't assume index or fixnum fits in int.
7625 (compute_motion, Fcompute_motion):
7626 Use int, not EMACS_INT, when it is wide enough.
7627 (vmotion): Omit local var start_hpos that is always 0; that way
7628 we don't need to worry about overflow in expressions involving it.
7629 * indent.h: Adjust decls to match defn changes elsewhere.
7630 (struct position):
7631 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7632 Use int, not EMACS_INT, where int is wide enough.
7633 Remove unused members ovstring_chars_done and tab_offset;
7634 all uses removed.
7635 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7636 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7637 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7638 (make_gap, copy_text, insert, insert_and_inherit)
7639 (insert_before_markers, insert_before_markers_and_inherit)
7640 (insert_1, count_combining_before, count_combining_after)
7641 (insert_1_both, insert_from_string)
7642 (insert_from_string_before_markers, insert_from_string_1)
7643 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7644 (adjust_after_replace, adjust_after_insert, replace_range)
7645 (replace_range_2, del_range, del_range_1, del_range_byte)
7646 (del_range_both, del_range_2, modify_region)
7647 (prepare_to_modify_buffer, signal_before_change)
7648 (signal_after_change, Fcombine_after_change_execute):
7649 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7650 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7651 (balance_an_interval, split_interval_right, split_interval_left)
7652 (find_interval, next_interval, update_interval)
7653 (adjust_intervals_for_insertion, delete_node, delete_interval)
7654 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7655 (static_offset_intervals, offset_intervals)
7656 (merge_interval_right, merge_interval_left, make_new_interval)
7657 (graft_intervals_into_buffer, temp_set_point_both)
7658 (temp_set_point, set_point, adjust_for_invis_intang)
7659 (set_point_both, move_if_not_intangible, get_property_and_range)
7660 (get_local_map, copy_intervals, copy_intervals_to_string)
7661 (compare_string_intervals, set_intervals_multibyte_1):
7662 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7663 * intervals.h: Adjust decls to match defn changes elsewhere.
7664 (struct interval):
7665 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7666 * keyboard.c (this_command_key_count, this_single_command_key_start)
7667 (before_command_key_count, before_command_echo_length, echo_now)
7668 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7669 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7670 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7671 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7672 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7673 (last_non_minibuf_size, last_point_position, echo_truncate)
7674 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7675 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7676 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7677 (stuff_buffered_input):
7678 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7679 (last_auto_save, command_loop_1, read_char):
7680 Use EMACS_INT, not int, to avoid integer overflow.
7681 (record_char): Avoid overflow in total_keys computation.
7682 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7683 * keyboard.h: Adjust decls to match defn changes elsewhere.
7684 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7685 (Fkey_description, Fdescribe_vector, Flookup_key):
7686 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7687 (click_position): New function, to check that positions are in range.
7688 (Fcurrent_active_maps):
7689 (describe_command):
7690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7691 (Faccessible_keymaps, Fkey_description):
7692 (preferred_sequence_p):
7693 Don't assume fixnum can fit into int.
7694 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7695 Check for integer overflow in size calculations.
7696 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7697 avoid mishandling large integers.
7698 * lisp.h: Adjust decls to match defn changes elsewhere.
7699 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7700 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7701 (struct Lisp_Marker):
7702 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7703 (clip_to_bounds): Now an inline function, moved here from editfns.c.
7704 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7705 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7706 All callers changed.
7707 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7708 Assume the arg has valid form, since it always does.
7709 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7710 unsigned integer system type.
7711 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7712 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7713 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7714 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7715 (duration_to_sec_usec): New decl.
7716 * lread.c (read_from_string_index, read_from_string_index_byte)
7717 (read_from_string_limit, readchar, unreadchar, openp)
7718 (read_internal_start, read1, oblookup):
7719 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7720 (Fload, readevalloop, Feval_buffer, Feval_region):
7721 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7722 (openp): Check for out-of-range argument to 'access'.
7723 (read1): Use int, not EMACS_INT, where int is wide enough.
7724 Don't assume fixnum fits into int.
7725 Fix off-by-one error that can read outside a buffer.
7726 (read_filtered_event): Use duration_to_sec_usec
7727 to do proper overflow checking on durations.
7728 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7729 in size calculation.
7730 (Fexecute_kbd_macro):
7731 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7732 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7733 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7734 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7735 (set_marker_both, set_marker_restricted_both, marker_position)
7736 (marker_byte_position, Fbuffer_has_markers_at):
7737 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7738 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7739 * menu.c (ensure_menu_items): Rename from grow_menu_items.
7740 It now merely ensures that the menu is large enough, without
7741 necessarily growing it, as this avoids some integer overflow issues.
7742 All callers changed.
7743 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7744 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7745 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7746 Use SAFE_ALLOCA_LISP, not alloca.
7747 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7748 to EMACS_INT. Check that fixnums are in proper range for system types.
7749 * minibuf.c (minibuf_prompt_width, string_to_object)
7750 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7751 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7752 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7753 (get_minibuffer, read_minibuf_unwind):
7754 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7755 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7756 this simplifies overflow checking. All callers changed.
7757 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7758 (Ftest_completion):
7759 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7760 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7761 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7762 Check that fixnums are in proper range for system types.
7763 (Fx_create_frame, Fx_show_tip):
7764 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7765 * nsfont.m (ns_findfonts, nsfont_list_family):
7766 Don't assume fixnum fits in long.
7767 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7768 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7769 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7770 wide enough.
7771 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7772 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7773 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7774 (PRINTDECLARE, PRINTPREPARE):
7775 (strout, print_string):
7776 (print, print_preprocess, print_check_string_charset_prop)
7777 (print_object):
7778 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7779 (PRINTDECLARE):
7780 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7781 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7782 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7783 (printchar, strout): Use xpalloc to catch size calculation overflow.
7784 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7785 (print_error_message): Use SAFE_ALLOCA, not alloca.
7786 (print_object): Use int, not EMACS_INT, where int is wide enough.
7787 (print_depth, new_backquote_output, print_number_index):
7788 Use ptrdiff_t, not int, where int might not be wide enough.
7789 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7790 (Fset_process_window_size, Fformat_network_address)
7791 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7792 (sigchld_handler):
7793 Check that fixnums are in proper range for system types.
7794 (Fsignal_process): Simplify by avoiding a goto.
7795 Check for process-ids out of pid_t range rather than relying on
7796 undefined behavior.
7797 (process_tick, update_tick): Use EMACS_INT, not int.
7798 (Fformat_network_address, read_process_output, send_process)
7799 (Fprocess_send_region, status_notify):
7800 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7801 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7802 (wait_reading_process_output, read_process_output, exec_sentinel):
7803 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7804 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7805 (Faccept_process_output): Use duration_to_sec_usec to do proper
7806 overflow checking on durations.
7807 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7808 Don't assume pid_t fits in int.
7809 * process.h (struct Lisp_Process): Members tick and update_tick
7810 are now of type EMACS_INT, not int.
7811 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7812 configured --with-wide-int.
7813 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7814 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7815 * search.c (looking_at_1, string_match_1):
7816 (fast_string_match, fast_c_string_match_ignore_case)
7817 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7818 (scan_newline, find_before_next_newline, search_command)
7819 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7820 (set_search_regs, wordify):
7821 (Freplace_match):
7822 (Fmatch_data):
7823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7824 (string_match_1, search_buffer, set_search_regs):
7825 (Fmatch_data):
7826 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7827 (wordify): Check for overflow in size calculation.
7828 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7829 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7830 Check that fixnums are in proper range for system types.
7831 * sound.c (struct sound_device)
7832 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7833 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7834 (Fplay_sound_internal):
7835 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7836 * syntax.c (struct lisp_parse_state, find_start_modiff)
7837 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7838 (Fparse_partial_sexp):
7839 Don't assume fixnums can fit in int.
7840 (struct lisp_parse_state, find_start_pos, find_start_value)
7841 (find_start_value_byte, find_start_begv)
7842 (update_syntax_table, char_quoted, dec_bytepos)
7843 (find_defun_start, prev_char_comend_first, back_comment):
7844 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7845 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7847 (Finternal_describe_syntax_value): Check that match_lisp is a
7848 character, not an integer, since the code stuffs it into int.
7849 (scan_words, scan_sexps_forward):
7850 Check that fixnums are in proper range for system types.
7851 (Fforward_word):
7852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7853 (scan_sexps_forward):
7854 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7855 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7856 * syntax.h: Adjust decls to match defn changes elsewhere.
7857 (struct gl_state_s):
7858 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7859 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7860 MOST_POSITIVE_FIXNUM.
7861 * sysdep.c (wait_for_termination_1, wait_for_termination)
7862 (interruptible_wait_for_termination, mkdir):
7863 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7864 (emacs_read, emacs_write):
7865 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7866 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7867 and double all fit in int.
7868 * term.c (set_tty_color_mode):
7869 Check that fixnums are in proper range for system types.
7870 * termhooks.h (struct input_event):
7871 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7872 * textprop.c (validate_interval_range, interval_of)
7873 (Fadd_text_properties, set_text_properties_1)
7874 (Fremove_text_properties, Fremove_list_of_text_properties)
7875 (Ftext_property_any, Ftext_property_not_all)
7876 (copy_text_properties, text_property_list, extend_property_ranges)
7877 (verify_interval_modification):
7878 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7879 (Fnext_single_char_property_change)
7880 (Fprevious_single_char_property_change):
7881 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7882 (copy_text_properties):
7883 Check for integer overflow in index calculation.
7884 * undo.c (last_boundary_position, record_point, record_insert)
7885 (record_delete, record_marker_adjustment, record_change)
7886 (record_property_change):
7887 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7888 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7889 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7890 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7891 (Fx_hide_tip, Fx_file_dialog):
7892 * w32menu.c (set_frame_menubar):
7893 Use ptrdiff_t, not int, for consistency with rest of code.
7894 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7895 (select_window, Fdelete_other_windows_internal)
7896 (window_scroll_pixel_based, window_scroll_line_based)
7897 (Frecenter, Fset_window_configuration):
7898 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7899 (Fset_window_hscroll, run_window_configuration_change_hook)
7900 (set_window_buffer, temp_output_buffer_show, scroll_command)
7901 (Fscroll_other_window, Frecenter):
7902 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7903 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7904 Don't assume fixnum fits in int.
7905 (Fset_window_scroll_bars):
7906 Check that fixnums are in proper range for system types.
7907 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7908 (string_pos, c_string_pos, number_of_chars, init_iterator)
7909 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7910 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7911 (compute_display_string_end, handle_face_prop)
7912 (face_before_or_after_it_pos, handle_invisible_prop)
7913 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7914 (display_prop_intangible_p, string_buffer_position_lim)
7915 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7916 (get_overlay_strings_1, get_overlay_strings)
7917 (iterate_out_of_display_property, forward_to_next_line_start)
7918 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7919 (get_next_display_element, set_iterator_to_next)
7920 (get_visually_first_element, compute_stop_pos_backwards)
7921 (handle_stop_backwards, next_element_from_buffer)
7922 (move_it_in_display_line_to, move_it_in_display_line)
7923 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7924 (add_to_log, message_dolog, message_log_check_duplicate)
7925 (message2, message2_nolog, message3, message3_nolog
7926 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7927 (current_message_1, truncate_echo_area, truncate_message_1)
7928 (set_message, set_message_1, store_mode_line_noprop)
7929 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7930 (text_outside_line_unchanged_p, check_point_in_composition)
7931 (reconsider_clip_changes)
7932 (redisplay_internal, set_cursor_from_row, try_scrolling)
7933 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7934 (redisplay_window, find_last_unchanged_at_beg_row)
7935 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7936 (trailing_whitespace_p, find_row_edges, display_line)
7937 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7938 (display_mode_element, store_mode_line_string)
7939 (pint2str, pint2hrstr, decode_mode_spec)
7940 (display_count_lines, display_string, draw_glyphs)
7941 (x_produce_glyphs, x_insert_glyphs)
7942 (rows_from_pos_range, mouse_face_from_buffer_pos)
7943 (fast_find_string_pos, mouse_face_from_string_pos)
7944 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7945 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7946 (safe_call, init_from_display_pos, handle_fontified_prop)
7947 (handle_single_display_spec, load_overlay_strings)
7948 (with_echo_area_buffer, setup_echo_area_for_printing)
7949 (display_echo_area, echo_area_display)
7950 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7951 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7952 (redisplay_window, dump_glyph_row, display_mode_line)
7953 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7954 (handle_display_spec, display_prop_string_p):
7955 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7956 (handle_single_display_spec, build_desired_tool_bar_string)
7957 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7958 (get_specified_cursor_type):
7959 Check that fixnums are in proper range for system types.
7960 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7961 (Flookup_image_map):
7962 Don't assume fixnums fit in int.
7963 (compare_overlay_entries):
7964 Avoid mishandling comparisons due to subtraction overflow.
7965 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7966 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7967 (handle_tool_bar_click):
7968 Use int, not unsigned, since we prefer signed and the signedness
7969 doesn't matter here.
7970 (get_next_display_element, next_element_from_display_vector):
7971 Use int, not EMACS_INT, when int is wide enough.
7972 (start_hourglass): Use duration_to_sec_usec to do proper
7973 overflow checking on durations.
7974 * xfaces.c (Fbitmap_spec_p):
7975 Check that fixnums are in proper range for system types.
7976 (compare_fonts_by_sort_order):
7977 Avoid mishandling comparisons due to subtraction overflow.
7978 (Fx_family_fonts, realize_basic_faces):
7979 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7980 (Fx_family_fonts):
7981 Don't assume fixnum fits in int.
7982 Use SAFE_ALLOCA_LISP, not alloca.
7983 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7984 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7985 (face_at_buffer_position, face_for_overlay_string)
7986 (face_at_string_position):
7987 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7988 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7989 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7990 (Fx_show_tip):
7991 Check that fixnums are in proper range for system types.
7992 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7993 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7994 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7995 (Fx_change_window_property): Don't assume fixnums fit in int.
7996 * xfont.c (xfont_chars_supported):
7997 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7998 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7999 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8000 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8001 * xml.c (parse_region):
8002 * xrdb.c (magic_file_p):
8003 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8004 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8005 (x_get_local_selection, x_reply_selection_request)
8006 (x_handle_selection_request, wait_for_property_change):
8007 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8008 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8009 short is wide enough.
8010 (x_send_client_event): Don't assume fixnum fits in int.
8011 * xterm.c (x_x_to_emacs_modifiers):
8012 Don't assume EMACS_INT overflows nicely into int.
8013 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8014 may come from Lisp.
8015 (handle_one_xevent): NATNUMP can eval its arg twice.
8016 (x_connection_closed):
8017 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8018 * xterm.h: Adjust decls to match defn changes elsewhere.
8019 (struct scroll_bar): Use struct vectorlike_header
8020 rather than rolling our own approximation.
8021 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8022
8023 2012-05-25 Glenn Morris <rgm@gnu.org>
8024
8025 * lisp.mk (lisp): Update for more files being compiled now.
8026
8027 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8028
8029 * lread.c: Remove `read_pure' which makes no difference.
8030 (read_pure): Remove var.
8031 (unreadpure): Remove function.
8032 (readevalloop): Don't call read_list with -1 flag.
8033 (read1, read_vector): Don't test read_pure any more.
8034 (read_list): Simplify.
8035
8036 * fileio.c, character.h: Minor style tweaks.
8037
8038 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8039
8040 * window.h (clip_changed): Remove useless declaration.
8041
8042 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8043
8044 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8045 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8046
8047 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8048
8049 Remove src/m/*.
8050 This directory predates autoconf and is no longer needed nowadays.
8051 Move its few remaining bits of functionality to where they're needed.
8052 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8053 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8054 * m/template.h: Remove.
8055 * Makefile.in (M_FILE): Remove. All uses removed.
8056 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8057 * lisp.h (USE_LSB_TAG):
8058 * mem-limits.h (EXCEEDS_LISP_PTR):
8059 Use VAL_MAX, not VALBITS, in #if.
8060 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8061 (EMACS_UINT): Define unconditionally now.
8062 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8063 (BITS_PER_EMACS_INT): New constants, replacing
8064 what used to be in config.h, but not useful in #if.
8065 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8066 define them any more.
8067 (VAL_MAX): New macro.
8068 (VALMASK): Use it.
8069 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8070 BITS_PER_EMACS_INT, in #if.
8071 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8072 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8073 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8074 * s/ms-w32.h (DATA_START):
8075 Move here from removed file m/intel386.h.
8076 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8077 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8078
8079 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8080
8081 Assume C89 or later.
8082 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8083 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8084 (xrealloc):
8085 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8086 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8087 * textprop.c, tparam.c (NULL): Remove.
8088 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8089 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8090 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8091 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8092 * xterm.c (input_signal_count): Assume volatile works.
8093
8094 2012-05-21 Ken Brown <kbrown@cornell.edu>
8095
8096 * xgselect.c (xg_select): Fix first argument in call to 'select'
8097 (bug#11508).
8098
8099 2012-05-20 Ken Brown <kbrown@cornell.edu>
8100
8101 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8102 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8103
8104 2012-05-19 Ken Brown <kbrown@cornell.edu>
8105
8106 * xfns.c (x_in_use): Remove `static' qualifier.
8107 * xterm.h (x_in_use): Declare.
8108 * xgselect.c: Include xterm.h.
8109 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8110 and `display_arg' (bug#9754).
8111
8112 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8113
8114 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8115
8116 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8117 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8118
8119 2012-05-18 Eli Zaretskii <eliz@gnu.org>
8120
8121 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8122
8123 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8124 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8125
8126 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8127 reference to image_cache->refcount.
8128 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8129
8130 2012-05-17 Juri Linkov <juri@jurta.org>
8131
8132 * search.c (Fword_search_regexp, Fword_search_backward)
8133 (Fword_search_forward, Fword_search_backward_lax)
8134 (Fword_search_forward_lax): Move functions to isearch.el
8135 (bug#10145, bug#11381).
8136
8137 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8138
8139 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8140
8141 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8142
8143 * lread.c (init_obarray): Declare Qt and Qnil as special.
8144
8145 2012-05-14 Glenn Morris <rgm@gnu.org>
8146
8147 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8148 Put "libexec" before "bin", for the sake of init_callproc_1.
8149
8150 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8151
8152 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8153
8154 * unexaix.c: Port to more-recent AIX compilers.
8155 (report_error, report_error_1, make_hdr, copy_sym)
8156 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8157 Make arguments const char *, not char *, to avoid violations of C
8158 standard and to fix some AIX warnings reported by Gilles Pion.
8159
8160 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8161
8162 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8163 already have overlays loaded.
8164 (handle_single_display_spec): Before returning without displaying
8165 fringe bitmap, synchronize the bidi iterator with the main display
8166 iterator, by calling iterate_out_of_display_property.
8167 (iterate_out_of_display_property): Detect buffer iteration by
8168 testing that it->string is a Lisp string.
8169 (get_next_display_element): When the current object is exhausted,
8170 and there's something on it->stack, call set_iterator_to_next to
8171 proceed with what's on the stack, instead of returning zero.
8172 (set_iterator_to_next): If called at the end of a Lisp string,
8173 proceed to consider_string_end without incrementing string
8174 position. Don't increment display vector index past the end of
8175 the display vector. (Bug#11417)
8176 (pos_visible_p): Don't report a position visible when move_it_to
8177 stopped at the last line of window, which happens to be scanned
8178 backwards by the bidi iteration. (Bug#11464)
8179
8180 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8181
8182 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8183 and right-margin display specs even if the spec is invalid or we
8184 are on a TTY, and thus unable to display on the fringes.
8185 That's because the text with the property will not be displayed anyway,
8186 so we need to signal to the caller that this is a "replacing"
8187 display spec. This fixes display when the spec is invalid or we
8188 are on a TTY.
8189
8190 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8191
8192 * unexaix.c (make_hdr): Fix typo in prototype.
8193 This bug broke the build on AIX. Problem reported by Gilles Pion.
8194
8195 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
8196
8197 * keyboard.c (kbd_buffer_get_event): Read special events also in
8198 batch mode. (Bug#11415)
8199
8200 2012-05-12 Glenn Morris <rgm@gnu.org>
8201
8202 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8203
8204 2012-05-12 Eli Zaretskii <eliz@gnu.org>
8205
8206 * lisp.mk (lisp): Add newcomment.elc.
8207
8208 2012-05-12 Glenn Morris <rgm@gnu.org>
8209
8210 * Makefile.in (MKDIR_P): New, set by configure.
8211 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8212
8213 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8214
8215 Remove unused function hourglass_started.
8216 * dispextern.h (hourglass_started):
8217 * w32fns.c (hourglass_started):
8218 * xdisp.c (hourglass_started): Remove.
8219
8220 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
8221
8222 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8223 Update dependencies.
8224
8225 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8226
8227 * xgselect.c (xg_select): Put maxfds+1 into a var.
8228 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8229
8230 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8231
8232 2012-05-10 Dave Abrahams <dave@boostpro.com>
8233
8234 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8235 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8236
8237 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
8238
8239 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8240 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8241 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8242 Initialize xd_registered_buses.
8243
8244 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8245
8246 Untag more efficiently if USE_LSB_TAG.
8247 This is based on a proposal by YAMAMOTO Mitsuharu in
8248 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8249 For an admittedly artificial (nth 8000 longlist) benchmark on
8250 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8251 Emacs's overall text size by 1%.
8252 * lisp.h (XUNTAG): New macro.
8253 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8254 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8255 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8256 * eval.c (Fautoload):
8257 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8258 * frame.h (XFRAME): Use XUNTAG.
8259
8260 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8261 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8262 Remove unportable assumptions about print widths of types like
8263 dbus_uint32_t.
8264 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8265 intptr_t when converting between pointer and integer, to avoid GCC
8266 warnings about wrong width.
8267
8268 2012-05-09 Eli Zaretskii <eliz@gnu.org>
8269
8270 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8271 stack for each reader_thread, instead of defaulting to 8MB
8272 determined by the linker. This avoids failures in creating
8273 subprocesses on Windows 7, see the discussion in this thread:
8274 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8275
8276 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8277
8278 Fix up display of the *Minibuf-0* buffer in the mini window.
8279 * keyboard.c (read_char): Don't clear the echo area if there's no
8280 message to clear.
8281 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8282 contents of *Minibuf-0*) if there's no message displayed in its stead.
8283
8284 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
8285
8286 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8287 batch mode.
8288
8289 2012-05-06 Chong Yidong <cyd@gnu.org>
8290
8291 * lisp.mk (lisp): Update.
8292
8293 2012-05-05 Jim Meyering <meyering@redhat.com>
8294
8295 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8296
8297 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8298
8299 * data.c (PUT_ERROR): New macro.
8300 (syms_of_data): Use it. Add new error type `user-error'.
8301 * undo.c (user_error): New function.
8302 (Fprimitive_undo): Use it.
8303 * print.c (print_error_message): Adjust print style for `user-error'.
8304 * keyboard.c (user_error): New function.
8305 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8306
8307 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8308
8309 Do not limit current-time-string to years 1000..9999.
8310 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8311 (Fcurrent_time_string): Support any year that is supported by the
8312 underlying localtime representation. Don't use asctime, as it
8313 has undefined behavior for years outside the range -999..9999.
8314
8315 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8316
8317 Fix race conditions involving setenv, gmtime, localtime, asctime.
8318 Without this fix, interrupts could mess up code that uses these
8319 nonreentrant functions, since setting TZ invalidates existing
8320 tm_zone or tzname values, and since most of these functions return
8321 pointers to static storage.
8322 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8323 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8324 Grow the critical sections to include not just invoking
8325 localtime/gmtime, but also accessing these functions' results
8326 including their tm_zone values if any, and any related TZ setting.
8327 (format_time_string): Last arg is now struct tm *, not struct tm **,
8328 so that the struct tm is saved in the critical section.
8329 All callers changed. Simplify allocation of initial buffer, partly
8330 motivated by the fact that memory allocation needs to be outside
8331 the critical section.
8332
8333 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8334
8335 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8336 with RESET_INTERVAL.
8337
8338 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8339 Remove duplicated buffer name initialization.
8340
8341 2012-05-02 Jim Meyering <jim@meyering.net>
8342
8343 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8344
8345 * xfns.c (x_window): Use xstrdup (Bug#11375).
8346
8347 2012-05-02 Eli Zaretskii <eliz@gnu.org>
8348
8349 * xdisp.c (pos_visible_p): If already at a newline from the
8350 display string before the 'while' loop, don't walk back the glyphs
8351 from it3.glyph_row. Solves assertion violation when the display
8352 string begins with a newline (egg.el). (Bug#11367)
8353
8354 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8355
8356 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8357 Move to simple.el.
8358
8359 2012-05-01 Glenn Morris <rgm@gnu.org>
8360
8361 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8362 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8363 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8364 All were removed before 23.1.
8365
8366 * dispnew.c: Remove HAVE_LIBNCURSES test;
8367 it is always true on relevant platforms.
8368
8369 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8370 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8371
8372 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8373
8374 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8375
8376 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8377 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8378 Remove.
8379
8380 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8381
8382 Do not avoid creating empty evaporating overlays (Bug#9642).
8383 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8384 That is, do not delete an evaporating overlay if it becomes
8385 empty after its bounds are adjusted to fit within its buffer.
8386 This fix caused other problems, and I'm reverting it until we get
8387 to the bottom of them.
8388
8389 2012-04-27 Chong Yidong <cyd@gnu.org>
8390
8391 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8392
8393 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8394
8395 * xdisp.c (pos_visible_p): If the window start position is beyond
8396 ZV, start the display from buffer beginning. Prevents assertion
8397 violation in init_iterator when the minibuffer window is scrolled
8398 via the scroll bar.
8399
8400 * window.c (window_scroll_pixel_based): Likewise.
8401
8402 2012-04-27 Chong Yidong <cyd@gnu.org>
8403
8404 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8405
8406 2012-04-27 Glenn Morris <rgm@gnu.org>
8407
8408 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8409 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8410
8411 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8412
8413 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8414 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
8415
8416 2012-04-26 Eli Zaretskii <eliz@gnu.org>
8417
8418 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8419 display element, check also the underlying string or buffer
8420 character. (Bug#11341)
8421
8422 * w32menu.c: Include w32heap.h.
8423 (add_menu_item): If the call to AppendMenuW (via
8424 unicode_append_menu) fails, disable Unicode menus only if we are
8425 running on Windows 9X/Me.
8426
8427 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8428
8429 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8430 (xgetint): Add missing shift for LSB tags.
8431
8432 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8433
8434 * keyboard.c (read_char): Don't wipe echo area for select window
8435 events: These might get delayed via `mouse-autoselect-window'
8436 (Bug#11304).
8437
8438 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8439
8440 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8441 manipulation of :loaded-from data.
8442
8443 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8444
8445 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8446 now a cons (bug#11311).
8447
8448 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8449
8450 Do not create empty overlays with the evaporate property (Bug#9642).
8451 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8452 if it becomes empty after its bounds are adjusted to fit within
8453 its buffer. Without this fix, in a nonempty buffer (let ((o
8454 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8455 yields an empty overlay that has the evaporate property, which is
8456 not supposed to happen.
8457
8458 Fix minor GTK3 problems found by static checking.
8459 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8460 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8461 (struct _EmacsFixedClass, emacs_fixed_get_type):
8462 Move decls here from emacsgtkfixed.h, since they needn't be public.
8463 (emacs_fixed_get_type): Now static.
8464 (emacs_fixed_class_init): Omit unused local.
8465 (emacs_fixed_child_type): Remove; unused.
8466 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8467 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8468 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8469 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8470 (EMACS_FIXED_GET_CLASS): Remove; unused.
8471 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8472
8473 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8474 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8475
8476 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8477
8478 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8479 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8480 (__malloc_size_t, __malloc_ptrdiff_t):
8481 Remove. All uses removed, replaced by the definiens if needed,
8482 since we can assume C89 or better now.
8483 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8484 (protect_malloc_state, align, get_contiguous_space)
8485 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8486 (malloc_atfork_handler_child, malloc_enable_thread)
8487 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8488 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8489 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8490 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8491 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8492 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8493 Define using prototypes, not old style.
8494 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8495 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8496 (align): Don't assume that signed integer overflow wraps around.
8497 Omit unused local var.
8498 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8499 (_free_internal_nolock, memalign, mallochook, reallochook):
8500 Omit no-longer-needed casts.
8501 (valloc): Use getpagesize, not __getpagesize.
8502 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8503 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8504
8505 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8506
8507 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
8508
8509 Move functions from C to Lisp. Make non-blocking method calls
8510 the default. Implement further D-Bus standard interfaces.
8511
8512 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8513 (QCdbus_request_name_allow_replacement)
8514 (QCdbus_request_name_replace_existing)
8515 (QCdbus_request_name_do_not_queue)
8516 (QCdbus_request_name_reply_primary_owner)
8517 (QCdbus_request_name_reply_in_queue)
8518 (QCdbus_request_name_reply_exists)
8519 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8520 (QCdbus_registered_serial, QCdbus_registered_method)
8521 (QCdbus_registered_signal): New Lisp objects.
8522 (XD_DEBUG_MESSAGE): Use sizeof.
8523 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8524 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8525 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8526 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8527 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8528 (xd_signature, xd_append_arg): Allow float for integer types.
8529 (xd_get_connection_references): New function.
8530 (xd_get_connection_address): Rename from xd_initialize.
8531 Return cached address.
8532 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8533 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8534 level.
8535 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8536 Return number of refcounts.
8537 (Fdbus_get_unique_name): Make stronger parameter check.
8538 (Fdbus_message_internal): New defun.
8539 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8540 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8541 (Fdbus_send_signal, Fdbus_register_service)
8542 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8543 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8544 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8545 (Vdbus_compiled_version, Vdbus_runtime_version)
8546 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8547 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8548 (Vdbus_message_type_signal): New defvars.
8549 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8550 Adapt docstring.
8551
8552 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8553
8554 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8555 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8556 Do not assume ptrdiff_t is the same width as 'int'.
8557
8558 * alloc.c: Handle unusual debugging option combinations.
8559 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8560 since the two debugging options are incompatible.
8561 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8562 is defined.
8563 (mem_init, mem_insert, mem_insert_fixup):
8564 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8565 (NEED_MEM_INSERT): Remove; no longer needed.
8566
8567 2012-04-22 Leo Liu <sdl.web@gmail.com>
8568
8569 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8570
8571 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8572
8573 * sysdep.c [__FreeBSD__]: Minor cleanups.
8574 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8575 Use Emacs indenting style more consistently. Avoid some casts.
8576 Use 'double' consistently rather than mixing 'float' and 'double'.
8577
8578 2012-04-21 Eduard Wiebe <usenet@pusto.de>
8579
8580 * sysdep.c (list_system_processes, system_process_attributes):
8581 Add implementation for FreeBSD (Bug#5243).
8582
8583 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8584
8585 * lisp.mk (lisp): Update.
8586
8587 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8588
8589 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8590 It is never used otherwise.
8591
8592 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8593
8594 * print.c (print_preprocess): Only check print_depth if print-circle
8595 is nil.
8596 (print_object): Check for cycles even when print-circle is nil and
8597 print-gensym is t, but only check print_depth if print-circle is nil.
8598
8599 2012-04-20 Chong Yidong <cyd@gnu.org>
8600
8601 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8602 set the status to "failed" and ensure that sentinel is run.
8603
8604 2012-04-20 Glenn Morris <rgm@gnu.org>
8605
8606 * process.c (Fset_process_inherit_coding_system_flag)
8607 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8608 (Fmake_network_process, Fmake_serial_process): Doc fix.
8609
8610 2012-04-20 Eli Zaretskii <eliz@gnu.org>
8611
8612 * xdisp.c (string_buffer_position_lim): Limit starting position to
8613 BEGV.
8614 (set_cursor_from_row): If called for a mode-line or header-line
8615 row, return zero immediately.
8616 (try_cursor_movement): If inside continuation line, don't back up
8617 farther than the first row after the header line, if any.
8618 Don't consider the header-line row as "partially visible", even if
8619 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8620
8621 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8622
8623 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8624 (bug#11238).
8625
8626 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
8627 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
8628
8629 configure: new option --enable-gcc-warnings (Bug#11207)
8630 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8631 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8632 (ALL_CFLAGS): Use new macros rather than old.
8633 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8634 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8635 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8636 -Wunused-result, -Wunused-variable. This should go away once
8637 the Emacs and Gnulib regex code is merged.
8638 (xmalloc, xrealloc): Now static.
8639
8640 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8641
8642 * dired.c (Fsystem_groups): Remove unused local.
8643
8644 2012-04-17 Glenn Morris <rgm@gnu.org>
8645
8646 * dired.c (Fsystem_users): Doc fix.
8647
8648 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8649
8650 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8651 (syms_of_dired): Add them.
8652
8653 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8654
8655 Fix minor alloc.c problems found by static checking.
8656 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8657 New extern decls, to avoid calling undeclared functions.
8658 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8659 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8660 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8661 (NEED_MEM_INSERT): New macro.
8662 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8663 Remove one incorrect comment and fix another.
8664
8665 Fix minor ralloc.c problems found by static checking.
8666 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8667 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8668 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8669 (r_alloc_sbrk): Now static.
8670
8671 Improve ralloc.c interface checking.
8672 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8673 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8674 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8675 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8676 [REL_ALLOC]: ... to here, to check interface.
8677 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8678 Remove decls. This fixes an "It stinks!".
8679
8680 * alloc.c (which_symbols): Fix alignment issue / type clash.
8681
8682 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8683
8684 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8685 (struct Lisp_Misc_Any): Likewise.
8686 (struct Lisp_Free): Likewise.
8687 * alloc.c (union aligned_Lisp_Symbol): Define.
8688 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8689 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8690 (union aligned_Lisp_Misc): Define.
8691 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8692 aligned_Lisp_Misc instead of union Lisp_Misc.
8693 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8694
8695 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8696
8697 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8698 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8699 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8700 * s/netbsd.h, s/sol2-6.h:
8701 Remove definition of GC_MARK_STACK, since the default now works.
8702 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8703 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8704 no longer the default.
8705 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8706
8707 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8708
8709 * lread.c (lisp_file_lexically_bound_p):
8710 Fix hang at ";-*-\n" (bug#11238).
8711
8712 2012-04-14 Eli Zaretskii <eliz@gnu.org>
8713
8714 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8715 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8716
8717 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8718
8719 * nsterm.m (constrainFrameRect): Always constrain when there is only
8720 one screen (Bug#10962).
8721
8722 2012-04-13 Ken Brown <kbrown@cornell.edu>
8723
8724 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8725
8726 2012-04-13 Reuben Thomas <rrt@sc3d.org>
8727
8728 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8729
8730 2012-04-11 Daniel Colascione <dancol@dancol.org>
8731
8732 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8733 against is gone. It's better to use vfork now so that when Cygwin
8734 gains a new, working vfork, we use it automatically (bug#10398).
8735
8736 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8737
8738 * window.c (save_window_save): Obey window-point-insertion-type.
8739
8740 2012-04-11 Glenn Morris <rgm@gnu.org>
8741
8742 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8743
8744 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8745
8746 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8747
8748 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
8749
8750 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8751 (force_quit_count): New var.
8752 (handle_interrupt): Use it.
8753
8754 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
8755
8756 * w32.c (w32_delayed_load): Record the full path of the library
8757 being loaded (bug#10424).
8758
8759 2012-04-09 Glenn Morris <rgm@gnu.org>
8760
8761 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8762 not just in the obarray, before snarfing them. (Bug#11036)
8763
8764 * Makefile.in ($(leimdir)/leim-list.el):
8765 Pass EMACS rather than BUILT_EMACS.
8766
8767 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8768
8769 * process.c (make_process):
8770 * process.h: Add integer `gnutls_handshakes_tried' member to
8771 process struct.
8772
8773 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8774 Add convenience `GNUTLS_LOG2i' macro.
8775
8776 * gnutls.c (gnutls_log_function2i): Convenience log function.
8777 (emacs_gnutls_read): Use new log functions,
8778 `gnutls_handshakes_tried' process member, and
8779 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8780 attempts per process (connection).
8781
8782 2012-04-09 Chong Yidong <cyd@gnu.org>
8783
8784 * eval.c (Fuser_variable_p, user_variable_p_eh)
8785 (lisp_indirect_variable): Functions deleted.
8786 (Fdefvar): Caller changed.
8787
8788 * callint.c (Finteractive, Fcall_interactively):
8789 * minibuf.c (Fread_variable): Callers changed.
8790
8791 2012-04-09 Eli Zaretskii <eliz@gnu.org>
8792
8793 * xdisp.c (set_cursor_from_row): If the display string appears in
8794 the buffer at position that is closer to point than the position
8795 after the display string, display the cursor on the first glyph of
8796 the display string. Fixes cursor display when a 'display' text
8797 property immediately follows invisible text. (Bug#11094)
8798
8799 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8800
8801 composite.c: use 'double' consistently
8802 * composite.c (get_composition_id): Use 'double' consistently
8803 instead of converting 'float' to 'double' and vice versa; this is
8804 easier to understand and avoids a GCC warning.
8805
8806 2012-04-09 Glenn Morris <rgm@gnu.org>
8807
8808 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8809 preparation for dumping it with emacs. (Bug#4789)
8810 (leimdir): New variable.
8811 ($(leimdir)/leim-list.el): New rule.
8812 (emacs$(EXEEXT)): Depend on leim-list.el.
8813
8814 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8815 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8816 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8817
8818 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8819
8820 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8821 proper alignment.
8822
8823 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
8824
8825 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8826 Remove unused local variable.
8827
8828 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8829
8830 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8831 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8832 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8833 objects, as mark_maybe_pointer will catch them otherwise.
8834 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8835 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8836
8837 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8838
8839 Fix typo that broke non-Windows builds.
8840 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8841
8842 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8843
8844 Support building on MS-Windows with libxml2.
8845
8846 * makefile.w32-in (OBJ2): Add xml.$(O).
8847 (GLOBAL_SOURCES): Add xml.c.
8848 ($(BLD)/xml.$(O)): New dependency list.
8849
8850 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8851 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8852 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8853 [!WINDOWSNT]: New macros.
8854 (init_libxml2_functions, libxml2_loaded_p): New functions.
8855 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8856 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8857 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8858 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8859 linked in).
8860 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8861 Call init_libxml2_functions before calling libxml2 functions.
8862 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8863
8864 * emacs.c: Don't include libxml/parser.h.
8865 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8866 xmlCleanupParser directly.
8867
8868 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8869
8870 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8871
8872 * indent.c (Fvertical_motion): If there is a display string at
8873 point, use it.vpos to compute how many lines to backtrack after
8874 move_it_to point. (Bug#11133)
8875
8876 2012-04-06 Eli Zaretskii <eliz@gnu.org>
8877
8878 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8879 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8880 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8881 macros related to unification of CJK characters. For the details,
8882 see the discussion following the message here:
8883 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8884
8885 2012-04-04 Chong Yidong <cyd@gnu.org>
8886
8887 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8888
8889 2012-04-01 Eli Zaretskii <eliz@gnu.org>
8890
8891 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8892 instead of alloca. (Bug#11138)
8893
8894 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8895
8896 * w32menu.c (is_simple_dialog): Properly check lisp types.
8897 (Bug#11141)
8898
8899 2012-03-31 Eli Zaretskii <eliz@gnu.org>
8900
8901 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8902 position we get to after a call to move_it_to fails the
8903 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8904 only if we wind up in a string from display property. (Bug#11063)
8905
8906 * window.c (Fdelete_other_windows_internal): Invalidate the row
8907 and column information about mouse highlight, so that redisplay
8908 restores it after reallocating the glyph matrices. (Bug#7464)
8909
8910 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8911 string comes from a `display' text property, use the buffer
8912 position of that property as if we actually saw that position in
8913 the row's glyphs.
8914 (move_it_by_lines): Remove the assertion that
8915 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8916 violated when there's a before-string at the beginning of a line.
8917 (Bug#11063)
8918
8919 2012-03-30 Eli Zaretskii <eliz@gnu.org>
8920
8921 * xdisp.c (append_space_for_newline): If the default face was
8922 remapped, use the remapped face for the appended newline.
8923 (extend_face_to_end_of_line): Use the remapped default face for
8924 extending the face to the end of the line.
8925 (display_line): Call extend_face_to_end_of_line when the default
8926 face was remapped. (Bug#11068)
8927
8928 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8929
8930 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8931
8932 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8933
8934 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8935
8936 2012-03-27 Glenn Morris <rgm@gnu.org>
8937
8938 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8939 Doc fixes.
8940
8941 2012-03-26 Kenichi Handa <handa@m17n.org>
8942
8943 * dispextern.h (struct glyph): Fix previous change. Change the
8944 bit length of glyphless.ch to 25 (Bug#11082).
8945
8946 2012-03-26 Chong Yidong <cyd@gnu.org>
8947
8948 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8949 (command_loop_1): Use it; inhibit selection update for
8950 handle-select-window too (Bug#8996).
8951
8952 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8953
8954 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8955
8956 2012-03-25 Kenichi Handa <handa@m17n.org>
8957
8958 * dispextern.h (struct glyph): Change the bit length of
8959 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8960
8961 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8962
8963 * s/ms-w32.h (tzname): Include time.h before redirecting to
8964 _tzname. Fixes the MSVC build. (Bug#9960)
8965
8966 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8967
8968 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8969 characters.
8970
8971 * xterm.c (XTread_socket): Only modify handling_signal if
8972 !SYNC_INPUT. (Bug#11080)
8973
8974 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8975
8976 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8977 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8978 when fetching a multibyte character consumes more bytes than
8979 CHAR_BYTES returns, due to unification of CJK characters in
8980 string_char. (Bug#11073)
8981
8982 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8983
8984 * process.c (wait_reading_process_output): Handle pty disconnect
8985 by refraining from sending oneself a SIGCHLD (bug#10933).
8986
8987 2012-03-22 Chong Yidong <cyd@gnu.org>
8988
8989 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8990
8991 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8992 Mark string as coming from a prefix property.
8993 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8994 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8995
8996 2012-03-21 Chong Yidong <cyd@gnu.org>
8997
8998 * xfaces.c (Vface_remapping_alist): Doc fix.
8999
9000 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9001
9002 * w32proc.c (Fw32_set_console_codepage)
9003 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9004 Doc fixes.
9005
9006 2012-03-20 Chong Yidong <cyd@gnu.org>
9007
9008 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9009 to reflect default non-nil value of redisplay-dont-pause.
9010
9011 2012-03-19 Kenichi Handa <handa@m17n.org>
9012
9013 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9014 it fit in a valid range (Bug#11003).
9015
9016 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9017
9018 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9019 that is not from display property, accept the row as a "cursor
9020 row" if one of the string's character has a non-nil `cursor'
9021 property. Fixes cursor positioning when there are newlines in
9022 overlay strings, e.g. in icomplete.el. (Bug#11035)
9023
9024 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9025
9026 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9027
9028 2012-03-12 Chong Yidong <cyd@gnu.org>
9029
9030 * eval.c (inhibit_lisp_code): Rename from
9031 inhibit_window_configuration_change_hook; move from window.c.
9032
9033 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9034 * window.c (run_window_configuration_change_hook)
9035 (syms_of_window): Callers changed.
9036
9037 2012-03-11 Chong Yidong <cyd@gnu.org>
9038
9039 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9040
9041 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9042
9043 2012-03-10 Chong Yidong <cyd@gnu.org>
9044
9045 * frame.c (other_visible_frames): Don't assume the selected frame
9046 is visible (Bug#10955).
9047
9048 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9049
9050 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9051
9052 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9053
9054 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9055 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9056 zero (Bug#10954).
9057
9058 2012-03-03 Glenn Morris <rgm@gnu.org>
9059
9060 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9061
9062 2012-03-02 Eli Zaretskii <eliz@gnu.org>
9063
9064 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9065 position past the first glyph_row that ends at ZV. (Bug#10902)
9066 (redisplay_window, next_element_from_string): Fix typos in
9067 comments.
9068 (redisplay_window): Pass to move_it_vertically the margin in
9069 pixels, not in screen lines.
9070
9071 2012-03-02 Glenn Morris <rgm@gnu.org>
9072
9073 * buffer.c (buffer-list-update-hook): Doc fix.
9074
9075 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9076
9077 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9078 push_it before setting up the iterator for the first overlay
9079 string, even if we have an empty string loaded.
9080 (next_overlay_string): If there's an empty string on the iterator
9081 stack, pop the stack. (Bug#10903)
9082
9083 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9084
9085 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9086 Suggested by Stefan Monnier in
9087 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9088 * alloc.c (widen_to_Lisp_Object): New static function.
9089 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9090 and widening them to Lisp_Objects. This would work even if
9091 USE_LSB_TAG is defined and wide integers are used, which might
9092 happen in a future version of Emacs.
9093
9094 2012-02-25 Chong Yidong <cyd@gnu.org>
9095
9096 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9097 Doc fix.
9098
9099 * xselect.c (Fx_selection_exists_p): Doc fix.
9100 (x_clipboard_manager_save_all): Print an informative message
9101 before saving to clipboard manager.
9102
9103 2012-02-24 Chong Yidong <cyd@gnu.org>
9104
9105 * keyboard.c (process_special_events): Handle all X selection
9106 requests in kbd_buffer, not just the next one (Bug#8869).
9107
9108 2012-02-23 Chong Yidong <cyd@gnu.org>
9109
9110 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9111 call when setting menu-bar-lines and tool-bar-lines parameters.
9112 (unwind_create_frame_1): New helper function.
9113
9114 * window.c (inhibit_window_configuration_change_hook): New var.
9115 (run_window_configuration_change_hook): Obey it.
9116 (syms_of_window): Initialize it.
9117
9118 2012-02-22 Chong Yidong <cyd@gnu.org>
9119
9120 * xterm.c (x_draw_image_relief): Add missing type check for
9121 Vtool_bar_button_margin (Bug#10743).
9122
9123 2012-02-21 Chong Yidong <cyd@gnu.org>
9124
9125 * fileio.c (Vfile_name_handler_alist): Doc fix.
9126
9127 * buffer.c (Fget_file_buffer): Protect against invalid file
9128 handler return value.
9129
9130 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9131
9132 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9133 when computing $valmask.
9134
9135 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9136 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9137 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9138 It's useless in that case, and it can cause problems on hosts
9139 that allocate halves of EMACS_INT values separately.
9140 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9141 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9142 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9143 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9144 it avoids undefined behavior on hosts where shifting right by more
9145 than the word width has undefined behavior.
9146
9147 2012-02-19 Chong Yidong <cyd@gnu.org>
9148
9149 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9150 (Funhandled_file_name_directory, Ffile_name_as_directory)
9151 (Fdirectory_file_name, Fexpand_file_name)
9152 (Fsubstitute_in_file_name): Protect against invalid file handler
9153 return values (Bug#10845).
9154
9155 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9156
9157 * .gdbinit (pitx): Fix incorrect references to fields of the
9158 iterator stack.
9159
9160 2012-02-17 Chong Yidong <cyd@gnu.org>
9161
9162 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9163
9164 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9165
9166 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9167 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9168
9169 2012-02-15 Chong Yidong <cyd@gnu.org>
9170
9171 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9172 marked as special. Also, starting docstrings with * is obsolete.
9173
9174 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9175
9176 * gnutls.c (emacs_gnutls_write): Fix last change.
9177
9178 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9179
9180 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9181 send_process.
9182
9183 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9184
9185 * keymap.c (Fsingle_key_description): Handle char ranges.
9186
9187 2012-02-12 Chong Yidong <cyd@gnu.org>
9188
9189 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9190 as that creates a dangerous corner case.
9191
9192 * window.c (Fdelete_window_internal): Invalidate the mouse
9193 highlight (Bug#9904).
9194
9195 2012-02-12 Glenn Morris <rgm@gnu.org>
9196
9197 * xselect.c (Fx_own_selection_internal)
9198 (Fx_get_selection_internal, Fx_disown_selection_internal)
9199 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9200 * nsselect.m (Fx_own_selection_internal)
9201 (Fx_disown_selection_internal, Fx_selection_exists_p)
9202 (Fx_selection_owner_p, Fx_get_selection_internal):
9203 Sync docs and argument specs with the xselect.c versions.
9204
9205 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9206
9207 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9208
9209 2012-02-11 Eli Zaretskii <eliz@gnu.org>
9210
9211 * w32select.c (Fx_selection_exists_p): Sync doc string and
9212 argument list with xselect.c. (Bug#10783)
9213
9214 * w16select.c (Fx_selection_exists_p): Sync doc string and
9215 argument list with xselect.c. (Bug#10783)
9216
9217 2012-02-10 Glenn Morris <rgm@gnu.org>
9218
9219 * fns.c (Fsecure_hash): Doc fix.
9220
9221 2012-02-09 Kenichi Handa <handa@m17n.org>
9222
9223 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9224
9225 2012-02-07 Chong Yidong <cyd@gnu.org>
9226
9227 * buffer.c (Fbuffer_local_variables)
9228 (buffer_lisp_local_variables): Handle unbound vars correctly;
9229 don't let Qunbound leak into Lisp.
9230
9231 2012-02-07 Glenn Morris <rgm@gnu.org>
9232
9233 * image.c (Fimagemagick_types): Doc fix.
9234
9235 * image.c (imagemagick-render-type): Change it from a lisp object
9236 to an integer. Move the doc here from the lisp manual.
9237 Treat all values not equal to 0 the same.
9238
9239 2012-02-06 Chong Yidong <cyd@gnu.org>
9240
9241 * doc.c (store_function_docstring): Avoid applying docstring of
9242 alias to base function (Bug#2603).
9243
9244 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9245
9246 * .gdbinit (pp1, pv1): Remove redundant defines.
9247 (pr): Use pp.
9248
9249 2012-02-04 Chong Yidong <cyd@gnu.org>
9250
9251 * nsterm.m: Declare a global (Bug#10694).
9252
9253 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9254
9255 * w32.c (get_emacs_configuration_options):
9256 Include --enable-checking, if specified, in the return value.
9257
9258 2012-02-04 Martin Rudalics <rudalics@gmx.at>
9259
9260 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9261 after rounding frame sizes. (Bug#9723)
9262
9263 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9264
9265 * keyboard.c (adjust_point_for_property): Don't position point
9266 before BEGV. (Bug#10696)
9267
9268 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9269
9270 Handle overflow when computing char display width (Bug#9496).
9271 * character.c (char_width): Return EMACS_INT, not int.
9272 (char_width, c_string_width): Check for overflow when
9273 computing the width; this is possible now that individual
9274 characters can have unbounded width. Problem introduced
9275 by merge from Emacs 23 on 2012-01-19.
9276
9277 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
9278
9279 * dbusbind.c (Fdbus_register_method): Mention the return value
9280 :ignore in the docstring.
9281
9282 2012-02-02 Glenn Morris <rgm@gnu.org>
9283
9284 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9285
9286 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9287 Unconditionally set to t. (Bug#10673)
9288 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9289 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9290 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9291
9292 2012-02-02 Kenichi Handa <handa@m17n.org>
9293
9294 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9295 0, do not call append_composite_glyph.
9296
9297 2012-02-02 Kenichi Handa <handa@m17n.org>
9298
9299 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9300 NULL (Bug#6988).
9301 (x_produce_glyphs): If the component of a composition is a null
9302 string, set it->pixel_width to 1 to avoid zero-width glyph.
9303
9304 2012-02-01 Eli Zaretskii <eliz@gnu.org>
9305
9306 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9307 first 2 arguments are identical. This makes inserting large
9308 output from a subprocess an order of magnitude faster on
9309 MS-Windows, where all sbrk'ed memory is always contiguous.
9310
9311 2012-01-31 Glenn Morris <rgm@gnu.org>
9312
9313 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9314 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9315 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9316
9317 2012-01-29 Glenn Morris <rgm@gnu.org>
9318
9319 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9320
9321 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9322
9323 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9324
9325 2012-01-28 Chong Yidong <cyd@gnu.org>
9326
9327 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9328
9329 2012-01-26 Chong Yidong <cyd@gnu.org>
9330
9331 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9332
9333 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9334 repeat counts (Bug#10507).
9335
9336 2012-01-26 Glenn Morris <rgm@gnu.org>
9337
9338 * lread.c (syms_of_lread): Doc fix.
9339
9340 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9341
9342 * coding.c (encode_designation_at_bol): Change return value to
9343 EMACS_INT.
9344
9345 2012-01-25 Chong Yidong <cyd@gnu.org>
9346
9347 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9348
9349 2012-01-21 Chong Yidong <cyd@gnu.org>
9350
9351 * floatfns.c (Fcopysign): Make the second argument non-optional,
9352 since nil is not allowed anyway.
9353
9354 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9355
9356 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9357 (send_process): Likewise.
9358
9359 2012-01-19 Martin Rudalics <rudalics@gmx.at>
9360
9361 * window.c (save_window_save, Fcurrent_window_configuration)
9362 (Vwindow_persistent_parameters): Do not use Qstate.
9363 Rewrite doc-strings.
9364
9365 2012-01-19 Kenichi Handa <handa@m17n.org>
9366
9367 * character.c (char_width): New function.
9368 (Fchar_width, c_string_width, lisp_string_width):
9369 Use char_width (Bug#9496).
9370
9371 2012-01-16 Martin Rudalics <rudalics@gmx.at>
9372
9373 * window.c (Vwindow_persistent_parameters): New variable.
9374 (Fset_window_configuration, save_window_save): Handle persistent
9375 window parameters.
9376
9377 2012-01-14 Eli Zaretskii <eliz@gnu.org>
9378
9379 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9380 thrashing the stack of the thread. (Bug#9087)
9381
9382 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9383
9384 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9385
9386 2012-01-11 Eli Zaretskii <eliz@gnu.org>
9387
9388 * xdisp.c (rows_from_pos_range): Handle the case where the
9389 highlight ends on a newline. (Bug#10464)
9390 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9391 he end column for display of highlight that ends on a newline
9392 before a R2L line.
9393
9394 2012-01-11 Glenn Morris <rgm@gnu.org>
9395
9396 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9397 from load-path also when installation-directory is nil. (Bug#10208)
9398
9399 2012-01-10 Glenn Morris <rgm@gnu.org>
9400
9401 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9402
9403 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9404 Update template values to be closer to their typical values these days.
9405
9406 2012-01-09 Eli Zaretskii <eliz@gnu.org>
9407
9408 * xdisp.c (rows_from_pos_range): Accept additional argument
9409 DISP_STRING, and accept any glyph in a row whose object is that
9410 string as eligible for mouse highlight. Fixes mouse highlight of
9411 display strings from overlays. (Bug#10464)
9412
9413 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
9414
9415 emacs: fix an auto-save permissions race condition (Bug#10400)
9416 * fileio.c (auto_saving_dir_umask): New static var.
9417 (Fmake_directory_internal): Use it.
9418 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9419 creating the directory. The old code temporarily assigns
9420 too-generous permissions to the directory.
9421 (do_auto_save_eh): Clear it.
9422 (Fdo_auto_save): Catch all errors, not just file errors, so
9423 that the var is always cleared.
9424
9425 2012-01-07 Eli Zaretskii <eliz@gnu.org>
9426
9427 * search.c (scan_buffer): Pass character positions to
9428 know_region_cache, not byte positions. (Bug#6540)
9429
9430 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
9431
9432 * w32.c (sys_rename): Report EXDEV when rename of a directory
9433 fails because the target is on another logical disk. (Bug#10284)
9434
9435 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9436
9437 * xterm.c (x_embed_request_focus): New function.
9438
9439 * xterm.h: Add prototype.
9440
9441 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9442
9443 2012-01-05 Glenn Morris <rgm@gnu.org>
9444
9445 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9446
9447 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9448
9449 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9450 Load gnutls_transport_set_lowat only if GnuTLS version is below
9451 2.11.1.
9452 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9453 GnuTLS versions below 2.11.1.
9454
9455 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9456
9457 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9458 to the doc string advising against its use for altering the way
9459 windows are scrolled.
9460
9461 2011-12-28 Kenichi Handa <handa@m17n.org>
9462
9463 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9464 coding-system ASCII compatible only when it does not produce BOM
9465 on encoding (Bug#10383).
9466
9467 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9468
9469 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9470 can scroll.
9471 (create_and_show_popup_menu): Always use menu_position_func for
9472 Gtk3 (Bug#10361).
9473
9474 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9475
9476 * callint.c (Fcall_interactively): Don't truncate prompt string.
9477
9478 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9479
9480 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9481 property that ends at ZV, so that the bidi iteration could be
9482 resumed from there (after widening). (Bug#10360)
9483
9484 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9485
9486 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9487
9488 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9489
9490 * nsterm.m (x_free_frame_resources):
9491 Release f->output_data.ns->miniimage.
9492 (ns_index_color): Fix indentation. Do not retain
9493 color_table->colors[i].
9494
9495 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9496 before returning.
9497
9498 * nsfns.m (x_set_background_color): Assign return value from
9499 ns_index_color to face-background instead of NSColor*.
9500 (ns_implicitly_set_icon_type): Fix indentation.
9501 Change assignment in for loop to comparison.
9502
9503 * emacs.c (ns_pool): New variable.
9504 (main): Assign ns_pool.
9505 (Fkill_emacs): Call ns_release_autorelease_pool.
9506
9507 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9508 autorelease fdesc, release fdAttrs and tdict.
9509 (ns_get_covering_families): Release charset.
9510 (ns_findfonts): Release NSFontDescriptor created with new.
9511 (ns_uni_to_glyphs): Fix indentation.
9512 (setString): Release attrStr before assigning new value.
9513
9514 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9515
9516 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9517 and NS_IMPL_COCOA.
9518 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9519 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9520
9521 2011-12-18 David Reitter <reitter@cmu.edu>
9522
9523 * nsterm.m (ns_term_init): Subscribe for notifications
9524 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9525 to method trackingNotification in EmacsMenu.
9526
9527 * nsmenu.m (trackingMenu): New variable.
9528 (trackingNotification): New method (from Aquamacs).
9529 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9530 from Aquamacs (Bug#7030).
9531
9532 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9533
9534 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9535 (symbol_to_nsstring): Fix indentation.
9536 (ns_symbol_to_pb): New function.
9537 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9538 (Fns_rotate_cut_buffers_internal): Remove.
9539 (Fns_store_selection_internal): Rename from
9540 Fns_store_cut_buffer_internal.
9541 (ns_get_foreign_selection, Fx_own_selection_internal)
9542 (Fx_disown_selection_internal, Fx_selection_exists_p)
9543 (Fns_get_selection_internal, Fns_store_selection_internal):
9544 Use ns_symbol_to_pb and check if return value is nil.
9545 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9546 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9547 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9548 renamed to Sns_store_selection_internal.
9549 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9550 and remove this function.
9551 (ns_handle_selection_clear): Remove, never used.
9552 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9553 here.
9554
9555 2011-12-17 Ken Brown <kbrown@cornell.edu>
9556
9557 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9558 GID is unknown (Bug#10257).
9559
9560 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9561
9562 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9563 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9564 which caused a build failure on GNU/Linux IA-64. This problem was
9565 introduced by my 2011-10-07 patch.
9566
9567 2011-12-15 Juri Linkov <juri@jurta.org>
9568
9569 * image.c (imagemagick_error): New function. (Bug#10112)
9570 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9571 Use `imagemagick_error' where ImageMagick functions return
9572 `MagickFalse'.
9573 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9574 proper order.
9575
9576 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9577
9578 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9579 fill background (Bug#8992).
9580
9581 2011-12-13 Martin Rudalics <rudalics@gmx.at>
9582
9583 * window.c (Vwindow_combination_resize)
9584 (Vwindow_combination_limit): Use t instead of non-nil in
9585 doc-strings.
9586 (Vrecenter_redisplay): Add first sentence of doc-string on
9587 separate line.
9588 (Frecenter): Fix doc-string typo.
9589
9590 2011-12-11 Kenichi Handa <handa@m17n.org>
9591
9592 * coding.c (Funencodable_char_position): Pay attention to the
9593 buffer text relocation (Bug#9389).
9594
9595 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9596
9597 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9598 gtk_init (Bug#10100).
9599
9600 2011-12-10 Eli Zaretskii <eliz@gnu.org>
9601
9602 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9603 IT->string is nil. (Bug#10263)
9604
9605 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9606
9607 * nsterm.h (x_free_frame_resources): Declare.
9608
9609 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9610 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9611
9612 * nsterm.h (ns_get_defaults_value): Declare.
9613
9614 * nsterm.m (ns_default): Call ns_get_defaults_value.
9615
9616 2011-12-09 Eli Zaretskii <eliz@gnu.org>
9617
9618 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9619 (Bug#10170)
9620
9621 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9622
9623 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9624 that where the value of an _OBJC_* symbol points to is in the .bss
9625 section (Bug#10240).
9626
9627 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9628
9629 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9630 after the loop to call ccl_driver at least once (Bug#8619).
9631
9632 2011-12-08 Kenichi Handa <handa@m17n.org>
9633
9634 * ftfont.c (get_adstyle_property): Fix previous change
9635 (Bug#10233).
9636
9637 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
9638
9639 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9640 dirs from the default value of EMACSLOADPATH (bug#10208).
9641
9642 2011-12-07 Glenn Morris <rgm@gnu.org>
9643
9644 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9645 installation and source directories as well. (Bug#10208)
9646
9647 2011-12-06 Chong Yidong <cyd@gnu.org>
9648
9649 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9650
9651 2011-12-06 Glenn Morris <rgm@gnu.org>
9652
9653 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9654 as an error, not just -1. (Bug#10217)
9655
9656 2011-12-05 Chong Yidong <cyd@gnu.org>
9657
9658 * keyboard.c (process_special_events): New function.
9659 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9660
9661 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9662
9663 * coding.c (encode_designation_at_bol): Don't use uninitialized
9664 local variable (Bug#9318).
9665
9666 2011-12-05 Kenichi Handa <handa@m17n.org>
9667
9668 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9669 return Qnil (Bug#8046, Bug#10193).
9670
9671 2011-12-05 Kenichi Handa <handa@m17n.org>
9672
9673 * coding.c (encode_designation_at_bol): New args charbuf_end and
9674 dst. Return the number of produced bytes. Callers changed.
9675 (coding_set_source): Return how many bytes coding->source was
9676 relocated.
9677 (coding_set_destination): Return how many bytes
9678 coding->destination was relocated.
9679 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9680 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9681
9682 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9683
9684 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9685 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9686 macro (Bug#9318).
9687
9688 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9689
9690 The following changes are to fix Bug#9318.
9691
9692 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9693 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9694 (encode_coding_iso_2022, encode_coding_sjis)
9695 (encode_coding_big5, encode_coding_charset): Use the above macros.
9696
9697 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
9698
9699 * lisp.h (process_quit_flag): Fix external declaration.
9700
9701 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9702
9703 Don't macro-inline non-performance-critical code.
9704 * eval.c (process_quit_flag): New function.
9705 * lisp.h (QUIT): Use it.
9706
9707 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9708
9709 * nsfns.m (get_geometry_from_preferences): New function.
9710 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9711
9712 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9713
9714 * emacs.c (Qkill_emacs): Define.
9715 (syms_of_emacs): Initialize it.
9716 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9717 Qquit_flag to `kill-emacs' instead.
9718 (quit_throw_to_read_char): Add parameter `from_signal'.
9719 All callers changed. Call Fkill_emacs if requested and safe.
9720 * lisp.h (QUIT): Call Fkill_emacs if requested.
9721
9722 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9723
9724 * widget.c (update_wm_hints): Return if wmshell is null.
9725 (widget_update_wm_size_hints): New function.
9726
9727 * widget.h (widget_update_wm_size_hints): Declare.
9728
9729 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9730 widget_update_wm_size_hints (Bug#10104).
9731
9732 2011-12-03 Eli Zaretskii <eliz@gnu.org>
9733
9734 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9735 before a newline, prepare the bidi iterator for consuming the
9736 newline, and keep the current paragraph direction. (Bug#10183)
9737 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9738
9739 2011-12-02 Juri Linkov <juri@jurta.org>
9740
9741 * search.c (Fword_search_regexp): New Lisp function created from
9742 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9743 (Fword_search_backward, Fword_search_forward)
9744 (Fword_search_backward_lax, Fword_search_forward_lax):
9745 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9746 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9747
9748 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9749
9750 * fileio.c (Finsert_file_contents): Move after-change-function call
9751 to before the "handled:" label, since all "goto handled" appear in
9752 cases where the *-change-functions have already been properly called
9753 (bug#10117).
9754
9755 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9756
9757 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9758 waiting for input. (Bug#10169)
9759
9760 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9761
9762 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9763 verifies glyph row's hash code--we have just reallocated the
9764 glyphs, so their contents can be complete garbage. (Bug#10164)
9765
9766 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
9767
9768 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9769
9770 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9771
9772 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9773 attributes are tested _before_ calling verify_row_hash, to protect
9774 against GCC re-ordering of the tests. (Bug#10164)
9775
9776 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9777
9778 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9779
9780 * xterm.c (handle_one_xevent): Only set async_visible and friends
9781 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9782 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9783 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9784
9785 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9786
9787 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9788 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9789 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9790 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9791 All uses changed to use GCPRO1 etc.
9792 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9793 Revert to old implementation (i.e., before 2011-03-11).
9794
9795 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9796
9797 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9798 of scroll runs so as to avoid assigning disabled bogus rows and
9799 unnecessary graphics copy operations.
9800
9801 2011-11-27 Eli Zaretskii <eliz@gnu.org>
9802
9803 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9804 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9805 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9806 (malloc, free, realloc, calloc): Redirect to e_* only when
9807 compiling Emacs.
9808
9809 * lisp.h (GCTYPEBITS): Move before first use.
9810 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9811 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9812 this macro definition.
9813
9814 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9815 _MSC_VER.
9816
9817 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9818
9819 * gtkutil.c (xg_create_frame_widgets):
9820 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9821 present with Gtk+ 2.0.
9822
9823 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9824
9825 * fileio.c (Finsert_file_contents): Undo previous change; see
9826 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9827
9828 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9829
9830 Rename locals to avoid shadowing.
9831 * fileio.c (Finsert_file_contents):
9832 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9833 * process.c (wait_reading_process_output):
9834 Rename inner 'proc' to 'p' to avoid shadowing.
9835 Indent for consistency with usual Emacs style.
9836
9837 2011-11-25 Eli Zaretskii <eliz@gnu.org>
9838
9839 * xdisp.c (redisplay_window): If cursor row is not fully visible
9840 after recentering, and scroll-conservatively is set to a large
9841 number, scroll window by a few more lines to make the cursor fully
9842 visible and out of scroll-margin. (Bug#10105)
9843 (start_display): Don't move to the next line if the display should
9844 start at a newline that is part of a display vector or an overlay
9845 string. (Bug#10119)
9846
9847 2011-11-24 Juri Linkov <juri@jurta.org>
9848
9849 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9850 after the `MagickPingImage' call. (Bug#10112)
9851
9852 2011-11-23 Chong Yidong <cyd@gnu.org>
9853
9854 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9855
9856 2011-11-23 Martin Rudalics <rudalics@gmx.at>
9857
9858 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9859 making another buffer current. (Bug#10114)
9860
9861 2011-11-23 Glenn Morris <rgm@gnu.org>
9862
9863 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9864
9865 2011-11-23 Chong Yidong <cyd@gnu.org>
9866
9867 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9868 using it (Bug#5984).
9869
9870 2011-11-22 Eli Zaretskii <eliz@gnu.org>
9871
9872 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9873 and header-lines, as they don't have one computed for them.
9874 (Bug#10098)
9875
9876 * .gdbinit (prow): Make displayed values more self-explaining.
9877 Add row's hash code.
9878
9879 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9880
9881 * process.c (wait_reading_process_output): Fix asynchrounous
9882 GnuTLS socket handling on some versions of the GnuTLS library.
9883 (wait_reading_process_output): Add comment and URL.
9884
9885 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9886
9887 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9888
9889 2011-11-21 Chong Yidong <cyd@gnu.org>
9890
9891 * window.c (Fnext_window, Fprevious_window): Doc fix.
9892
9893 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9894
9895 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9896
9897 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9898
9899 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9900
9901 2011-11-20 Martin Rudalics <rudalics@gmx.at>
9902
9903 * window.c (Fset_window_combination_limit): Rename argument
9904 STATUS to LIMIT.
9905 (Vwindow_combination_limit): Remove "status" from doc-string.
9906
9907 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9908
9909 * m/ibms390.h: Remove.
9910 * m/ibms390x.h: Don't include "ibms390.h".
9911
9912 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9913
9914 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9915 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9916
9917 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9918
9919 * casetab.c (Fset_case_table):
9920 * charset.c (Fcharset_after): Fix typos.
9921
9922 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9923
9924 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9925 Otherwise, valgrind does not work on some platforms.
9926 Problem reported by Andreas Schwab in
9927 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9928 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9929 is set, removing the need for VIRT_ADDRESS_VARIES.
9930 (PURE_P): Use a more-efficient implementation that needs just one
9931 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9932 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9933 to 4 (xorl, subq, cmpq, setbe).
9934 * alloc.c (pure): Always extern now, since that's the
9935 VIRT_ADDR_VARIES behavior.
9936 (PURE_POINTER_P): Use a single comparison, not two, for
9937 consistency with the new puresize.h.
9938 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9939 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9940 Remove VIRT_ADDR_VARIES no longer needed.
9941
9942 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9943
9944 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9945 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9946 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9947 behave as if the cursor position were at the window margin.
9948
9949 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9950 and the cursor position is out of bounds, behave as if the cursor
9951 position were at the window margin. (Bug#10075)
9952
9953 2011-11-18 Chong Yidong <cyd@gnu.org>
9954
9955 * window.c (Fwindow_combination_limit): Make first argument
9956 non-optional, since it is meaningless for live windows like the
9957 selected window.
9958
9959 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9960
9961 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9962
9963 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9964
9965 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9966 (graft_intervals_into_buffer): Simplify.
9967
9968 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9969
9970 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9971 hash values of the two rows.
9972 (copy_row_except_pointers): Preserve the used[] arrays and the
9973 hash values of the two rows. (Bug#10035)
9974 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9975
9976 * xdisp.c (row_hash): New function, body extracted from
9977 compute_line_metrics.
9978 (compute_line_metrics): Call row_hash, instead of computing the
9979 hash code inline.
9980
9981 * dispnew.c (verify_row_hash): Call row_hash for computing the
9982 hash code of a row, instead of duplicating code from xdisp.c.
9983
9984 * dispextern.h (row_hash): Add prototype.
9985
9986 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9987
9988 * frame.c (delete_frame): Don't delete the terminal when the last
9989 X frame is closed if emacs is built with GTK toolkit.
9990
9991 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9992
9993 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9994
9995 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9996
9997 * window.c (Vwindow_splits): Rename to
9998 Vwindow_combination_resize. Suggested by Juri Linkov.
9999 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10000 of Vwindow_splits.
10001
10002 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10003
10004 * nsfns.m (Fns_font_name):
10005 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10006
10007 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10008
10009 * window.h (window): Rename slot "nest" to "combination_limit".
10010 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10011 (Fset_window_nest): Rename to Fset_window_combination_limit.
10012 (Vwindow_nest): Rename to Vwindow_combination_limit.
10013 (recombine_windows, make_parent_window, make_window)
10014 (Fsplit_window_internal, saved_window)
10015 (Fset_window_configuration, save_window_save): Rename all
10016 occurrences of window_nest to window_combination_limit.
10017
10018 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10019
10020 * image.c (imagemagick_load_image): Fix typo.
10021
10022 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10023
10024 * xdisp.c (display_line): Move the call to
10025 highlight_trailing_whitespace before the call to
10026 compute_line_metrics, since the latter needs to see the final
10027 faces of all the glyphs to compute ROW's hash value.
10028 Fixes assertion violations in row_equal_p. (Bug#10035)
10029
10030 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10031
10032 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10033 just return (bug#10044).
10034
10035 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10036
10037 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10038 with user-defined heap size. Bump the default size of the temacs
10039 heap to 27MB, to avoid memory warning when running temacs.
10040 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10041
10042 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10043 current_matrix and desired_matrix. (Bug#9990)
10044 (verify_row_hash) [XASSERTS]: New function.
10045 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10046 that the hash value of glyph rows is correct.
10047
10048 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10049
10050 * window.h (window): Remove splits slot.
10051 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10052 (Fdelete_other_windows_internal, make_parent_window)
10053 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10054 (Fset_window_configuration, save_window_save): Don't deal with
10055 split status of windows.
10056 (saved_window): Remove splits slot.
10057 (Vwindow_splits): Rewrite doc-string.
10058
10059 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10060
10061 * xfns.c (unwind_create_frame):
10062 * nsfns.m (unwind_create_frame):
10063 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10064 Vframe_list (Bug#9999).
10065
10066 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10067
10068 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10069
10070 2011-11-11 Kenichi Handa <handa@m17n.org>
10071
10072 * callproc.c (Fcall_process): Set the member dst_multibyte of
10073 process_coding.
10074
10075 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10076
10077 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10078 avoid a crash (bug#9496).
10079
10080 2011-11-09 Chong Yidong <cyd@gnu.org>
10081
10082 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10083 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10084
10085 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10086
10087 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10088
10089 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10090
10091 Avoid some portability problems by eschewing 'extern inline' functions.
10092 The trivial performance wins aren't worth the portability hassles; see
10093 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10094 et seq.
10095 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10096 (window_box_width, window_box_left, window_box_left_offset)
10097 (window_box_right, window_box_right_offset): Undo previous change,
10098 by removing the "extern"s.
10099 * intervals.c (adjust_intervals_for_insertion)
10100 (adjust_intervals_for_deletion): Undo previous change,
10101 making these static again.
10102 (offset_intervals, temp_set_point_both, temp_set_point)
10103 (copy_intervals_to_string): No longer inline.
10104 * xdisp.c (window_text_bottom_y, window_box_width)
10105 (window_box_height, window_box_left_offset)
10106 (window_box_right_offset, window_box_left, window_box_right)
10107 (window_box): No longer inline.
10108
10109 2011-11-08 Chong Yidong <cyd@gnu.org>
10110
10111 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10112 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10113 Signal an error if not a live window.
10114 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10115 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10116
10117 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
10118
10119 * lisp.h (syms_of_abbrev): Remove declaration.
10120 Reported by CHENG Gao <chenggao@royau.me>.
10121
10122 2011-11-07 Eli Zaretskii <eliz@gnu.org>
10123
10124 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10125 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10126 of temacs in GUI mode.
10127
10128 2011-11-07 Martin Rudalics <rudalics@gmx.at>
10129
10130 * window.h: Declare delete_all_child_windows instead of
10131 delete_all_subwindows.
10132 * window.c (Fwindow_nest, Fset_window_nest)
10133 (Fset_window_new_total, Fset_window_new_normal)
10134 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10135 (delete_all_subwindows): Rename to delete_all_child_windows.
10136 (Fdelete_other_windows_internal, Fset_window_configuration):
10137 Call delete_all_child_windows instead of delete_all_subwindows.
10138 * frame.c (delete_frame): Call delete_all_child_windows instead
10139 of delete_all_subwindows.
10140
10141 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10142
10143 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10144 This is also needed for porting to any host where GC_MARK_STACK is
10145 not GC_MAKE_GCPROS_NOOPS.
10146 (which_symbols): Use it.
10147
10148 2011-11-07 Kenichi Handa <handa@m17n.org>
10149
10150 * coding.c (coding_set_destination): Check coding->src_pos only
10151 when coding->src_object is a buffer (bug#9910).
10152
10153 * process.c (send_process): Set the member src_multibyte of coding
10154 to 0 (bug#9911) when sending a unibyte text.
10155
10156 * callproc.c (Fcall_process): Set the member src_multibyte of
10157 process_coding to 0 (bug#9912).
10158
10159 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10160
10161 * xmenu.c (cleanup_widget_value_tree): New function.
10162 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10163 calling free_menubar_widget_value_tree directly (Bug#9830).
10164
10165 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10166
10167 Fix some portability problems with 'inline'.
10168 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10169 (window_box_width, window_box_left, window_box_left_offset)
10170 (window_box_right, window_box_right_offset): Declare extern.
10171 Otherwise, these inline functions do not conform to C99 and
10172 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10173 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10174 * intervals.c (adjust_intervals_for_insertion)
10175 (adjust_intervals_for_deletion): Now extern, because otherwise the
10176 extern inline functions 'offset_intervals' couldn't refer to it.
10177 (static_offset_intervals): Remove.
10178 (offset_intervals): Rewrite using the old contents of
10179 static_offset_intervals. The old version didn't conform to C99
10180 because an extern inline function contained a reference to an
10181 identifier with static linkage.
10182
10183 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10184
10185 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10186 GC.
10187
10188 2011-11-06 Eli Zaretskii <eliz@gnu.org>
10189
10190 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10191 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10192 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10193 return Qleft_to_right.
10194
10195 2011-11-06 Chong Yidong <cyd@gnu.org>
10196
10197 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10198 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10199 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10200 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10201 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10202 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10203 (Fwindow_vscroll): Doc fix.
10204 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10205 argument, since it makes no sense to pass a live window and for
10206 consistency with window-child.
10207
10208 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10209
10210 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10211 support MSVC.
10212
10213 2011-11-05 Jason Rumney <jasonr@gnu.org>
10214
10215 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10216 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10217 fonts (Bug#6029).
10218 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10219 bitwise arithmetic preventing use of unicode-sip and non-truetype
10220 opentype fonts.
10221
10222 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10223
10224 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10225 "emacs"-only part.
10226
10227 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10228 initialization code to keep similarity to xfns.c after changes
10229 from 2011-11-05.
10230
10231 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10232
10233 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10234 (unwind_create_frame): New function (Bug#9943).
10235 (Fx_create_frame): Restructure code to be more similar to the one in
10236 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10237 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10238 Move terminal->reference_count++ just before making the frame official
10239 (Bug#9943).
10240
10241 * nsterm.m (x_free_frame_resources): New function.
10242 (x_destroy_window): Move code to x_free_frame_resources.
10243
10244 * xfns.c (unwind_create_frame): Fix comment.
10245 (Fx_create_frame, x_create_tip_frame):
10246 Move terminal->reference_count++ just before making the frame
10247 official. Move initialization of image_cache_refcount and
10248 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10249
10250 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10251
10252 Support MSVC build with newer versions of Visual Studio.
10253 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10254 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10255 nt/gmake.defs.
10256
10257 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10258 which are not supported by MSVC.
10259 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10260 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10261 bitfields.
10262 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10263 types in bitfields.
10264 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10265
10266 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10267
10268 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
10269
10270 Support MSVC build with newer versions of Visual Studio.
10271 * w32.c: Don't include w32api.h for MSVC.
10272 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10273
10274 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10275 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10276 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10277 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10278 e_* cousins.
10279 (alloca) [_MSC_VER]: Define to _alloca.
10280
10281 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10282
10283 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10284
10285 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10286
10287 * xdisp.c (note_mouse_highlight): If either of
10288 previous/next-single-property-change returns nil, treat that as
10289 the beginning or the end of the buffer. (Bug#9955)
10290
10291 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10292
10293 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10294 label is not null (Bug#9951).
10295 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10296 may be NULL.
10297
10298 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10299
10300 * window.c (Fwindow_body_size): Mention in the doc string that the
10301 return value is in frame's canonical units. (Bug#9949)
10302
10303 2011-11-03 Eli Zaretskii <eliz@gnu.org>
10304
10305 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10306
10307 * w32fns.c (unwind_create_frame): If needed, free the glyph
10308 matrices of the partially constructed frame. (Bug#9943)
10309 * xfns.c (unwind_create_frame): Likewise.
10310
10311 2011-11-01 Eli Zaretskii <eliz@gnu.org>
10312
10313 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10314 Don't stop backward scan on the continuation glyph, even though
10315 its CHARPOS is positive.
10316 (mouse_face_from_buffer_pos, note_mouse_highlight):
10317 Rename cover_string to disp_string.
10318
10319 2011-11-01 Martin Rudalics <rudalics@gmx.at>
10320
10321 * window.c (temp_output_buffer_show): Don't use
10322 Vtemp_buffer_show_specifiers.
10323 (Vtemp_buffer_show_specifiers): Remove unused variable.
10324
10325 2011-10-30 Eli Zaretskii <eliz@gnu.org>
10326
10327 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10328 past the beginning of the current glyph matrix.
10329
10330 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
10331
10332 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10333 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10334 HAVE_GTK3 (Bug#9869).
10335
10336 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10337 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10338
10339 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10340
10341 * xterm.c: Declare x_handle_net_wm_state to return int.
10342 (handle_one_xevent): Check if we are iconified but don't have
10343 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10344 (get_current_wm_state): Return non-zero if not hidden,
10345 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10346 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10347 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10348 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10349
10350 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10351
10352 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10353 so that this new function doesn't get optimized away by a
10354 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10355
10356 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10357
10358 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10359
10360 2011-10-29 Eli Zaretskii <eliz@gnu.org>
10361
10362 Fix the `xbytecode' command.
10363 * .gdbinit (xprintbytestr): New command.
10364 (xwhichsymbols): Rename from `which'; all callers changed.
10365 (xbytecode): Print the byte-code string as well.
10366
10367 2011-10-29 Kim Storm <storm@cua.dk>
10368
10369 * alloc.c (which_symbols): New function.
10370
10371 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10372
10373 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10374 line. (Bug#9903)
10375
10376 2011-10-29 Glenn Morris <rgm@gnu.org>
10377
10378 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10379 Not clear what it was for, and it causes various bugs. (Bug#9839)
10380
10381 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10382
10383 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10384 possible random value that matches one of those tested as
10385 condition to clear the mouse face.
10386
10387 2011-10-28 Chong Yidong <cyd@gnu.org>
10388
10389 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10390
10391 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10392
10393 * window.c (make_window): Initialize phys_cursor_on_p.
10394
10395 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10396
10397 * lisp.h (struct Lisp_Symbol): Update comments.
10398
10399 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
10400
10401 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10402
10403 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10404
10405 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10406 <oslsachem@gmail.com> for helping to debug this.
10407
10408 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10409 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10410 (g_b_init_get_glyph_outline_w): New static variables.
10411 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10412 (GetGlyphOutlineW_Proc): New typedefs.
10413 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10414 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10415 New functions.
10416 (w32font_open_internal, compute_metrics):
10417 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10418 instead of calling the "wide" APIs directly.
10419
10420 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10421
10422 * w32.h (syms_of_w32font): Add prototype.
10423
10424 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10425
10426 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10427 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10428 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10429 (Fmove_to_window_line): Doc fix.
10430
10431 2011-10-27 Chong Yidong <cyd@gnu.org>
10432
10433 * process.c (make_process): Set gnutls_state to NULL.
10434
10435 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10436 non-NULL, regardless of GNUTLS_INITSTAGE.
10437 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10438 an error. Set process slots as soon as we allocate them.
10439
10440 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10441
10442 2011-10-27 Chong Yidong <cyd@gnu.org>
10443
10444 * gnutls.c (emacs_gnutls_deinit): New function.
10445 Deallocate credentials structures as well as calling gnutls_deinit.
10446 (Fgnutls_deinit, Fgnutls_boot): Use it.
10447
10448 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10449 (deactivate_process): Call emacs_gnutls_deinit.
10450
10451 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10452
10453 * image.c (x_create_x_image_and_pixmap):
10454 * w32.c (sys_rename, w32_delayed_load):
10455 * w32font.c (fill_in_logfont):
10456 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10457
10458 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10459
10460 * w32fns.c (w32_default_color_map): New function,
10461 extracted from Fw32_default_color_map.
10462 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10463
10464 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10465
10466 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10467
10468 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10469
10470 * keyboard.c (test_undefined): New function (bug#9751).
10471 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10472
10473 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10474
10475 * sysdep.c (init_sys_modes): Fix the check for the controlling
10476 terminal (Bug#6649).
10477
10478 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10479
10480 * dispextern.h (struct bidi_it): New member next_en_type.
10481
10482 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10483 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10484 current character, check also for next_en_type being WEAK_EN.
10485 (bidi_resolve_weak): Don't enter the expensive loop if the current
10486 position is before next_en_pos. Record the bidi type of the first
10487 non-ET, non-BN character we find, in addition to its position.
10488 (bidi_level_of_next_char): Invalidate next_en_type when
10489 next_en_pos is over-stepped.
10490
10491 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10492
10493 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10494 * editfns.c: Rewrite current-time-zone so that it invokes
10495 the equivalent of (format-time-string "%Z") to get the time zone name.
10496 This fixes a bug when the time zone name contains characters that
10497 need converting from the system time locale to Emacs internal format.
10498 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10499 that patch fixed format-time-string to do the conversion, but
10500 I forgot to fix current-time-zone.
10501 (format_time_string): New function, containing most of
10502 what Fformat_time_string used to contain.
10503 (Fformat_time_string): Rewrite in terms of format_time_string.
10504 This doesn't change this function's behavior.
10505 (current-time-zone): Rewrite to use format_time_string.
10506 This fixes the bug reported by Michael Schierl in
10507 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10508 Jason Rumney's 2007-06-07 change worked around this bug, but
10509 didn't fix it.
10510 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10511
10512 2011-10-19 Eli Zaretskii <eliz@gnu.org>
10513
10514 * xdisp.c (start_display): If the character at POS is displayed
10515 via a display vector, reset IT->current.dpvec_index to zero.
10516 (try_window_reusing_current_matrix): If a line ends in a display
10517 vector or the next line starts in a display vector, continue
10518 redrawing the window even though the character position of
10519 start_row was reached.
10520 (Bug#9771, part 2)
10521
10522 2011-10-18 Chong Yidong <cyd@gnu.org>
10523
10524 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10525 with nobreak-char-display too.
10526
10527 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10528
10529 Fix part 3 of bug#9771.
10530 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10531 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10532 non-neutral characters if the current character is a paragraph
10533 separator (a.k.a. Newline). This avoids running the same
10534 expensive loop twice, once when we consume the preceding newline
10535 and the other time when the line actually needs to be displayed.
10536 Avoid the loop when we see neutrals on the base embedding level
10537 following a character whose directionality is the same as the
10538 paragraph's. This avoids running the expensive loop when a line
10539 ends in a long sequence of neutrals, like control characters.
10540 Add assertion against STRONG_AL type. Slightly rearrange code
10541 that determines the type of a neutral given the first non-neutral
10542 that follows it.
10543 (bidi_level_of_next_char): Set next_en_pos to zero when
10544 invalidating its info.
10545
10546 2011-10-17 Eli Zaretskii <eliz@gnu.org>
10547
10548 * xdisp.c (push_display_prop): Determine whether to record string
10549 or buffer position by IT->string, not by IT->method. Allow
10550 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10551 (move_it_vertically_backward): Don't look for character position
10552 immediately after the newline when in a continuation line.
10553 (Bug#9771, part 1)
10554
10555 2011-10-15 Martin Rudalics <rudalics@gmx.at>
10556
10557 * window.c (coordinates_in_window): Rewrite and delabelize
10558 vertical border check. (Bug#5357) (Bug#9618)
10559
10560 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10561
10562 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10563 errors in XSetWindowBorder (bug#9310).
10564
10565 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10566
10567 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10568 avoid crash when xmalloc overrun checking is enabled.
10569
10570 2011-10-13 Eli Zaretskii <eliz@gnu.org>
10571
10572 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10573 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10574 cursor motion with <left> and <right> arrow keys.
10575
10576 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10577 some callers set that themselves.
10578
10579 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10580
10581 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10582 display string and the previous row comes from the same string and
10583 is empty. (Bug#9739) (Bug#9738)
10584
10585 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10586
10587 * doc.c (get_doc_string): Encode file name (bug#9735).
10588
10589 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10590
10591 * bidi.c (bidi_level_of_next_char):
10592 * xdisp.c (get_visually_first_element): Remove old incorrect
10593 comments regarding the Unicode Line Separator character.
10594
10595 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10596
10597 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10598
10599 * alloc.c (Fgc_status): Do not access beyond zombies array
10600 boundary if nzombies > MAX_ZOMBIES.
10601 * alloc.c (dump_zombies): Add missing format specifier.
10602
10603 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10604
10605 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10606 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10607
10608 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10609 Some packages use them to denote characters with modifiers.
10610
10611 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10612
10613 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10614 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10615 matching a pp-number. Rename parameter var to var1.
10616
10617 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10618
10619 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10620
10621 2011-10-08 Glenn Morris <rgm@gnu.org>
10622
10623 * callint.c (Fcall_interactively): Give a more explicit error for the
10624 'c' case with a non-character input. (Bug#8479)
10625
10626 2011-10-08 Eli Zaretskii <eliz@gnu.org>
10627
10628 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10629 lines.
10630 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10631 lines that are hscrolled on the left.
10632
10633 * dispnew.c (buffer_posn_from_coords): Account for a possible
10634 presence of header-line. (Bug#4426)
10635
10636 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10637
10638 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10639 Don't advertise functionality which we discourage or doesn't work.
10640
10641 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10642
10643 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10644 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10645 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10646 this makes Emacs dump core during garbage collection on rare
10647 occasions. sizeof is obviously inferior to offsetof here, so
10648 stick with offsetof.
10649 (GC_POINTER_ALIGNMENT): New macro.
10650 (mark_memory): Omit 3rd (offset) arg; caller changed.
10651 Don't assume EMACS_INT alignment is the same as pointer alignment.
10652
10653 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10654
10655 * keyboard.c (read_key_sequence_remapped): New var.
10656 (read_key_sequence): Compute remapping in the right buffer.
10657 (command_loop_1): Use read_key_sequence's remapping directly.
10658
10659 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10660
10661 * dired.c (file_name_completion): Don't expand file name.
10662 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10663 before checking file name handler.
10664
10665 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10666 they've been requested explicitly (bug#9591).
10667
10668 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
10669
10670 * keymap.c (Fsingle_key_description): Use make_specified_string
10671 instead of build_string to build string from push_key_description.
10672 (Bug#5193)
10673
10674 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10675
10676 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10677 This fixes a Y2038 bug on 64-bit hosts.
10678 * buffer.c (reset_buffer):
10679 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10680 (Fclear_buffer_auto_save_failure):
10681 Use 0, not -1, to represent an unset failure time, since time_t
10682 might not be signed.
10683
10684 Remove dependency on glibc malloc internals.
10685 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10686 Move back here from lisp.h, but with their new implementations.
10687 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10688 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10689 * charset.c (charset_table_init): New static var.
10690 (syms_of_charset): Use it instead of xmalloc. This removes a
10691 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10692 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10693 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10694 Move back to alloc.c.
10695 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10696 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10697
10698 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10699
10700 * nsterm.m (windowDidResize): Call x_set_window_size only when
10701 ns_in_resize is true. Otherwise set pixelwidth/height and
10702 call change_frame_size (Bug#9628).
10703
10704 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10705
10706 Port --enable-checking=all to Fedora 14 x86-64.
10707 * charset.c (syms_of_charset): Also account for glibc malloc's
10708 internal overhead when calculating the initial malloc maximum.
10709
10710 Port --enable-checking=all to Fedora 14 x86.
10711 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10712 Move to lisp.h.
10713 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10714 (overrun_check_realloc, overrun_check_free):
10715 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10716 That way, xmalloc returns a properly-aligned pointer even if
10717 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10718 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10719 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10720 into account when calculating the initial malloc maximum.
10721 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10722 Move here from alloc.c, so that charset.c can use it too.
10723 Properly align; the old code wasn't right for common 32-bit hosts
10724 when configured with --enable-checking=all.
10725 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10726 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10727
10728 2011-09-29 Eli Zaretskii <eliz@gnu.org>
10729
10730 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10731 use EDOM.
10732
10733 2011-09-28 Eli Zaretskii <eliz@gnu.org>
10734
10735 * xdisp.c (compute_display_string_end): If there's no display
10736 string at CHARPOS, return -1.
10737
10738 * bidi.c (bidi_fetch_char): When compute_display_string_end
10739 returns a negative value, treat the character as a normal
10740 character not covered by a display string. (Bug#9624)
10741
10742 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
10743
10744 * lread.c (Fread_from_string): Fix typo in docstring.
10745
10746 2011-09-27 Eli Zaretskii <eliz@gnu.org>
10747
10748 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10749 newline, reseat the iterator instead of bidi-iterating there one
10750 character at a time. (Bug#9610)
10751 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10752 TO_CHARPOS if the bidi iterator is at base embedding level.
10753
10754 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10755
10756 * lread.c (readevalloop): Use correct code for NBSP.
10757 (read1): Likewise. (Bug#9608)
10758
10759 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
10760
10761 * dbusbind.c (Fdbus_register_signal): When service is not
10762 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10763
10764 2011-09-25 Glenn Morris <rgm@gnu.org>
10765
10766 * buffer.c (truncate-lines): Doc fix.
10767
10768 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
10769
10770 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10771 (Fset_window_next_buffers): Doc fix.
10772
10773 2011-09-24 Glenn Morris <rgm@gnu.org>
10774
10775 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10776
10777 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10778
10779 Fix minor problems found by static checking.
10780 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10781 * indent.c (Fvertical_motion): Fix == vs = typo.
10782
10783 2011-09-24 Eli Zaretskii <eliz@gnu.org>
10784
10785 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10786 Default value is now t. Doc fix.
10787
10788 * indent.c (Fvertical_motion): Compute and apply the overshoot
10789 logic when moving up, not only when moving down. Fix the
10790 confusing name and values of the it_overshoot_expected variable;
10791 logic changes accordingly. (Bug#9254) (Bug#9549)
10792
10793 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10794 CHARPOS is covered by a display string which includes newlines.
10795 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10796 is covered by a display string with embedded newlines.
10797
10798 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
10799
10800 * dbusbind.c (Fdbus_register_signal): Add match rule to
10801 Vdbus_registered_objects_table. (Bug#9581)
10802 (Fdbus_register_method, Vdbus_registered_objects_table):
10803 Fix docstring.
10804
10805 2011-09-24 Jim Meyering <meyering@redhat.com>
10806
10807 do not ignore write error for any output size
10808 The previous change was incomplete.
10809 While it makes emacs --batch detect the vast majority of stdout
10810 write failures, errors were still ignored whenever the output size is
10811 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10812 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10813 && echo FAIL: ignored write error
10814 FAIL: ignored write error
10815 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10816 && echo FAIL: ignored write error
10817 FAIL: ignored write error
10818 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10819
10820 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10821
10822 * emacs.c (Fkill_emacs): In noninteractive mode exit
10823 non-successfully if a write error occurred on stdout. (Bug#9574)
10824
10825 2011-09-21 Eli Zaretskii <eliz@gnu.org>
10826
10827 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10828 the xassert test.
10829
10830 * dispextern.h (struct it): Update the comment documenting what
10831 can it->OBJECT be.
10832
10833 2011-09-20 Eli Zaretskii <eliz@gnu.org>
10834
10835 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10836 a display string, extend search for cursor position to end of row.
10837 (find_row_edges): If the row ends in a newline from a display
10838 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10839 Handle the case of a display string with multiple newlines.
10840 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10841 non-empty line. Fixes confusing cursor motion with arrow keys at
10842 the beginning of a line that starts with whitespace.
10843
10844 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10845
10846 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10847 (bug#9493).
10848
10849 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
10850
10851 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10852 boolean (Bug#9154).
10853
10854 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10855
10856 * xdisp.c (display_line): Record maximum and minimum buffer
10857 positions even if no glyphs were produced (e.g., by a zero-width
10858 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10859 buffer positions that will be removed from the glyph row because
10860 they don't fit.
10861 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10862 column is beyond frame width: don't subtract 1 "pixel" when
10863 computing width of the stretch.
10864 (reseat_at_next_visible_line_start): Undo the change made on
10865 2011-09-17 that saved paragraph information and restored it after
10866 the call to `reseat'. (Bug#9545)
10867
10868 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10869
10870 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10871 and turn window cursor on if cleared (Bug#9415).
10872
10873 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10874
10875 * search.c (boyer_moore): Take unibyte characters from pattern
10876 literally. (Bug#9458)
10877
10878 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10879
10880 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10881
10882 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10883
10884 Fix minor problem found by static checking.
10885 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10886 initialized, to pacify gcc -Wuninitialized.
10887
10888 * fileio.c: Report proper errno when syscall falls.
10889 (Finsert_file_contents): Save and restore errno,
10890 so that report_file_error outputs the correct diagnostic.
10891 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10892
10893 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10894
10895 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10896
10897 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10898
10899 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10900 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10901
10902 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10903
10904 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10905 about the current paragraph and restore it after the call to reseat.
10906
10907 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10908 (bidi_find_paragraph_start): Search back for paragraph beginning
10909 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10910 (bidi_move_to_visually_next): Only trigger paragraph-related
10911 computations when the last character is a newline or at EOB, not
10912 just any NEUTRAL_B. (Bug#9470)
10913
10914 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10915 truncated lines if point is covered by a display string. (Bug#9524)
10916
10917 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10918
10919 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10920 (cons_to_x_long): New function.
10921 (lisp_data_to_selection_data): Use it. Correct the test for
10922 short-versus-long data; it was negated. Break out of vector
10923 loop, for efficiency, when a long datum is discovered.
10924
10925 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10926
10927 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10928
10929 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10930
10931 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10932 GCC PR/17406) by declaring this function with external scope.
10933
10934 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10935
10936 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10937 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10938
10939 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10940
10941 * editfns.c (Fformat): Correctly handle text properties on "%%".
10942
10943 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10944
10945 * xterm.c (x_draw_composite_glyph_string_foreground):
10946 * w32term.c (x_draw_composite_glyph_string_foreground):
10947 * term.c (encode_terminal_code):
10948 * composite.c (composition_update_it, get_composition_id):
10949 * xdisp.c (get_next_display_element)
10950 (fill_composite_glyph_string): Add comments about special meaning
10951 of TAB characters in a composition.
10952
10953 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10954
10955 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10956 This occurs when processing a multibyte format.
10957 Problem reported by Wolfgang Jenker.
10958
10959 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10960
10961 * xdisp.c (try_cursor_movement): Only check for exact match if
10962 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10963
10964 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10965
10966 Remove unused external symbols.
10967 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10968 * xdisp.c (calc_pixel_width_or_height): Now static.
10969 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10970 * indent.c (check_display_width):
10971 * w32term.c: Fix comment to match code.
10972 * xterm.c, xterm.h (x_catching_errors): Remove.
10973
10974 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10975
10976 * xselect.c: Use signed conversions more consistently (Bug#9498).
10977 (selection_data_to_lisp_data): Assume incoming selection data are
10978 signed integers, not unsigned. This is to be consistent with
10979 outgoing selection data, which was modified to use signed integers
10980 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10981 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10982 expects long, not unsigned long.
10983
10984 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10985
10986 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10987 computation of loop end. Reported by Johan Bockgård
10988 <bojohan@gnu.org>.
10989
10990 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10991
10992 * frame.c (Fother_visible_frames_p): Function deleted.
10993
10994 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10995
10996 * indent.c (compute_motion): Process display vector front to back
10997 rather than the other way around. (Bug#2496)
10998
10999 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11000
11001 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11002
11003 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11004
11005 * minibuf.c (Fread_from_minibuffer): Doc fix.
11006
11007 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11008
11009 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11010 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11011
11012 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11013
11014 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11015 value for non-existent files.
11016
11017 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11018
11019 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11020 set its "size" to -1. This will set the modtime_size field of
11021 the corresponding buffer to -1, which is what
11022 verify-visited-file-modtime expects for files that do not exist.
11023 (Bug#9139)
11024
11025 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11026
11027 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11028 here ...
11029 * lisp.h: ... from here. push_key_description is no longer
11030 defined in keyboard.c, so its declaration should not be in
11031 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11032 logically belongs with push_key_description.
11033
11034 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11035
11036 * buffer.h: Include <sys/types.h> instead of <time.h>.
11037 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11038 Problem reported by Herbert J. Skuhra.
11039
11040 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11041
11042 * xml.c (parse_region): Make the parsing work for
11043 non-comment-starting XML files again (bug#9144).
11044
11045 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11046
11047 * image.c (gif_load): Fix calculation of bottom and right corner.
11048 (Bug#9468)
11049
11050 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11051
11052 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11053 redisplay in small windows.
11054
11055 2011-09-09 Eli Zaretskii <eliz@gnu.org>
11056
11057 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11058
11059 2011-09-08 Martin Rudalics <rudalics@gmx.at>
11060
11061 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11062 Operate on live windows only.
11063
11064 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
11065
11066 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11067
11068 2011-09-07 Eli Zaretskii <eliz@gnu.org>
11069
11070 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11071 only under bidi iteration.
11072
11073 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11074
11075 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11076
11077 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11078
11079 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11080 Without this fix, the command to link temacs failed due to an
11081 undefined symbol __builtin_isnan. This is because
11082 /usr/include/iso/math_c99.h #defines isnan(x) to
11083 __builtin_isnan(x), but the bundled gcc, which identifies itself
11084 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11085 a __builtin_isnan.
11086 * floatfns.c (isnan): #undef, and then #define to a clone of
11087 what's in data.c.
11088 (Fisnan): Always define, since it's always available now.
11089 (syms_of_floatfns): Always define isnan at the Lisp level.
11090
11091 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11092
11093 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11094
11095 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11096
11097 * fileio.c: Fix bugs with large file offsets (Bug#9428).
11098 The previous code assumed that file offsets (off_t values) fit in
11099 EMACS_INT variables, which is not true on typical 32-bit hosts.
11100 The code messed up by falsely reporting buffer overflow in cases
11101 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11102 when "big" contains more than 2**29 bytes, even though this
11103 inserts just one byte and does not overflow the buffer.
11104 (Finsert_file_contents): Store file offsets as off_t
11105 values, not as EMACS_INT values. Check for overflow when
11106 converting between EMACS_INT and off_t. When checking for
11107 buffer overflow or for overlap, take the offsets into account.
11108 Don't use EMACS_INT for small values where int suffices.
11109 When checking for overlap, fix a typo: ZV was used where
11110 ZV_BYTE was intended.
11111 (Fwrite_region): Don't assume off_t fits into 'long'.
11112 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11113
11114 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
11115
11116 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11117
11118 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11119
11120 sprintf-related integer and memory overflow issues (Bug#9412).
11121
11122 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11123 (esprintf, exprintf, evxprintf): New functions.
11124 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11125 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11126 (modify_event_symbol): Do not assume that the length of
11127 name_alist_or_stem is safe to alloca and fits in int.
11128 (Fexecute_extended_command): Likewise for function name and binding.
11129 (Frecursion_depth): Wrap around reliably on integer overflow.
11130 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11131 since some callers pass EMACS_INT values.
11132 (Fsingle_key_description): Don't crash if symbol name contains more
11133 than MAX_ALLOCA bytes.
11134 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11135 (get_minibuffer): Arg is now EMACS_INT, not int.
11136 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11137 (esprintf, exprintf, evxprintf): New decls.
11138 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11139
11140 * dbusbind.c (signature_cat): New function.
11141 (xd_signature, Fdbus_register_signal):
11142 Do not overrun buffer; instead, report string overflow.
11143
11144 * dispnew.c (add_window_display_history): Don't overrun buffer.
11145 Truncate instead; this is OK since it's just a log.
11146
11147 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11148 even if the time zone offset is outlandishly large.
11149 Don't mishandle offset == INT_MIN.
11150
11151 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11152 when creating daemon; the previous buffer-overflow check was incorrect.
11153
11154 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11155 which has the guts of the old verror function.
11156
11157 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11158 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11159
11160 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11161 (font_unparse_xlfd): Don't blindly alloca long strings.
11162 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11163 fits in int, when using sprintf. Use single snprintf to count
11164 length of string rather than counting it via multiple sprintfs;
11165 that's simpler and more reliable.
11166 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11167 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11168 sprintf, in case result does not fit in int.
11169
11170 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11171 (fontset_from_font): Print it.
11172
11173 * frame.c (tty_frame_count): Now printmax_t, not int.
11174 (make_terminal_frame, set_term_frame_name): Print it.
11175 (x_report_frame_params): In X, window IDs are unsigned long,
11176 not signed long, so print them as unsigned.
11177 (validate_x_resource_name): Check for implausibly long names,
11178 and don't assume name length fits in 'int'.
11179 (x_get_resource_string): Don't blindly alloca invocation name;
11180 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11181 not fit in int.
11182
11183 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11184 (xg_check_special_colors, xg_set_geometry):
11185 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11186
11187 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11188 Use esprintf, not sprintf, in case result does not fit in int.
11189
11190 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11191 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11192 it as a large positive number.
11193 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11194 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11195
11196 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11197 in case result does not fit in int.
11198
11199 * print.c (float_to_string): Detect width overflow more reliably.
11200 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11201 buffer overrun. Don't assume list length fits in 'int'. Treat
11202 print length of 0 as 0, not as infinity; to be consistent with other
11203 uses of print length in this function. Don't overflow print length
11204 index. Don't assume hash table size fits in 'long', or that
11205 vectorlike size fits in 'unsigned long'.
11206
11207 * process.c (make_process): Use printmax_t, not int, to format
11208 process-name gensyms.
11209
11210 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11211
11212 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11213 to avoid potential buffer overrun.
11214
11215 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11216 if X resource line is longer than 512 bytes.
11217
11218 * xfns.c (x_window): Make sprintf buffer a bit bigger
11219 to avoid potential buffer overrun.
11220
11221 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11222
11223 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11224
11225 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11226
11227 Integer overflow fixes for scrolling, etc.
11228 Without these, Emacs silently mishandles large integers sometimes.
11229 For example, "C-u 4294967297 M-x recenter" was treated as if
11230 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11231
11232 * xdisp.c (try_window_id): Check Emacs fixnum range before
11233 converting to 'int'.
11234
11235 * window.c (window_scroll_line_based, Frecenter):
11236 Check that an Emacs fixnum is in range before assigning it to 'int'.
11237 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11238 values converted from Emacs fixnums.
11239 (Frecenter): Don't wrap around a line count if it is out of 'int'
11240 range; instead, treat it as an extreme value.
11241 (Fset_window_configuration, compare_window_configurations):
11242 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11243
11244 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11245 that can exceed INT_MAX. Check that EMACS_INT value is in range
11246 before assigning it to the (possibly-narrower) index.
11247 (match_limit): Don't assume that a fixnum can fit in 'int'.
11248
11249 * print.c (print_object): Use ptrdiff_t, not int, for index that can
11250 exceed INT_MAX.
11251
11252 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11253 (Fvertical_motion): Don't wrap around LINES values that don't fit
11254 in 'int'. Instead, treat them as extreme values. This is good
11255 enough for windows, which can't have more than INT_MAX lines anyway.
11256
11257 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11258
11259 * Require libxml/parser.h to avoid compilation warning.
11260
11261 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11262
11263 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11264 since this reportedly can destroy thread storage.
11265
11266 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
11267
11268 * syntax.c (find_defun_start): Update all cache variables if
11269 exiting early (Bug#9401).
11270
11271 2011-08-30 Eli Zaretskii <eliz@gnu.org>
11272
11273 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11274
11275 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11276 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11277 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11278
11279 * term.c (tty_append_glyph): New function.
11280 (produce_stretch_glyph): Static function and its prototype deleted.
11281
11282 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11283 Add prototypes.
11284
11285 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11286
11287 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11288 when checking :margin (Bug#9390).
11289 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11290 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11291 so that the name doesn't mislead. All uses changed.
11292
11293 2011-08-28 Johan Bockgård <bojohan@gnu.org>
11294
11295 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11296 set_tty_hooks.
11297
11298 2011-08-27 Eli Zaretskii <eliz@gnu.org>
11299
11300 * xdisp.c (move_it_to): Don't bail out early when reaching
11301 position beyond to_charpos, if we are scanning backwards.
11302 (move_it_vertically_backward): When DY == 0, make sure we get to
11303 the first character in the line after the newline.
11304
11305 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11306
11307 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11308 (ccl_driver): Do not generate an out-of-range pointer.
11309 (Fccl_execute_on_string): Remove unnecessary check for
11310 integer overflow, noted by Stefan Monnier in
11311 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11312 Remove a FIXME that didn't need fixing.
11313 Simplify the newly-introduced buffer reallocation code.
11314
11315 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
11316
11317 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11318
11319 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
11320
11321 Integer and memory overflow issues (Bug#9196).
11322
11323 * doc.c (get_doc_string): Rework so that
11324 get_doc_string_buffer_size is the actual buffer size, rather than
11325 being 1 less than the actual buffer size; this makes xpalloc more
11326 convenient.
11327
11328 * image.c (x_allocate_bitmap_record, cache_image):
11329 * xselect.c (Fx_register_dnd_atom):
11330 Simplify previous changes by using xpalloc.
11331
11332 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11333 since either will do and ptrdiff_t is convenient with xpalloc.
11334
11335 * charset.c (charset_table_size)
11336 (struct charset_sort_data.priority): Now ptrdiff_t.
11337 (charset_compare): Don't overflow if priorities differ greatly.
11338 (Fsort_charsets): Don't assume list length fits in int.
11339 Check for size-calculation overflow when allocating sort data.
11340 (syms_of_charset): Allocate an initial charset table that is
11341 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11342
11343 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11344
11345 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11346 The actual value is always <= INT_MAX, and leaving it unsigned made
11347 overflow checking harder.
11348
11349 * dispextern.h (struct glyph_matrix.rows_allocated)
11350 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11351 with xpalloc. The values are still always <= INT_MAX.
11352
11353 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11354
11355 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11356 (SAFE_NALLOCA): New macro.
11357
11358 * region-cache.c (struct boundary.pos, find_cache_boundary)
11359 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11360 (set_cache_region, invalidate_region_cache)
11361 (revalidate_region_cache, know_region_cache, region_cache_forward)
11362 (region_cache_backward, pp_cache):
11363 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11364 so that ptrdiff_t * can be passed to xpalloc.
11365 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11366 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11367 (pp_cache): Don't assume cache_len fits in int.
11368 * region-cache.h: Adjust extern decls to match.
11369
11370 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11371 EMACS_INT, since either will do, for xpalloc.
11372
11373 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11374 (xnmalloc, xnrealloc, xpalloc): New functions.
11375
11376 * bidi.c (bidi_shelve_header_size): New constant.
11377 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11378 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11379
11380 * bidi.c (bidi_cache_shrink):
11381 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11382 (overlay_strings):
11383 Don't update size of array until after memory allocation succeeds,
11384 because xmalloc/xrealloc may not return.
11385 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11386 now that we have proper integer overflow checking.
11387 (record_overlay_string, overlay_strings): Catch overflows when
11388 calculating size of overlay_str_buf.
11389
11390 * callproc.c (Fcall_process): Check for size overflow when
11391 calculating size of args2.
11392 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11393 Normally we prefer signed values, but sticking with ptrdiff_t would
11394 require adding more-complicated checks.
11395
11396 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11397 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11398 Redo buffer-overflow calculations to avoid integer overflow.
11399 Add a FIXME comment where memory seems to be over-allocated.
11400
11401 * character.c (Fstring): Check for size-calculation overflow.
11402
11403 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11404 unnecessary integer overflow. Check for size overflow.
11405 (encode_coding_object): Don't update size until xmalloc succeeds.
11406
11407 * composite.c (get_composition_id): Check for overflow in glyph
11408 length calculations.
11409
11410 Integer and memory overflow fixes for display code.
11411 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11412 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11413 (scrolling_window): Check for overflow in size calculations.
11414 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11415 Don't assume glyph table len fits in int.
11416 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11417 (row_table_size): Now ptrdiff_t, not int.
11418 (scrolling_window): Avoid overflow in size calculations.
11419 Don't update size until allocation succeeds.
11420 * fns.c (concat): Check for overflow in size calculations.
11421 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11422 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11423 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11424
11425 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11426 (get_doc_string): Check for size calculation overflow.
11427 Don't update size until allocation succeeds.
11428 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11429 EMACS_INT, where ptrdiff_t will do.
11430 (Fsubstitute_command_keys): Check for string overflow.
11431
11432 * editfns.c (set_time_zone_rule): Don't assume environment length
11433 fits in int.
11434 (message_length): Now ptrdiff_t, not int.
11435 (Fmessage_box): Don't update size until allocation succeeds.
11436 Don't assume message length fits in int.
11437 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11438
11439 * emacs.c (main): Do not reallocate argv, since there is a null at
11440 the end that can be overwritten, and this way there's no need to
11441 worry about size-calculation overflow.
11442 (sort_args): Check for size-calculation overflow.
11443
11444 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11445 alloc succeeds.
11446 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11447
11448 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11449 (x_set_scroll_bar_width, x_figure_window_size):
11450 Check for integer overflow.
11451 (x_set_alpha): Do not assume XINT fits in int.
11452
11453 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11454 This is for the members text_lines, text_cols, total_lines, total_cols,
11455 where the system imposes an 'int' limit.
11456
11457 * fringe.c (Fdefine_fringe_bitmap):
11458 Don't update size until alloc works.
11459
11460 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11461 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11462
11463 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11464 Check for size-calculation overflow.
11465 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11466 do, as we prefer signed integers.
11467 (id_to_widget.max_size, id_to_widget.used)
11468 (xg_store_widget_in_map, xg_remove_widget_from_map)
11469 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11470 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11471 Use and return ptrdiff_t, not int.
11472 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11473 * gtkutil.h: Change prototypes to match the above.
11474
11475 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11476 are duplicate now that they've been promoted to lisp.h.
11477 (x_allocate_bitmap_record, x_alloc_image_color)
11478 (make_image_cache, cache_image, xpm_load):
11479 Don't update size until alloc is done.
11480 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11481 (x_detect_edges):
11482 Check for size calculation overflow.
11483 (ct_colors_allocated_max): New constant.
11484 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11485 overflow.
11486
11487 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11488 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11489 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11490 Use ptrdiff_t, not int, to count maps.
11491 (read_char_minibuf_menu_prompt): Check for overflow in size
11492 calculations. Don't update size until allocation succeeds.
11493 Redo calculations to avoid overflow.
11494 * keyboard.h: Change prototypes to match the above.
11495
11496 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11497 to count maps.
11498 (current_minor_maps): Check for size calculation overflow.
11499 * keymap.h: Change prototypes to match the above.
11500
11501 * lread.c (read1, init_obarray): Don't update size until alloc done.
11502
11503 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11504 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11505
11506 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11507 Now ptrdiff_t, not int.
11508 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11509 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11510
11511 * process.c (Fnetwork_interface_list): Check for overflow
11512 in size calculation.
11513
11514 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11515
11516 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11517 overflow. Don't bother calling xmalloc when xrealloc will do.
11518
11519 * search.c (Freplace_match): Check for size calculation overflow.
11520 (Fset_match_data): Don't assume list lengths fit in 'int'.
11521
11522 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11523 for command line length. Do not attempt to address one before the
11524 beginning of an array, as that's not portable.
11525
11526 * term.c (max_frame_lines): Remove; unused.
11527 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11528 not int.
11529 (encode_terminal_code, calculate_costs): Check for size
11530 calculation overflow.
11531 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11532 table lengths and related sizes. Don't update size until alloc
11533 done. Redo calculations to avoid overflow.
11534 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11535
11536 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11537 subtracting pointers.
11538 (gobble_line): Check for overflow more carefully. Don't update size
11539 until alloc done.
11540
11541 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11542 Don't update size until alloc done.
11543 Redo size calculations to avoid overflow.
11544 Check for size calculation overflow.
11545 (main) [DEBUG]: Fix typo in invoking tparam1.
11546
11547 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11548 Use ptrdiff_t, not int, for sizes.
11549 (store_mode_line_noprop_char): Don't update size until alloc done.
11550
11551 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11552 Use ptrdiff_t, not int, for sizes.
11553 (Finternal_make_lisp_face, cache_face):
11554 Check for size calculation overflow.
11555 (cache_face): Treat size calculation overflows as if they were
11556 memory exhaustion (the usual treatment), rather than aborting.
11557
11558 * xfns.c (x_encode_text, x_set_name_internal)
11559 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11560 sizes, since they can exceed INT_MAX in size. Check for size
11561 calculation overflow.
11562
11563 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11564 (xg_select): Check for size calculation overflow.
11565 Don't update size until alloc done.
11566
11567 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11568 as sprintf is limited to int lengths.
11569
11570 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11571 (X_LONG_MIN): New macros.
11572 Use them to make the following changes clearer.
11573 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11574 This change doesn't affect the value now, but it may help remind
11575 future maintainers not to raise the value too much later.
11576 (SELECTION_QUANTUM): Remove, replacing with ...
11577 (selection_quantum): ... new function, which avoids overflow.
11578 All uses changed.
11579 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11580 assumption that selection length fits in 'int'.
11581 (x_reply_selection_request, x_handle_selection_request)
11582 (x_get_window_property, receive_incremental_selection)
11583 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11584 (lisp_data_to_selection_data, clean_local_selection_data):
11585 Use ptrdiff_t, not int, to record length of selection.
11586 (x_reply_selection_request, x_get_window_property)
11587 (receive_incremental_selection, x_property_data_to_lisp):
11588 Redo calculations to avoid overflow.
11589 (x_reply_selection_request): When sending hint, ceiling it at
11590 X_LONG_MAX rather than relying on wraparound overflow to send
11591 something.
11592 (x_get_window_property, receive_incremental_selection)
11593 (lisp_data_to_selection_data, x_property_data_to_lisp):
11594 Check for size-calculation overflow.
11595 (x_get_window_property, receive_incremental_selection)
11596 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11597 Don't store size until memory allocation succeeds.
11598 (x_get_window_property): Plug memory leak on memory exhaustion.
11599 Don't double-block input; malloc is safe here. Don't assume 2**34
11600 - 4 fits in unsigned long. Add an xassert to check
11601 XGetWindowProperty overflow. Be more careful about overflow
11602 calculations, and distinguish size from memory overflow better.
11603 (receive_incremental_selection): When tracing, don't assume
11604 unsigned int is less than INT_MAX.
11605 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11606 harmful) conversions of unsigned short to int.
11607 (lisp_data_to_selection_data): Don't assume that integers
11608 in the range -65535 through -1 fit in an X unsigned short.
11609 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11610 result parameters unless successful. Rely on cons_to_unsigned
11611 to report problems with elements; the old code wasn't right anyway.
11612 (x_check_property_data): Check for int overflow; we cannot use
11613 a wider type due to X limits.
11614 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11615
11616 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11617
11618 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11619 (x_term_init): Check for size calculation overflow.
11620 (x_color_cells): Don't store size until memory allocation succeeds.
11621 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11622 Don't assume alloca size is less than MAX_ALLOCA.
11623 (x_term_init): Don't assume length fits in int (sprintf is limited
11624 to int size).
11625
11626 Use ptrdiff_t for composition IDs.
11627 * character.c (lisp_string_width):
11628 * composite.c (composition_table_size, n_compositions)
11629 (get_composition_id, composition_gstring_from_id):
11630 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11631 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11632 * window.c (Frecenter):
11633 Use ptrdiff_t, not int, for composition IDs.
11634 * composite.c (get_composition_id): Check for integer overflow.
11635 * composite.h: Adjust prototypes to match the above changes.
11636
11637 Use ptrdiff_t for hash table indexes.
11638 * category.c (hash_get_category_set):
11639 * ccl.c (ccl_driver):
11640 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11641 * coding.c (coding_system_charset_list, detect_coding_system):
11642 * coding.h (struct coding_system.id):
11643 * composite.c (get_composition_id, gstring_lookup_cache):
11644 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11645 * image.c (xpm_get_color_table_h):
11646 * lisp.h (hash_lookup, hash_put):
11647 * minibuf.c (Ftest_completion):
11648 Use ptrdiff_t for hash table indexes, not int (which is too
11649 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11650 32-bit --with-wide-int hosts).
11651
11652 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11653 Add a FIXME comment about memory leaks.
11654 (syms_of_charset): Don't assume xmalloc returns.
11655
11656 Don't assume that stated character widths fit in int.
11657 * character.c (Fchar_width, c_string_width, lisp_string_width):
11658 * character.h (CHAR_WIDTH):
11659 * indent.c (MULTIBYTE_BYTES_WIDTH):
11660 Use sanitize_char_width to avoid undefined and/or bad behavior
11661 with outlandish widths.
11662 * character.h (sanitize_tab_width): Rename from sanitize_width,
11663 now that we have two such functions. All uses changed.
11664 (sanitize_char_width): New inline function.
11665
11666 Don't assume that tab-width fits in int.
11667 * character.h (sanitize_width): New inline function.
11668 (SANE_TAB_WIDTH): New macro.
11669 (ASCII_CHAR_WIDTH): Use it.
11670 * indent.c (sane_tab_width): Remove. All uses replaced by
11671 SANE_TAB_WIDTH (current_buffer).
11672 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11673
11674 * fileio.c: Integer overflow issues with file modes.
11675 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11676
11677 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11678 Remove unreachable code.
11679 (read_hex, load_charset_map_from_file): Check for integer overflow.
11680
11681 * xterm.c: Don't go over XClientMessageEvent limit.
11682 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11683 (x_send_scroll_bar_event): Likewise. Check that the size does not
11684 exceed limits imposed by XClientMessageEvent, as well as the usual
11685 ptrdiff_t and size_t limits.
11686
11687 * keyboard.c: Overflow, signedness and related fixes.
11688 (make_lispy_movement): Use same integer type in forward decl
11689 that is used in the definition.
11690 (read_key_sequence, keyremap_step):
11691 Change bufsize argument back to int, undoing my 2011-03-30 change.
11692 We prefer signed types, and int is wide enough here.
11693 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11694 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11695 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11696 length, not size_t. Use ptrdiff_t for index, not int.
11697 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11698 possibility of integer overflow.
11699
11700 Overflow, signedness and related fixes for images.
11701
11702 * dispextern.h (struct it.stack[0].u.image.image_id)
11703 (struct_it.image_id, struct image.id, struct image_cache.size)
11704 (struct image_cache.used, struct image_cache.ref_count):
11705 * gtkutil.c (update_frame_tool_bar):
11706 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11707 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11708 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11709 * nsmenu.m (update_frame_tool_bar):
11710 * xdisp.c (calc_pixel_width_or_height):
11711 * xfns.c (image_cache_refcount):
11712 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11713 on typical 64-bit hosts.
11714
11715 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11716 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11717 Omit unnecessary casts to int.
11718 (parse_image_spec): Check that integers fall into 'int' range
11719 when the callers expect that.
11720 (image_ascent): Redo ascent calculation to avoid int overflow.
11721 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11722 (lookup_image): Remove unnecessary tests.
11723 (xbm_image_p): Locals are now of int, not EMACS_INT,
11724 since parse_image_check makes sure they fit into int.
11725 (png_load, gif_load, svg_load_image):
11726 Prefer int to unsigned where either will do.
11727 (tiff_handler): New function, combining the cores of the
11728 old tiff_error_handler and tiff_warning_handler.
11729 This function is rewritten to use vsnprintf and thereby avoid
11730 stack buffer overflows. It uses only the features of vsnprintf
11731 that are common to both POSIX and native Microsoft.
11732 (tiff_error_handler, tiff_warning_handler): Use it.
11733 (tiff_load, gif_load, imagemagick_load_image):
11734 Don't assume :index value fits in 'int'.
11735 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11736 (imagemagick_load_image): Check that crop parameters fit into
11737 the integer types that MagickCropImage accepts. Don't assume
11738 Vimagemagick_render_type has a nonnegative value. Don't assume
11739 size_t fits in 'long'.
11740 (gs_load): Use printmax_t to print the widest integers possible.
11741 Check for integer overflow when computing image height and width.
11742
11743 2011-08-26 Eli Zaretskii <eliz@gnu.org>
11744
11745 * xdisp.c (redisplay_window): Don't force window start if point
11746 will be invisible in the resulting window. (Bug#9324)
11747
11748 2011-08-25 Eli Zaretskii <eliz@gnu.org>
11749
11750 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11751 the display spec is of the form `(space ...)'.
11752 (handle_display_spec): Return the value returned by
11753 handle_single_display_spec, not just 1 or zero.
11754 (handle_single_display_spec): If the display spec is of the form
11755 `(space ...)', and specifies display in the text area, return 2
11756 rather than 1.
11757 (try_cursor_movement): Check for the need to scroll more
11758 accurately, and prefer exact match for point under bidi.
11759 Don't advance `row' beyond the last row of the window.
11760
11761 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11762 into disp_prop; all users changed.
11763
11764 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11765 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11766 for the text covered by the display property.
11767
11768 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
11769
11770 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11771 Change return value to nil.
11772 (Frecord_buffer): Delete unused function.
11773
11774 2011-08-24 Eli Zaretskii <eliz@gnu.org>
11775
11776 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11777 buffers, return left-to-right.
11778 (set_cursor_from_row): Consider candidate row a win if its glyph
11779 represents a newline and point is on that newline. Fixes cursor
11780 positioning on the newline at EOL of R2L text within L2R
11781 paragraph, and vice versa.
11782 (try_cursor_movement): Check continued rows, in addition to
11783 continuation rows. Fixes unwarranted scroll when point enters a
11784 continued line of R2L text within an L2R paragraph, or vice versa.
11785 (cursor_row_p): Consider the case of point being equal to
11786 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11787 from the end of a short line to the beginning of a continued line
11788 of R2L text within L2R paragraph.
11789 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11790 composed characters.
11791
11792 * bidi.c (bidi_check_type): Use xassert.
11793 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11794 members.
11795
11796 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11797
11798 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11799 a character.
11800
11801 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
11802
11803 * nsfont.m (ns_otf_to_script): Fix typo.
11804
11805 2011-08-22 Kenichi Handa <handa@m17n.org>
11806
11807 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11808 extra slot even if the purpose is char-code-property-table.
11809
11810 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11811
11812 * xdisp.c (redisplay_window): When computing centering_position,
11813 account for the height of the header line. (Bug#8874)
11814
11815 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11816 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11817 candidate is selected by the mouse, and that candidate has a
11818 composed character under the mouse.
11819
11820 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11821 coordinates reported by pos-visible-in-window-p for a composed
11822 character in column zero.
11823
11824 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11825
11826 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11827
11828 2011-08-22 Eli Zaretskii <eliz@gnu.org>
11829
11830 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11831 consider it a hit if to_charpos is anywhere in the range of the
11832 composed buffer positions.
11833
11834 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
11835
11836 * image.c (gif_load): Don't assume that each subimage has the same
11837 dimensions as the base image. Handle disposal method that is
11838 "undefined" by the gif spec (Bug#9335).
11839
11840 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
11841
11842 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11843 (Fcondition_case): Document `debug' symbol in error handler.
11844
11845 2011-08-19 Eli Zaretskii <eliz@gnu.org>
11846
11847 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11848 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11849 from an Org mode buffer to a Speedbar frame.
11850
11851 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11852 a composition, take its buffer position from IT->cmp_it.charpos.
11853 Fixes cursor positioning at the beginning of a line that begins
11854 with a composed character.
11855
11856 2011-08-18 Eli Zaretskii <eliz@gnu.org>
11857
11858 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11859 character bidirectional type, use STRONG_L instead. Fixes crashes
11860 in a buffer produced by `describe-categories'.
11861
11862 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11863 members before the level stack, so they would be saved and
11864 restored when copying iterator state. Fixes incorrect reordering
11865 around TABs covered by display properties.
11866
11867 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11868
11869 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11870
11871 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
11872
11873 * eval.c (internal_condition_case, internal_condition_case_1)
11874 (internal_condition_case_2, internal_condition_case_n):
11875 Remove unnecessary aborts (Bug#9081).
11876
11877 2011-08-17 Eli Zaretskii <eliz@gnu.org>
11878
11879 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11880 has no `load' handler, try opening the file locally. (Bug#9311)
11881
11882 2011-08-16 Ken Brown <kbrown@cornell.edu>
11883
11884 * gmalloc.c: Expand comment.
11885
11886 2011-08-16 Eli Zaretskii <eliz@gnu.org>
11887
11888 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11889 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11890
11891 2011-08-16 Ken Brown <kbrown@cornell.edu>
11892
11893 Fix memory allocation problems in Cygwin build (Bug#9273).
11894
11895 * unexcw.c ( __malloc_initialized): Declare external variable.
11896 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11897
11898 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11899 New variables.
11900 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11901 dumped emacs.
11902 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11903 in the static heap.
11904 [CYGWIN] (special_realloc): New function.
11905 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11906 requests to realloc storage in the static heap.
11907
11908 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11909
11910 * bidi.c (bidi_initialize): Remove unused local.
11911
11912 2011-08-15 Eli Zaretskii <eliz@gnu.org>
11913
11914 * bidimirror.h:
11915 * biditype.h: Remove file.
11916 * makefile.w32-in ($(BLD)/bidi.$(O)):
11917 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11918
11919 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11920
11921 * chartab.c: Improve commentary for the uniprop_table API.
11922
11923 * bidi.c (bidi_paragraph_init): Support zero value of
11924 bidi_ignore_explicit_marks_for_paragraph_level.
11925 (bidi_initialize): Use uniprop_table instead of including
11926 biditype.h and bidimirror.h.
11927
11928 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11929 coordinates of the iterator when restoring from ppos_it.
11930 (Bug#9296)
11931
11932 2011-08-14 Kenichi Handa <handa@m17n.org>
11933
11934 * process.c (create_process): Call setup_process_coding_systems
11935 after the pid of the process is set to -1 (Bug#8162).
11936
11937 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11938
11939 * xdisp.c (move_it_in_display_line_to): Don't invoke
11940 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11941 ppos_it. Fixes vertical cursor motion when line beginning is
11942 covered by an image. (Bug#9296)
11943
11944 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11945
11946 * nsterm.h (ns_run_ascript): Declare.
11947 (NSAPP_DATA2_RUNASSCRIPT): Define.
11948
11949 * nsfns.m (as_script, as_result, as_status): New static variables.
11950 (ns_run_ascript): New function.
11951 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11952 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11953 the event loop. Get status from as_status (Bug#7276).
11954
11955 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11956 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11957 the event loop (Bug#7276).
11958
11959 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11960
11961 * gnutls.c (QCgnutls_bootprop_priority)
11962 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11963 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11964 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11965 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11966 (QCgnutls_bootprop_verify_hostname_error)
11967 (QCgnutls_bootprop_callbacks_verify): Rename from
11968 Qgnutls_bootprop_..., all uses changed.
11969
11970 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11971 uses changed.
11972
11973 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11974
11975 * xfaces.c (Qframe_set_background_mode): Now static.
11976 * dispextern.h (Qframe_set_background_mode): Remove decl.
11977
11978 * process.c (Fnetwork_interface_info): Declare local only if needed.
11979
11980 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11981
11982 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11983 (Fnetwork_interface_list): Allocate in increments of bytes instead
11984 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11985 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11986 sockaddr.
11987 (struct ifflag_def): notrailers is smart on OSX.
11988 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11989 Get hardware address with getifaddrs if available.
11990
11991 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11992
11993 * xdisp.c (iterate_out_of_display_property): xassert that
11994 IT->position is set to within IT->object's boundaries. Break from
11995 the loop as soon as EOB is reached; avoids infloops in redisplay
11996 when IT->position is set up wrongly due to some bug.
11997 Set IT->current to match the bidi iterator unconditionally.
11998 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11999 entry. Force push_it to save on the stack the current
12000 buffer/string position, to be restored by pop_it. Fix flags in
12001 the iterator structure wrt the object coming from a display
12002 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12003 properties. (Bug#9284)
12004
12005 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12006
12007 * fontset.c (fontset_get_font_group): Add proper type checks.
12008 (Bug#9172)
12009
12010 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12011
12012 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12013 and LC_VERSION_MIN_MACOSX.
12014 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12015 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12016
12017 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12018
12019 * xdisp.c (forward_to_next_line_start): Allow to use the
12020 no-display-properties-and-no-overlays under bidi display.
12021 Set disp_pos in the bidi iterator to avoid searches for display
12022 properties and overlays.
12023
12024 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12025
12026 * editfns.c (Fset_time_zone_rule): Document relationship with the
12027 setenv function.
12028
12029 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12030 the font entity extracted from the cache (Bug#8109).
12031
12032 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12033
12034 * composite.c (autocmp_chars): Don't reset point. That is done by
12035 restore_point_unwind (Bug#5984).
12036
12037 2011-08-07 Juri Linkov <juri@jurta.org>
12038
12039 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12040 to show the arg `TIME' instead of `TIMEVAL'.
12041
12042 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12043
12044 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12045 display property strides EOL and includes a newline, as in
12046 longlines-mode. (Bug#9254)
12047 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12048 word-wrap under bidirectional display. (Bug#9224)
12049
12050 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12051 is non-zero, even if the data buffer is NULL. Fixes a crash in
12052 vertical-motion with longlines-mode. (Bug#9254)
12053
12054 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12055
12056 * bidi.c <bidi_cache_total_alloc>: Now static.
12057 (bidi_initialize): Initialize bidi_cache_total_alloc.
12058
12059 * xdisp.c (display_line): Release buffer allocated for shelved bidi
12060 cache. (Bug#9221)
12061
12062 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12063 amount allocated this far in `bidi_cache_total_alloc'.
12064 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12065 non-zero, only free the data buffer without restoring the cache
12066 contents. All callers changed.
12067
12068 * dispextern.h (bidi_unshelve_cache): Update prototype.
12069
12070 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12071 (move_it_in_display_line, move_it_to)
12072 (move_it_vertically_backward, move_it_by_lines): Replace the call
12073 to xfree to an equivalent call to bidi_unshelve_cache.
12074 (move_it_in_display_line_to): Fix logic of returning
12075 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12076
12077 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12078
12079 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12080 came from a string character with a `cursor' property. (Bug#9229)
12081
12082 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12083
12084 * Makefile.in (LIB_PTHREAD): New variable.
12085 (LIBES): Add LIB_PTHREAD (Bug#9216).
12086
12087 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12088 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12089
12090 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12091
12092 * regex.c (re_iswctype): Remove some redundant boolean conversions.
12093
12094 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12095
12096 * xterm.c (x_find_topmost_parent): New function.
12097 (x_set_frame_alpha): Find topmost parent window with
12098 x_find_topmost_parent and set the property there also (bug#9181).
12099 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12100
12101 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12102
12103 * callproc.c (Fcall_process): Avoid vfork clobbering
12104 the local vars buffer, coding_systems, current_dir.
12105
12106 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12107
12108 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12109
12110 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12111
12112 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12113 so that it is not optimized away.
12114
12115 * xdisp.c (compute_display_string_pos): Remove unused local.
12116
12117 2011-08-02 Eli Zaretskii <eliz@gnu.org>
12118
12119 Fix slow cursor motion and scrolling in large buffers with
12120 selective display, like Org Mode buffers. (Bug#9218)
12121
12122 * dispextern.h (struct bidi_it): New member disp_prop_p.
12123
12124 * xdisp.c: Remove one-slot cache of display string positions.
12125 (compute_display_string_pos): Accept an additional argument
12126 DISP_PROP_P; callers changed. Scan at most 5K characters forward
12127 for a display string or property. If found, set DISP_PROP_P
12128 non-zero.
12129
12130 * bidi.c (bidi_fetch_char): Accept an additional argument
12131 DISP_PROP_P, and pass it to compute_display_string_pos.
12132 Only handle text covered by a display string if DISP_PROP_P is returned
12133 non-zero. All callers of bidi_fetch_char changed.
12134
12135 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12136
12137 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12138
12139 2010-12-03 Don March <don@ohspite.net>
12140
12141 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12142 last character M-[char] is translated to ESC [char] (bug#7541).
12143
12144 2011-08-02 Kenichi Handa <handa@m17n.org>
12145
12146 * lisp.h (uniprop_table): Extern it.
12147
12148 * chartab.c (uniprop_table): Make it non-static.
12149
12150 2011-08-01 Eli Zaretskii <eliz@gnu.org>
12151
12152 * xdisp.c (forward_to_next_line_start): Accept additional argument
12153 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12154 on the newline.
12155 (reseat_at_next_visible_line_start): Use the bidi iterator state
12156 returned by forward_to_next_line_start to restore the state of
12157 it->bidi_it after backing up to previous newline. (Bug#9212)
12158
12159 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12160
12161 * regex.c (re_comp): Protoize.
12162 (re_exec): Fix return type.
12163 (regexec): Fix type of `ret'. (Bug#9203)
12164
12165 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12166
12167 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12168 This is needed if max-image-size is a floating-point number.
12169
12170 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12171
12172 * print.c (print_object): Print empty symbol as ##.
12173
12174 * lread.c (read1): Read ## as empty symbol.
12175
12176 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12177
12178 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12179 setting frame foreground color (Bug#9175).
12180 (x_set_background_color): Likewise.
12181
12182 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12183 contents (Bug#9176).
12184 (EmacsTooltip -init): Remove bezels and add shadows to
12185 tooltip windows.
12186
12187 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12188 or scroll bar (Bug#8470).
12189
12190 * nsfont.m (nsfont_open): Remove assignment to voffset and
12191 unnecessary vars hshink, expand, hd, full_height, min_height.
12192 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12193
12194 * nsterm.h (nsfont_info): Remove voffset field.
12195
12196 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12197
12198 Implement strike-through and overline on NextStep (Bug#8863).
12199
12200 * nsfont.m (nsfont_open): Use underline position provided by font,
12201 instead of hard-coded value of 2.
12202 (nsfont_draw): Call ns_draw_text_decoration instead.
12203
12204 * nsterm.h: Add declaration for ns_draw_text_decoration.
12205
12206 * nsterm.m (ns_draw_text_decoration): New function for drawing
12207 underline, overline, and strike-through.
12208 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12209 ns_draw_text_decoration. Change treatment of cursor drawing to
12210 accommodate underlining, etc.
12211
12212 2011-07-28 Eli Zaretskii <eliz@gnu.org>
12213
12214 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12215 default.
12216
12217 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12218
12219 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12220 Without this fix, if a signal arrives just after memory fills up,
12221 'malloc' might be invoked reentrantly.
12222
12223 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12224 In other words, assume that every image size is allowed, on non-X
12225 hosts. This assumption is probably wrong, but it lets Emacs compile.
12226
12227 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12228
12229 * regex.c (re_iswctype): Convert return values to boolean.
12230
12231 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12232
12233 * xdisp.c (compute_display_string_pos): Don't use cached display
12234 string position if the buffer had its restriction changed.
12235 (Bug#9184)
12236
12237 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12238
12239 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12240
12241 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12242
12243 Integer signedness and overflow and related fixes. (Bug#9079)
12244
12245 * bidi.c: Integer size and overflow fixes.
12246 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12247 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12248 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12249 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12250 (bidi_find_other_level_edge):
12251 Use ptrdiff_t instead of EMACS_INT where either will do.
12252 This works better on 32-bit hosts configured --with-wide-int.
12253 (bidi_cache_ensure_space): Check for size-calculation overflow.
12254 Use % rather than repeated addition, for better worst-case speed.
12255 Don't set bidi_cache_size until after xrealloc returns, because it
12256 might not return.
12257 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12258 (bidi_cache_ensure_space): Also check that the bidi cache size
12259 does not exceed that of the largest Lisp string or buffer. See Eli
12260 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12261
12262 * alloc.c (__malloc_size_t): Remove.
12263 All uses replaced by size_t. See Andreas Schwab's note
12264 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12265
12266 * image.c: Improve checking for integer overflow.
12267 (check_image_size): Assume that f is nonnull, since
12268 it is always nonnull in practice. This is one less thing to
12269 worry about when checking for integer overflow later.
12270 (x_check_image_size): New function, which checks for integer
12271 overflow issues inside X.
12272 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12273 This removes the need for a memory_full check.
12274 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12275 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12276 (xbm_read_bitmap_data): Change locals back to 'int', since
12277 their values must fit in 'int'.
12278 (xpm_load_image, png_load, tiff_load):
12279 Invoke x_create_x_image_and_pixmap earlier,
12280 to avoid much needless work if the image is too large.
12281 (tiff_load): Treat overly large images as if
12282 x_create_x_image_and_pixmap failed, not as malloc failures.
12283 (gs_load): Use x_check_image_size.
12284
12285 * gtkutil.c: Omit integer casts.
12286 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12287 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12288
12289 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12290
12291 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12292 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12293 would wrongly return t on a 64-bit host.
12294
12295 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12296 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12297 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12298 and therefore cause GCC to emit a bogus diagnostic in some cases.
12299
12300 * image.c: Integer signedness and overflow and related fixes.
12301 This is not an exhaustive set of fixes, but it's time to
12302 record what I've got.
12303 (lookup_pixel_color, check_image_size): Remove redundant decls.
12304 (check_image_size): Don't assume that arbitrary EMACS_INT values
12305 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12306 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12307 (tiff_load, imagemagick_load_image):
12308 Check for overflow in size calculations.
12309 (x_create_x_image_and_pixmap): Remove unnecessary test for
12310 xmalloc returning NULL; that can't happen.
12311 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12312 (xpm_color_bucket): Use better integer hashing function.
12313 (xpm_cache_color): Don't possibly over-allocate memory.
12314 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12315 (gif_memory_source):
12316 Use ptrdiff_t, not int or size_t, to record sizes.
12317 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12318 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12319 either works, as we prefer signed integers.
12320 (tiff_read_from_memory, tiff_write_from_memory):
12321 Return tsize_t, not size_t, since that's what the TIFF API wants.
12322 (tiff_read_from_memory): Don't fail simply because the read would
12323 go past EOF; instead, return a short read.
12324 (tiff_load): Omit no-longer-needed casts.
12325 (Fimagemagick_types): Don't assume size fits into 'int'.
12326
12327 Improve hashing quality when configured --with-wide-int.
12328 * fns.c (hash_string): New function, taken from sxhash_string.
12329 Do not discard information about ASCII character case; this
12330 discarding is no longer needed.
12331 (sxhash-string): Use it. Change sig to match it. Caller changed.
12332 * lisp.h: Declare it.
12333 * lread.c (hash_string): Remove, since we now use fns.c's version.
12334 The fns.c version returns a wider integer if --with-wide-int is
12335 specified, so this should help the quality of the hashing a bit.
12336
12337 * emacs.c: Integer overflow minor fix.
12338 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12339 Define only if GNU_LINUX.
12340 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12341
12342 * dispnew.c: Integer signedness and overflow fixes.
12343 Remove unnecessary forward decls, that were a maintenance hassle.
12344 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12345 All uses changed.
12346 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12347 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12348 (prepare_desired_row, line_draw_cost):
12349 Use int, not unsigned, where either works.
12350 (save_current_matrix, restore_current_matrix):
12351 Use ptrdiff_t, not size_t, where either works.
12352 (init_display): Check for overflow more accurately, and without
12353 relying on undefined behavior.
12354
12355 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12356 Remove, replacing with the new symbols in lisp.h. All uses changed.
12357 * fileio.c (make_temp_name):
12358 * filelock.c (lock_file_1, lock_file):
12359 * xdisp.c (message_dolog):
12360 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12361 Use pMd etc. instead.
12362 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12363 replacing the pWIDE etc. symbols removed from editfns.c.
12364
12365 * keyboard.h (num_input_events): Now uintmax_t.
12366 This is (very slightly) less likely to mess up due to wraparound.
12367 All uses changed.
12368
12369 * buffer.c: Integer signedness fixes.
12370 (alloc_buffer_text, enlarge_buffer_text):
12371 Use ptrdiff_t rather than size_t when either will do, as we prefer
12372 signed integers.
12373
12374 * alloc.c: Integer signedness and overflow fixes.
12375 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12376 (__malloc_size_t): Default to size_t, not to int.
12377 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12378 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12379 Prefer ptrdiff_t to size_t when either would do, as we prefer
12380 signed integers.
12381 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12382 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12383 Now const. Initialize with values that are in range even if char
12384 is signed.
12385 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12386 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12387 These functions do the right thing with sizes > 2**32.
12388 (check_depth): Now ptrdiff_t, not int.
12389 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12390 Adjust to new way of storing sizes. Check for size overflow bugs
12391 in rest of code.
12392 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12393 slightly wrong anyway, as it missed one instance of
12394 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12395 (refill_memory_reserve): Omit needless cast to size_t.
12396 (mark_object_loop_halt): Mark as externally visible.
12397
12398 * xselect.c: Integer signedness and overflow fixes.
12399 (Fx_register_dnd_atom, x_handle_dnd_message):
12400 Use ptrdiff_t, not size_t, since we prefer signed.
12401 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12402 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12403 x_dnd_atoms_size and x_dnd_atoms_length.
12404
12405 * doprnt.c: Prefer signed to unsigned when either works.
12406 * eval.c (verror):
12407 * doprnt.c (doprnt):
12408 * lisp.h (doprnt):
12409 * xdisp.c (vmessage):
12410 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12411 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12412 prefer signed arithmetic to avoid comparison confusion.
12413 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12414 but is a bit tricky.
12415
12416 Assume freestanding C89 headers, string.h, stdlib.h.
12417 * data.c, doprnt.c, floatfns.c, print.c:
12418 Include float.h unconditionally.
12419 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12420 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12421 * regex.c: Likewise for stddef.h, string.h.
12422 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12423 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12424 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12425 (STDC_HEADERS): Remove obsolete defines.
12426 * sysdep.c: Include limits.h unconditionally.
12427
12428 Assume support for memcmp, memcpy, memmove, memset.
12429 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12430 * regex.c (memcmp, memcpy):
12431 Remove; we assume C89 now.
12432
12433 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12434 (__malloc_safe_bcopy): Remove; no longer needed.
12435
12436 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12437 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12438 well either way, and we prefer signed to unsigned.
12439
12440 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12441
12442 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12443 closes the connection while we're reading (bug#9182).
12444
12445 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12446
12447 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12448 are specified (Bug#9168).
12449
12450 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12451
12452 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12453 Found by GCC static checking and --with-wide-int on a 32-bit host.
12454
12455 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12456
12457 * xdisp.c (compute_display_string_pos): Fix logic of caching
12458 previous display string position. Initialize cached_prev_pos to
12459 -1. Fixes slow-down at the beginning of a buffer.
12460
12461 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12462
12463 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12464 for attrs[LFACE_FONTSET_INDEX].
12465
12466 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12467
12468 * xml.c (parse_region): Remove unused local
12469 that was recently introduced.
12470
12471 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12472
12473 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12474 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12475
12476 * xdisp.c (move_it_in_display_line_to): Record the best matching
12477 position for TO_CHARPOS while scanning the line, and restore it on
12478 exit if none of the characters scanned was an exact match.
12479 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12480 when exact match is impossible due to invisible text, and the
12481 lines are truncated.
12482
12483 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12484
12485 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12486 for OSX >= 10.7.
12487
12488 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12489
12490 Fix a significant slow-down of cursor motion with C-n, C-p,
12491 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12492 auto-repeat under bidi redisplay in fontified buffers.
12493 * xdisp.c (compute_stop_pos_backwards): New function.
12494 (next_element_from_buffer): Call compute_stop_pos_backwards to
12495 find a suitable prev_stop when we find ourselves before
12496 base_level_stop.
12497 (reseat): Don't look for prev_stop, as that could mean a very long
12498 run.
12499 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12500 <cached_disp_overlay_modiff>: Cache for last found display string
12501 position.
12502 (compute_display_string_pos): Return the cached position if asked
12503 about the same buffer in the same area of character positions, and
12504 the buffer wasn't changed since the time the display string
12505 position was cached.
12506
12507 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12508
12509 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12510 is an integer, which is important for empty lines. (Bug#9149)
12511
12512 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
12513
12514 * frame.c (Fmodify_frame_parameters): In tty case, update the
12515 default face if necessary (Bug#4238).
12516
12517 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
12518
12519 * editfns.c (Fstring_to_char): No need to explain what a character
12520 is in the docstring (Bug#6576).
12521
12522 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12523
12524 * xml.c (parse_region): Make sure we always return a tree.
12525
12526 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12527
12528 * xml.c (parse_region): If a document contains only comments,
12529 return that, too.
12530
12531 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12532
12533 * xml.c (make_dom): Return comments, too.
12534
12535 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12536
12537 Port to OpenBSD.
12538 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12539 and the surrounding thread.
12540 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12541 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12542 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12543 timer goes off.
12544 * s/openbsd.h (BROKEN_SIGIO): Define.
12545 * unexelf.c (unexec) [__OpenBSD__]:
12546 Don't update the .mdebug section of the Alpha COFF symbol table.
12547
12548 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12549
12550 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12551 (bug#8460).
12552
12553 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12554
12555 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12556 This fixes some race conditions on the permissions of any newly
12557 created file.
12558
12559 * alloc.c (valid_pointer_p): Use pipe, not open.
12560 This fixes some permissions issues when debugging.
12561
12562 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12563 If fchown fails to set both uid and gid, try to set just gid,
12564 as that is sometimes allowed. Adjust the file's mode to eliminate
12565 setuid or setgid bits that are inappropriate if fchown fails.
12566
12567 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12568
12569 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12570 to compare Lisp_Objects.
12571 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12572 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12573 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12574
12575 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12576
12577 * lread.c (read_integer): Unread even EOF character.
12578 (read1): Likewise. Properly record start position of symbol.
12579
12580 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12581 symbol character follows.
12582
12583 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12584
12585 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12586 This works around a problem with the previous change to Fcopy_file.
12587 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12588 and without this change, GCC might complain about discarding
12589 fchown's return value.
12590
12591 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
12592
12593 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12594
12595 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12596
12597 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12598
12599 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12600
12601 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12602 it's used from the C level.
12603
12604 * process.c: Use the same condition for POLL_FOR_INPUT in both
12605 keyboard.c and process.c (bug#1858).
12606
12607 2011-07-09 Lawrence Mitchell <wence@gmx.li>
12608
12609 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12610 (Fgnutls_boot): Use it.
12611
12612 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12613
12614 * doc.c (Fsubstitute_command_keys): Revert last change.
12615
12616 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12617
12618 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12619 quotes the next character, and doesn't affect other longer
12620 sequences (bug#8935).
12621
12622 * lread.c (syms_of_lread): Clarify that is isn't only
12623 `eval-buffer' and `eval-defun' that's affected by
12624 `lexical-binding' (bug#8460).
12625
12626 2011-07-15 Eli Zaretskii <eliz@gnu.org>
12627
12628 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12629 bidi redisplay when a line includes both an image and is truncated.
12630
12631 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12632
12633 Fix minor problems found by static checking.
12634 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12635 (elsz): Now a signed constant, not a size_t var. We prefer signed
12636 types to unsigned, to avoid integer comparison confusion. Without
12637 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12638 "cannot optimize loop, the loop counter may overflow", a symptom
12639 of the confusion.
12640 * indent.c (Fvertical_motion): Mark locals as initialized.
12641 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12642
12643 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12644
12645 * search.c (Fre_search_backward): Mention `case-fold-search' in
12646 all the re_search_* functions (bug#8138).
12647
12648 * keyboard.c (Fopen_dribble_file): Document when the file is
12649 closed (bug#8056).
12650
12651 2011-07-14 Eli Zaretskii <eliz@gnu.org>
12652
12653 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12654 bidi_cache_idx.
12655
12656 Support bidi reordering of display and overlay strings.
12657 * xdisp.c (compute_display_string_pos)
12658 (compute_display_string_end): Accept additional argument STRING.
12659 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12660 (reseat_to_string): Initialize bidi_it->string.s and
12661 bidi_it->string.schars.
12662 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12663 NULL (avoids a crash in bidi_paragraph_init).
12664 Initialize itb.string.lstring.
12665 (init_iterator): Call bidi_init_it only of a valid
12666 buffer position was specified. Initialize paragraph_embedding to
12667 L2R.
12668 (reseat_to_string): Initialize the bidi iterator.
12669 (display_string): If we need to ignore text properties of
12670 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12671 original value of -1 will not work with bidi.)
12672 (compute_display_string_pos): First arg is now struct
12673 `text_pos *'; all callers changed. Support display properties on
12674 Lisp strings.
12675 (compute_display_string_end): Support display properties on Lisp
12676 strings.
12677 (init_iterator, reseat_1, reseat_to_string): Initialize the
12678 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12679 when iterating on a string not from display properties).
12680 (compute_display_string_pos, compute_display_string_end):
12681 Fix calculation of the object to scan. Fixes an error when using
12682 arrow keys.
12683 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12684 base_level_stop; instead, set base_level_stop to BEGV.
12685 Fixes crashes in vertical-motion.
12686 (next_element_from_buffer): Improve commentary for when
12687 the iterator is before prev_stop.
12688 (init_iterator): Initialize bidi_p from the default value of
12689 bidi-display-reordering, not from buffer-local value. Use the
12690 buffer-local value only if initializing for buffer iteration.
12691 (handle_invisible_prop): Support invisible properties on strings
12692 that are being bidi-reordered.
12693 (set_iterator_to_next): Support bidi reordering of C strings and
12694 Lisp strings.
12695 (next_element_from_string): Support bidi reordering of Lisp
12696 strings.
12697 (handle_stop_backwards): Support Lisp strings as well.
12698 (display_string): Support display of R2L glyph rows.
12699 Use IT_STRING_CHARPOS when displaying from a Lisp string.
12700 (init_iterator): Don't initialize it->bidi_p for strings
12701 here.
12702 (reseat_to_string): Initialize it->bidi_p for strings here.
12703 (next_element_from_string, next_element_from_c_string)
12704 (next_element_from_buffer): Add xassert's for correspondence
12705 between IT's object being iterated and it->bidi_it.string
12706 structure.
12707 (face_before_or_after_it_pos): Support bidi iteration.
12708 (next_element_from_c_string): Handle the case of the first string
12709 character that is not the first one in the visual order.
12710 (get_visually_first_element): New function, refactored from common
12711 parts of next_element_from_buffer, next_element_from_string, and
12712 next_element_from_c_string.
12713 (tool_bar_lines_needed, redisplay_tool_bar)
12714 (display_menu_bar): Force left-to-right direction. Add a FIXME
12715 comment for making that be controlled by a user option.
12716 (push_it, pop_it): Save and restore the state of the
12717 bidi iterator. Save and restore the bidi_p flag.
12718 (pop_it): Iterate out of display property for string iteration as
12719 well.
12720 (iterate_out_of_display_property): Support iteration over strings.
12721 (handle_single_display_spec): Set up it->bidi_it for iteration
12722 over a display string, and call bidi_init_it.
12723 (handle_single_display_spec, next_overlay_string)
12724 (get_overlay_strings_1, push_display_prop): Set up the bidi
12725 iterator for displaying display or overlay strings.
12726 (forward_to_next_line_start): Don't use the shortcut if
12727 bidi-iterating.
12728 (back_to_previous_visible_line_start): If handle_display_prop
12729 pushed the iterator stack, restore the internal state of the bidi
12730 iterator by calling bidi_pop_it same number of times.
12731 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12732 and we are bidi-iterating, don't decrement the iterator position;
12733 instead, set the first_elt flag in the bidi iterator, to produce
12734 the same effect.
12735 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12736 (push_display_prop): xassert that we are iterating a buffer.
12737 (push_it, pop_it): Save and restore paragraph_embedding member.
12738 (handle_single_display_spec, next_overlay_string)
12739 (get_overlay_strings_1, reseat_1, reseat_to_string)
12740 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12741 correctly. Don't assume unibyte strings are not bidi-reordered.
12742 (compute_display_string_pos)
12743 (compute_display_string_end): Fix handling the case of C string.
12744 (push_it, pop_it): Save and restore from_disp_prop_p.
12745 (handle_single_display_spec, push_display_prop): Set the
12746 from_disp_prop_p flag.
12747 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12748 (pop_it): Call iterate_out_of_display_property only if we are
12749 popping after iteration over a string that came from a display
12750 property. Fix a typo in popping stretch info. Add an assertion
12751 for verifying that the iterator position is in sync with the bidi
12752 iterator.
12753 (handle_single_display_spec, get_overlay_strings_1)
12754 (push_display_prop): Fix initialization of paragraph direction for
12755 string when that of the parent object is not yet determined.
12756 (reseat_1): Call bidi_init_it to resync the bidi
12757 iterator with IT's position. (Bug#7616)
12758 (find_row_edges): If ROW->start.pos gives position
12759 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12760 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12761 Reset the from_disp_prop_p flag.
12762 (SAVE_IT, RESTORE_IT): New macros.
12763 (pos_visible_p, face_before_or_after_it_pos)
12764 (back_to_previous_visible_line_start)
12765 (move_it_in_display_line_to, move_it_in_display_line)
12766 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12767 (try_scrolling, redisplay_window, display_line): Use them when
12768 saving a temporary copy of the iterator and restoring it back.
12769 (back_to_previous_visible_line_start, reseat_1)
12770 (init_iterator): Empty the bidi cache "stack".
12771 (move_it_in_display_line_to): If iterator ended up at
12772 EOL, but we never saw any buffer positions smaller than
12773 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12774 motion in bidi-reordered lines.
12775 (move_it_in_display_line_to): Record prev_method and prev_pos
12776 immediately before the call to set_iterator_to_next. Fixes cursor
12777 motion in bidi-reordered lines with stretch glyphs and strings
12778 displayed in margins. (Bug#8133) (Bug#8867)
12779 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12780 TO_CHARPOS.
12781 (pos_visible_p): Support positions in bidi-reordered lines.
12782 Save and restore bidi cache.
12783
12784 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12785 (bidi_paragraph_info): Delete unused struct.
12786 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12787 (bidi_cache_start): New variable.
12788 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12789 to zero.
12790 (bidi_cache_fetch_state, bidi_cache_search)
12791 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12792 (bidi_cache_find, bidi_peek_at_next_level)
12793 (bidi_level_of_next_char, bidi_find_other_level_edge)
12794 (bidi_move_to_visually_next): Compare cache index with
12795 bidi_cache_start rather than with zero.
12796 (bidi_fetch_char): Accept new argument STRING; all callers
12797 changed. Support iteration over a string. Support strings with
12798 display properties. Support unibyte strings. Fix the type of
12799 `len' according to what STRING_CHAR_AND_LENGTH expects.
12800 (bidi_paragraph_init, bidi_resolve_explicit_1)
12801 (bidi_resolve_explicit, bidi_resolve_weak)
12802 (bidi_level_of_next_char, bidi_move_to_visually_next):
12803 Support iteration over a string.
12804 (bidi_set_sor_type, bidi_resolve_explicit_1)
12805 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12806 can now be zero (for strings); special values 0 and -1 were
12807 changed to -1 and -2, respectively.
12808 (bidi_char_at_pos): New function.
12809 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12810 Call it instead of FETCH_MULTIBYTE_CHAR.
12811 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12812 initialized to valid values.
12813 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12814 values.
12815 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12816 the test for valid cached positions. Fix the logic for looking up
12817 the sentinel state in the cache. GCPRO the Lisp string we are
12818 iterating.
12819 (bidi_push_it, bidi_pop_it): New functions.
12820 (bidi_initialize): Initialize the bidi cache start stack pointer.
12821 (bidi_cache_ensure_space): New function, refactored from part of
12822 bidi_cache_iterator_state. Don't assume the required size is just
12823 one BIDI_CACHE_CHUNK away.
12824 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12825 (bidi_count_bytes, bidi_char_at_pos): New functions.
12826 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12827 always valid if bidi_cache_idx is valid.
12828 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12829 is valid if it's going to be used.
12830 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12831 (bidi_cache_fetch_state, bidi_cache_search)
12832 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12833 (bidi_cache_iterator_state, bidi_cache_find)
12834 (bidi_find_other_level_edge, bidi_cache_start_stack):
12835 All variables related to cache indices are now EMACS_INT.
12836
12837 * dispextern.h (struct bidi_string_data): New structure.
12838 (struct bidi_it): New member `string'. Make flag members be 1-bit
12839 fields, and put them last in the struct.
12840 (compute_display_string_pos, compute_display_string_end):
12841 Update prototypes.
12842 (bidi_push_it, bidi_pop_it): Add prototypes.
12843 (struct iterator_stack_entry): New members bidi_p,
12844 paragraph_embedding, and from_disp_prop_p.
12845 (struct it): Member bidi_p is now a bit field 1 bit wide.
12846 (bidi_shelve_cache, bidi_unshelve_cache):
12847 Declare prototypes.
12848
12849 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12850 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12851 and vector-like objects.
12852
12853 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12854 cache around display iteration.
12855
12856 * window.c (Fwindow_end, window_scroll_pixel_based)
12857 (displayed_window_lines, Frecenter): Save and restore the bidi
12858 cache around display iteration.
12859
12860 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12861
12862 * editfns.c (Fdelete_region): Clarify the use of the named
12863 parameters (bug#6788).
12864
12865 2011-07-14 Martin Rudalics <rudalics@gmx.at>
12866
12867 * indent.c (Fvertical_motion): Set and restore w->pointm when
12868 saving and restoring the window's buffer (Bug#9006).
12869
12870 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12871
12872 * editfns.c (Fstring_to_char): Clarify just what is returned
12873 (bug#6576). Text by Eli Zaretskii.
12874
12875 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
12876
12877 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12878
12879 2011-07-13 Eli Zaretskii <eliz@gnu.org>
12880
12881 * buffer.c (mmap_find): Fix a typo.
12882
12883 2011-07-13 Johan Bockgård <bojohan@gnu.org>
12884
12885 Fix execution of x selection hooks.
12886 * xselect.c (Qx_lost_selection_functions)
12887 (Qx_sent_selection_functions): New vars.
12888 (syms_of_xselect): DEFSYM them.
12889 (x_handle_selection_request): Pass Qx_sent_selection_functions
12890 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12891 (x_handle_selection_clear,x_clear_frame_selections):
12892 Pass Qx_lost_selection_functions rather than
12893 Vx_lost_selection_functions to Frun_hook_with_args.
12894
12895 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12896
12897 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12898 The old code sometimes used this field without initializing it.
12899
12900 * alloc.c (gc_sweep): Don't read past end of array.
12901 In theory, the old code could also have corrupted Emacs internals,
12902 though it'd be very unlikely.
12903
12904 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12905
12906 * character.c (Fcharacterp): Don't advertise optional ignored
12907 argument. (Bug#4026)
12908
12909 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12910
12911 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12912 key" (bug#4257).
12913
12914 * window.c (Fset_window_start): Doc fix (bug#4199).
12915 (Fset_window_hscroll): Ditto.
12916
12917 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12918
12919 Fix minor new problems caught by GCC 4.6.1.
12920 * term.c (init_tty): Remove unused local.
12921 * xsettings.c (store_monospaced_changed): Define this function only
12922 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12923 not used otherwise.
12924
12925 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
12926
12927 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12928
12929 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12930
12931 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12932 are the mini-buffer and the echo area (bug#3320).
12933
12934 * term.c (init_tty): Remove support for supdup, c10 and perq
12935 terminals, which are no longer supported (bug#1482).
12936
12937 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12938
12939 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12940
12941 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12942
12943 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12944 for non-popups (Bug#3642).
12945
12946 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12947
12948 * alloc.c (reset_malloc_hooks): Protoize.
12949 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12950 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12951 * cm.c (losecursor): Likewise.
12952 * data.c (fmod): Likewise.
12953 * dispnew.c (swap_glyphs_in_rows): Likewise.
12954 * emacs.c (memory_warning_signal): Likewise.
12955 * floatfns.c (float_error): Likewise.
12956 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12957 (otf_open, font_otf_capability, generate_otf_features)
12958 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12959 Likewise.
12960 * image.c (pbm_read_file): Likewise.
12961 * indent.c (string_display_width): Likewise.
12962 * intervals.c (check_for_interval, search_for_interval)
12963 (inc_interval_count, count_intervals, root_interval)
12964 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12965 * lread.c (defalias): Likewise.
12966 * ralloc.c (r_alloc_check): Likewise.
12967 * regex.c (set_image_of_range_1, set_image_of_range)
12968 (regex_grow_registers): Likewise.
12969 * sysdep.c (strerror): Likewise.
12970 * termcap.c (valid_filename_p, tprint, main): Likewise.
12971 * tparam.c (main): Likewise.
12972 * unexhp9k800.c (run_time_remap, save_data_space)
12973 (update_file_ptrs, read_header, write_header, calculate_checksum)
12974 (copy_file, copy_rest, display_header): Likewise.
12975 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12976 Likewise.
12977 * xdisp.c (check_it): Likewise.
12978 * xfaces.c (register_color, unregister_color, unregister_colors):
12979 Likewise.
12980 * xfns.c (print_fontset_result): Likewise.
12981 * xrdb.c (member, fatal, main): Likewise.
12982
12983 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12984
12985 Fix minor problems found by static checking (Bug#9031).
12986 * chartab.c (char_table_set_range, map_sub_char_table):
12987 Remove unused locals.
12988 (uniprop_table): Now static.
12989 * composite.c (_work_char): Remove unused static var.
12990
12991 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12992
12993 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12994
12995 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12996
12997 * gtkutil.c (qttip_cb): Remove code without function.
12998
12999 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13000
13001 * w32.c (pthread_sigmask): New stub.
13002
13003 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13004
13005 Use pthread_sigmask, not sigprocmask (Bug#9010).
13006 sigprocmask is portable only for single-threaded applications, and
13007 Emacs can be multi-threaded when it uses GTK.
13008 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13009 (LIBES): Use it.
13010 * callproc.c (Fcall_process):
13011 * process.c (create_process):
13012 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13013 Use pthread_sigmask, not sigprocmask.
13014
13015 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13016
13017 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13018 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13019 wrong (Bug#8591).
13020
13021 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13022
13023 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13024 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13025 (xg_hide_tooltip): Fix comment.
13026
13027 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13028 in registerServicesMenuSendTypes.
13029 (validRequestorForSendType): Don't check ns_return_types.
13030
13031 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13032 ns_return_type.
13033
13034 2011-07-08 Jason Rumney <jasonr@gnu.org>
13035
13036 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13037 SH_SHOW for hidden windows (Bug#5482).
13038
13039 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13040 frame struct members of non-existent frames (Bug#6284).
13041
13042 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13043
13044 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13045 variable firstTime not needed on OSX >= 10.6.
13046 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13047 >= 10.5. Use setKnobProportion, setDoubleValue.
13048
13049 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13050 (MAC_OS_X_VERSION_10_5): Define if not defined.
13051 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13052 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13053 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13054
13055 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13056 cString and lossyCString on OSX >= 10.4.
13057
13058 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13059 sizeToFit on OSX >= 10.2.
13060
13061 * nsimage.m (allocInitFromFile): Don't use deprecated method
13062 bestRepresentationForDevice on OSX >= 10.6.
13063
13064 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13065 to avoid warning.
13066
13067 * emacs.c: Declare unexec_init_emacs_zone.
13068
13069 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13070
13071 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13072
13073 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13074 on svcsMenu (Bug#8842).
13075
13076 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13077 ns_return_types.
13078 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13079
13080 * nsterm.m (QUTF8_STRING): Declare.
13081 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13082 (validRequestorForSendType): Return type is (id).
13083 Change indexOfObjectIdenticalTo to indexOfObject.
13084 Check if we have local selection before returning self (Bug#8842).
13085 (writeSelectionToPasteboard): Put local selection into paste board
13086 if we have a local selection (Bug#8842).
13087 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13088
13089 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13090 (ns_get_local_selection): Declare.
13091
13092 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13093
13094 * keymap.c (describe_map_tree): Don't insert a double newline at
13095 the end of the buffer (bug#1169) and return whether we inserted
13096 something.
13097
13098 * callint.c (Fcall_interactively): Change "reading args" to
13099 "providing args" to try to clarify what it does (bug#1010).
13100
13101 2011-07-07 Kenichi Handa <handa@m17n.org>
13102
13103 * composite.c (composition_compute_stop_pos): Ignore a static
13104 composition starting before CHARPOS (Bug#8915).
13105
13106 * xdisp.c (handle_composition_prop): Likewise.
13107
13108 2011-07-07 Eli Zaretskii <eliz@gnu.org>
13109
13110 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13111 (Bug#9015)
13112
13113 2011-07-07 Kenichi Handa <handa@m17n.org>
13114
13115 * character.h (unicode_category_t): New enum type.
13116
13117 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13118 (Qchar_code_property_table): New variable.
13119 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13120 (UNIPROP_COMPRESSED_FORM_P): New macros.
13121 (char_table_ascii): Uncompress the compressed values.
13122 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13123 Uncompress the compressed values.
13124 (sub_char_table_ref_and_range): Likewise.
13125 (char_table_ref_and_range): Uncompress the compressed values.
13126 (sub_char_table_set): New arg is_uniprop. Callers changed.
13127 Uncompress the compressed values.
13128 (sub_char_table_set_range): Args changed. Callers changed.
13129 (char_table_set_range): Adjuted for the above change.
13130 (map_sub_char_table): Delete args default_val and parent. Add arg
13131 top. Give decoded values to a Lisp function.
13132 (map_char_table): Adjust for the above change. Give decoded
13133 values to a Lisp function. Gcpro more variables.
13134 (uniprop_table_uncompress)
13135 (uniprop_decode_value_run_length): New functions.
13136 (uniprop_decoder, uniprop_decoder_count): New variables.
13137 (uniprop_get_decoder, uniprop_encode_value_character)
13138 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13139 New functions.
13140 (uniprop_encoder, uniprop_encoder_count): New variables.
13141 (uniprop_get_encoder, uniprop_table)
13142 (Funicode_property_table_internal, Fget_unicode_property_internal)
13143 (Fput_unicode_property_internal): New functions.
13144 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13145 Sunicode_property_table_internal, Sget_unicode_property_internal,
13146 and Sput_unicode_property_internal. Defvar_lisp
13147 char-code-property-alist.
13148
13149 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13150 Vunicode_category_table.
13151
13152 * font.c (font_range): Adjust for the change of
13153 Vunicode_category_table.
13154
13155 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13156
13157 * m/iris4d.h: Remove file, move contents ...
13158 * s/irix6-5.h: ... here.
13159
13160 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13161
13162 Remove unportable assumption about struct layout (Bug#8884).
13163 * alloc.c (mark_buffer):
13164 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13165 (clone_per_buffer_values): Don't assume that
13166 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13167 This isn't true in general, and it's particularly not true
13168 if Emacs is configured with --with-wide-int.
13169 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13170 New macros, used in the buffer.c change.
13171
13172 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13173
13174 * xsettings.c: Use both GConf and GSettings if both are available.
13175 (store_config_changed_event): Add comment.
13176 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13177 (store_tool_bar_style_changed): New functions.
13178 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
13179 (struct xsettings): Move font inside HAVE_XFT.
13180 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13181 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13182 Move inside HAVE_XFT.
13183 (something_changed_gsettingsCB): Rename from something_changedCB.
13184 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13185 also.
13186 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13187 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
13188 (something_changed_gconfCB): Rename from something_changedCB.
13189 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13190 (parse_settings): Move check for font inside HAVE_XFT.
13191 (read_settings, apply_xft_settings): Add comment.
13192 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13193 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13194 call store_font_name_changed.
13195 (xft_settings_event): Add comment.
13196 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13197 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13198 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13199 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13200 (xsettings_initialize): Call init_gsettings last.
13201 (xsettings_get_system_font, xsettings_get_system_normal_font):
13202 Add comment.
13203
13204 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13205
13206 Random fixes. E.g., (random) never returned negative values.
13207 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13208 subseconds part to the entropy, as that's a bit more random.
13209 Prefer signed to unsigned, since the signedness doesn't matter and
13210 in general we prefer signed. When given a limit, use a
13211 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13212 latter isn't right if USE_2_TAGS_FOR_INTS.
13213 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13214 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13215
13216 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13217
13218 * textprop.c (text_property_stickiness):
13219 Obey Vtext_property_default_nonsticky.
13220 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13221 * w32fns.c (syms_of_w32fns):
13222 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13223
13224 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13225
13226 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13227 This is more efficient than Ffile_directory_p and avoids a minor race.
13228
13229 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13230
13231 * buffer.c (Foverlay_put): Say what the return value is
13232 (bug#7835).
13233
13234 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13235 is a directory before asking whether to use the file name
13236 (bug#7564).
13237 (barf_or_query_if_file_exists): Make the "File is a directory"
13238 error be more correct.
13239
13240 * fns.c (Frequire): Remove the mention of the .gz files, since
13241 that's installation-specific, but keep the mention of
13242 `get-load-suffixes'.
13243
13244 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13245
13246 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13247 Report string overflow if the output is too long.
13248
13249 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
13250
13251 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13252 (syms_of_gnutls): Remove duplicate DEFSYM for
13253 Qgnutls_bootprop_verify_hostname_error, an error for
13254 Qgnutls_bootprop_verify_error (which is no longer used).
13255
13256 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13257 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13258 Also (re)move comments that are misplaced or no longer relevant.
13259
13260 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13261
13262 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13263
13264 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
13265
13266 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13267 and background color parameters if they have been changed.
13268
13269 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13270
13271 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13272
13273 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13274
13275 * xsettings.c (SYSTEM_FONT): Define only when used.
13276 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13277
13278 * keymap.c (access_keymap_1): Now static.
13279
13280 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
13281
13282 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13283 leave any prefix arg for the up event (Bug#1586).
13284
13285 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13286
13287 * lread.c (syms_of_lread): Mention single symbols defined by
13288 `defvar' or `defconst' (bug#7154).
13289
13290 * fns.c (Frequire): Mention .el.gz files (bug#7314).
13291 (Frequire): Mention get-load-suffixes.
13292
13293 2011-07-02 Martin Rudalics <rudalics@gmx.at>
13294
13295 * window.h (window): Remove clone_number slot.
13296 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13297 Remove.
13298 (make_parent_window, make_window, saved_window)
13299 (Fset_window_configuration, save_window_save): Don't deal with
13300 clone numbers.
13301 * buffer.c (Qclone_number): Remove declaration.
13302 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13303
13304 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13305
13306 Add multiple inheritance to keymaps.
13307 * keymap.c (Fmake_composed_keymap): New function.
13308 (Fset_keymap_parent): Simplify.
13309 (fix_submap_inheritance): Remove.
13310 (access_keymap_1): New function extracted from access_keymap to handle
13311 embedded parents and handle lists of maps.
13312 (access_keymap): Use it.
13313 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13314 (Fcopy_keymap): Handle embedded parents.
13315 (Fcommand_remapping, define_as_prefix): Simplify.
13316 (Fkey_binding): Simplify.
13317 (syms_of_keymap): Move minibuffer-local-completion-map,
13318 minibuffer-local-filename-completion-map,
13319 minibuffer-local-must-match-map, and
13320 minibuffer-local-filename-must-match-map to Elisp.
13321 (syms_of_keymap): Defsubr make-composed-keymap.
13322 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13323 (parse_menu_item): Trivial simplification.
13324
13325 2011-07-01 Glenn Morris <rgm@gnu.org>
13326
13327 * Makefile.in (SETTINGS_LIBS): Fix typo.
13328
13329 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13330
13331 * coding.c (Fencode_coding_string): Record the last coding system
13332 used, as the function doc string says (bug#8738).
13333
13334 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13335
13336 * xsettings.c (store_monospaced_changed): Take new font as arg and
13337 check for change against current_mono_font.
13338 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13339 (emacs_settings_constructor, emacs_settings_get_property)
13340 (emacs_settings_set_property, emacs_settings_class_init)
13341 (emacs_settings_init, gsettings_obj): Remove.
13342 (something_changedCB): New function for HAVE_GSETTINGS.
13343 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13344 with value as argument.
13345 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13346 g_settings_new (Bug#8967). Do not create gsettings_obj.
13347 Remove calls to g_settings_bind. Connect something_changedCB to
13348 "changed".
13349
13350 * xgselect.c: Add defined (HAVE_GSETTINGS).
13351 (xgselect_initialize): Ditto.
13352
13353 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13354 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13355 xg_select.
13356
13357 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13358
13359 * eval.c (struct backtrace): Simplify and port the data structure.
13360 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13361 signed bit field, as this assumption is not portable and it makes
13362 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13363 "char debug_on_exit : 1" as this is not portable either; instead,
13364 use the portable "unsigned int debug_on_exit : 1". Remove unused
13365 member evalargs. Remove obsolete comments about cc bombing out.
13366
13367 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13368
13369 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
13370 Let HAVE_GSETTINGS override HAVE_GCONF.
13371 (store_monospaced_changed): New function.
13372 (EMACS_SETTINGS): A new type derived from GObject to handle
13373 GSettings notifications.
13374 (emacs_settings_constructor, emacs_settings_get_property)
13375 (emacs_settings_set_property, emacs_settings_class_init):
13376 New functions.
13377 (gsettings_client, gsettings_obj): New variables.
13378 (GSETTINGS_SCHEMA): New define.
13379 (something_changedCB): Call store_monospaced_changed.
13380 (init_gsettings): New function.
13381 (xsettings_initialize): Call init_gsettings.
13382 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13383 to NULL.
13384
13385 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13386 GCONF_CFLAGS/LIBS.
13387
13388 2011-06-29 Martin Rudalics <rudalics@gmx.at>
13389
13390 * window.c (resize_root_window, grow_mini_window)
13391 (shrink_mini_window): Rename Qresize_root_window to
13392 Qwindow_resize_root_window and Qresize_root_window_vertically to
13393 Qwindow_resize_root_window_vertically.
13394
13395 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13396
13397 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13398
13399 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
13400
13401 * makefile.w32-in: Redesign dependencies so they reflect more
13402 clearly which files are directly included by each source file,
13403 and not through other includes.
13404
13405 2011-06-27 Martin Rudalics <rudalics@gmx.at>
13406
13407 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13408 (sort_overlays, overlay_strings): When an overlay's clone number
13409 matches the window's clone number process the overlay even if
13410 the overlay's window property doesn't match the current window.
13411
13412 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13413 (Fwindow_hchild): Rename to Fwindow_left_child.
13414 (Fwindow_next): Rename to Fwindow_next_sibling.
13415 (Fwindow_prev): Rename to Fwindow_prev_sibling.
13416 (resize_window_check): Rename to window_resize_check.
13417 (resize_window_apply): Rename to window_resize_apply.
13418 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13419 (Fdelete_other_windows_internal, resize_frame_windows)
13420 (Fsplit_window_internal, Fdelete_window_internal)
13421 (grow_mini_window, shrink_mini_window)
13422 (Fresize_mini_window_internal): Fix callers accordingly.
13423
13424 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13425
13426 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13427 (emacs_fixed_set_min_size): Remove.
13428 (emacs_fixed_new): Take frame as argument.
13429
13430 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13431 (_EmacsFixedPrivate): Remove minwidth/height.
13432 Add struct frame *f.
13433 (emacs_fixed_init): Initialize priv->f.
13434 (get_parent_class, emacs_fixed_set_min_size): Remove.
13435 (emacs_fixed_new): Set priv->f to argument.
13436 (emacs_fixed_get_preferred_width)
13437 (emacs_fixed_get_preferred_height): Use min_width/height from
13438 frames size_hint to set minimum and natural (Bug#8919).
13439 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13440 and use min_width/height from frames size_hint to set
13441 min_width/height (Bug#8919).
13442
13443 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13444 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13445 Fix indentation.
13446
13447 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13448
13449 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13450 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13451 called at ZV.
13452
13453 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13454
13455 * process.c (wait_reading_process_output): Bypass select if
13456 waiting for a cell while ignoring keyboard input, and input is
13457 pending. Suggested by Jan Djärv (Bug#8869).
13458
13459 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13460
13461 Use gnulib's dup2 module instead of rolling our own.
13462 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13463
13464 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13465
13466 * dispnew.c (scrolling_window): Before scrolling, turn off a
13467 mouse-highlight in the window being scrolled.
13468
13469 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13470
13471 Move DEFSYM to lisp.h and use everywhere.
13472
13473 * character.h (DEFSYM): Move declaration...
13474 * lisp.h (DEFSYM): ...here.
13475
13476 * gnutls.c:
13477 * minibuf.c:
13478 * w32menu.c:
13479 * w32proc.c:
13480 * w32select.c: Don't include character.h.
13481
13482 * alloc.c (syms_of_alloc):
13483 * buffer.c (syms_of_buffer):
13484 * bytecode.c (syms_of_bytecode):
13485 * callint.c (syms_of_callint):
13486 * casefiddle.c (syms_of_casefiddle):
13487 * casetab.c (init_casetab_once):
13488 * category.c (init_category_once, syms_of_category):
13489 * ccl.c (syms_of_ccl):
13490 * cmds.c (syms_of_cmds):
13491 * composite.c (syms_of_composite):
13492 * dbusbind.c (syms_of_dbusbind):
13493 * dired.c (syms_of_dired):
13494 * dispnew.c (syms_of_display):
13495 * doc.c (syms_of_doc):
13496 * editfns.c (syms_of_editfns):
13497 * emacs.c (syms_of_emacs):
13498 * eval.c (syms_of_eval):
13499 * fileio.c (syms_of_fileio):
13500 * fns.c (syms_of_fns):
13501 * frame.c (syms_of_frame):
13502 * fringe.c (syms_of_fringe):
13503 * insdel.c (syms_of_insdel):
13504 * keymap.c (syms_of_keymap):
13505 * lread.c (init_obarray, syms_of_lread):
13506 * macros.c (syms_of_macros):
13507 * msdos.c (syms_of_msdos):
13508 * print.c (syms_of_print):
13509 * process.c (syms_of_process):
13510 * search.c (syms_of_search):
13511 * sound.c (syms_of_sound):
13512 * syntax.c (init_syntax_once, syms_of_syntax):
13513 * terminal.c (syms_of_terminal):
13514 * textprop.c (syms_of_textprop):
13515 * undo.c (syms_of_undo):
13516 * w32.c (globals_of_w32):
13517 * window.c (syms_of_window):
13518 * xdisp.c (syms_of_xdisp):
13519 * xfaces.c (syms_of_xfaces):
13520 * xfns.c (syms_of_xfns):
13521 * xmenu.c (syms_of_xmenu):
13522 * xsettings.c (syms_of_xsettings):
13523 * xterm.c (syms_of_xterm): Use DEFSYM.
13524
13525 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13526
13527 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13528
13529 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13530
13531 Integer and buffer overflow fixes (Bug#8873).
13532
13533 * print.c (printchar, strout): Check for string overflow.
13534 (PRINTPREPARE, printchar, strout):
13535 Don't set size unless allocation succeeds.
13536
13537 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13538 for sizes. Check for string overflow more accurately.
13539 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13540
13541 * macros.c: Integer and buffer overflow fixes.
13542 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13543 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13544 Use ptrdiff_t, not int, for sizes.
13545 Don't increment bufsize until after realloc succeeds.
13546 Check for size-calculation overflow.
13547 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13548
13549 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13550
13551 * lread.c: Integer overflow fixes.
13552 (read_integer): Radix is now EMACS_INT, not int,
13553 to improve quality of diagnostics for out-of-range radices.
13554 Calculate buffer size correctly for out-of-range radices.
13555 (read1): Check for integer overflow in radices, and in
13556 read-circle numbers.
13557 (read_escape): Avoid int overflow.
13558 (Fload, openp, read_buffer_size, read1)
13559 (substitute_object_recurse, read_vector, read_list, map_obarray):
13560 Use ptrdiff_t, not int, for sizes.
13561 (read1): Use EMACS_INT, not int, for sizes.
13562 Check for size overflow.
13563
13564 * image.c (cache_image): Check for size arithmetic overflow.
13565
13566 * lread.c: Integer overflow issues.
13567 (saved_doc_string_size, saved_doc_string_length)
13568 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13569 Now ptrdiff_t, not int.
13570 (read1): Don't assume doc string length fits in int. Check for
13571 out-of-range doc string lengths.
13572 (read_list): Don't assume file position fits in int.
13573 (read_escape): Check for hex character overflow.
13574
13575 2011-06-22 Leo Liu <sdl.web@gmail.com>
13576
13577 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13578 Move to minibuffer.el.
13579
13580 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13581
13582 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13583 The following patches are for when GLYPH_DEBUG && !XASSERT.
13584 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13585 * dispnew.c (flush_stdout):
13586 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13587 Mark as externally visible.
13588 * dispnew.c (check_window_matrix_pointers): Now static.
13589 * dispnew.c (window_to_frame_vpos):
13590 * xfns.c (unwind_create_frame):
13591 * xterm.c (x_check_font): Remove unused local.
13592 * scroll.c (CHECK_BOUNDS):
13593 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13594 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13595 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13596 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13597 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13598 Now static.
13599 (debug_method_add): Use va_list and vsprintf rather than relying
13600 on undefined behavior with wrong number of arguments.
13601 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13602 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13603 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13604 since we're not interested in debugging glyphs with old libraries.
13605 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13606 GCC 4.6.0's static checking.
13607
13608 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13609
13610 Integer overflow and signedness fixes (Bug#8873).
13611 A few related buffer overrun fixes, too.
13612
13613 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13614
13615 * dispextern.h (struct face.stipple):
13616 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13617 (x_bitmap_mask, x_allocate_bitmap_record)
13618 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13619 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13620 (x_create_bitmap_from_xpm_data):
13621 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13622 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13623 (.bitmaps_last):
13624 * xfaces.c (load_pixmap):
13625 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13626 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13627 (.bitmaps_last, struct x_output.icon_bitmap):
13628 Use ptrdiff_t, not int, for bitmap indexes.
13629 (x_allocate_bitmap_record): Check for size overflow.
13630 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13631
13632 Use ptrdiff_t, not int, for overlay counts.
13633 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13634 * editfns.c (overlays_around, get_pos_property):
13635 * textprop.c (get_char_property_and_overlay):
13636 * xdisp.c (next_overlay_change, note_mouse_highlight):
13637 * xfaces.c (face_at_buffer_position):
13638 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13639 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13640 (Fnext_overlay_change, Fprevious_overlay_change)
13641 (mouse_face_overlay_overlaps, Foverlays_in):
13642 Use ptrdiff_t, not int, for sizes.
13643 (overlays_at, overlays_in): Check for size-calculation overflow.
13644
13645 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13646
13647 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13648 (x_session_initialize): Do not assume string length fits in int.
13649
13650 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13651 This is unlikely, but can occur if DPI is outlandish.
13652
13653 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13654 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13655
13656 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13657 * xrdb.c (magic_file_p, search_magic_path):
13658 Omit last arg SUFFIX; it was always 0. All callers changed.
13659 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13660
13661 * xfont.c (xfont_match): Avoid need for strlen.
13662
13663 * xfns.c: Don't assume strlen fits in int.
13664 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13665
13666 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13667 not unsigned long, as we prefer signed integers. All callers changed.
13668 Detect integer overflow in repeat count.
13669 (message_dolog): Don't assume print length fits in 39 bytes.
13670 (display_mode_element): Don't assume strlen fits in int.
13671
13672 * termcap.c: Don't assume sizes fit in int and never overflow.
13673 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13674 (gobble_line): Check for size-calculation overflow.
13675
13676 * minibuf.c (Fread_buffer):
13677 * lread.c (intern, intern_c_string):
13678 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13679 Don't assume string length fits in int.
13680
13681 * keyboard.c (parse_tool_bar_item):
13682 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13683
13684 * font.c: Don't assume string length fits in int.
13685 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13686 Use ptrdiff_t, not int.
13687 (font_intern_prop): Don't assume string length fits in int.
13688 Don't assume integer property fits in fixnum.
13689 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13690
13691 * filelock.c: Fix some buffer overrun and integer overflow issues.
13692 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13693 Reformulate so as not to need the command string.
13694 Invoke gzip -cd rather than gunzip, as it's more portable.
13695 (lock_info_type, lock_file_1, lock_file):
13696 Don't assume pid_t and time_t fit in unsigned long.
13697 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13698 (current_lock_owner): Prefer signed type for sizes.
13699 Use memcpy, not strncpy, where memcpy is what is really wanted.
13700 Don't assume (via atoi) that time_t and pid_t fit in int.
13701 Check for time_t and/or pid_t out of range, e.g., via a network share.
13702 Don't alloca where an auto var works fine.
13703
13704 * fileio.c: Fix some integer overflow issues.
13705 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13706 Don't assume string length fits in int.
13707 (directory_file_name): Don't assume string length fits in long.
13708 (make_temp_name): Don't assume pid fits in int, or that its print
13709 length is less than 20.
13710
13711 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13712
13713 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13714
13715 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13716
13717 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13718 We prefer signed integers, even for size calculations.
13719
13720 * emacs.c: Don't assume string length fits in 'int'.
13721 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13722 (main): Don't invoke strlen when not needed.
13723
13724 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13725 (XD_DEBUG_MESSAGE): Don't waste a byte.
13726
13727 * callproc.c (getenv_internal_1, getenv_internal)
13728 (Fgetenv_internal):
13729 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13730
13731 * lread.c (invalid_syntax): Omit length argument.
13732 All uses changed. This doesn't fix a bug, but it simplifies the
13733 code away from its former Hollerith-constant appearance, and it's
13734 one less 'int' to worry about when looking at integer-overflow issues.
13735 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13736
13737 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13738 This didn't break anything, but it didn't help either.
13739 It's confusing to put a bogus integer in a place where the actual
13740 value does not matter.
13741 (LIST_END_P): Remove unused macro and its bogus comment.
13742 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13743
13744 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13745 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13746 implementation.
13747 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13748 We prefer signed types, and the value cannot exceed the EMACS_INT
13749 range anyway (because otherwise the length would not be representable).
13750 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13751 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13752 This avoids a GCC warning when WIDE_EMACS_INT.
13753
13754 * indent.c (sane_tab_width): New function.
13755 (current_column, scan_for_column, Findent_to, position_indentation)
13756 (compute_motion): Use it. This is just for clarity.
13757 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13758
13759 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13760
13761 * lisp.h (lint_assume): New macro.
13762 * composite.c (composition_gstring_put_cache):
13763 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13764
13765 * editfns.c, insdel.c:
13766 Omit unnecessary forward decls, to simplify future changes.
13767
13768 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13769
13770 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13771
13772 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13773 Use much-faster test for byte-length change.
13774 Don't assume string byte-length fits in 'int'.
13775 Check that character arg fits in 'int'.
13776 (mapcar1): Declare byte as byte, for clarity.
13777
13778 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13779
13780 * fns.c (concat): Catch string overflow earlier.
13781 Do not rely on integer wraparound.
13782
13783 * dispextern.h (struct it.overlay_strings_charpos)
13784 (struct it.selective): Now EMACS_INT, not int.
13785 * xdisp.c (forward_to_next_line_start)
13786 (back_to_previous_visible_line_start)
13787 (reseat_at_next_visible_line_start, next_element_from_buffer):
13788 Don't arbitrarily truncate the value of 'selective' to int.
13789
13790 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13791
13792 * composite.c: Don't truncate sizes to 'int'.
13793 (composition_gstring_p, composition_reseat_it)
13794 (composition_adjust_point): Use EMACS_INT, not int.
13795 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13796 not EMACS_UINT, for indexes.
13797
13798 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13799
13800 * buffer.c: Include <verify.h>.
13801 (struct sortvec.priority, struct sortstr.priority):
13802 Now EMACS_INT, not int.
13803 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13804 (struct sortstr.size, record_overlay_string)
13805 (struct sortstrlist.size, struct sortlist.used):
13806 Don't truncate size to int.
13807 (record_overlay_string): Check for size-calculation overflow.
13808 (init_buffer_once): Check at compile-time, not run-time.
13809
13810 2011-06-22 Jim Meyering <meyering@redhat.com>
13811
13812 Don't leak an XBM-image-sized buffer
13813 * image.c (xbm_load): Free the image buffer after using it.
13814
13815 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13816
13817 Port to Sun C.
13818 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13819 that Sun C diagnosed.
13820 * fns.c (secure_hash): Fix pointer signedness issue.
13821 * intervals.c (static_offset_intervals): New function.
13822 (offset_intervals): Use it.
13823
13824 2011-06-21 Leo Liu <sdl.web@gmail.com>
13825
13826 * deps.mk (fns.o):
13827 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13828 sha512.h.
13829
13830 * fns.c (secure_hash): Rename from crypto_hash_function and change
13831 the first arg to accept symbols.
13832 (Fsecure_hash): New primitive.
13833 (syms_of_fns): New symbols.
13834
13835 2011-06-20 Deniz Dogan <deniz@dogan.se>
13836
13837 * process.c (Fset_process_buffer): Clarify return value in
13838 docstring.
13839
13840 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
13841
13842 * dispnew.c (add_window_display_history): Use BVAR.
13843
13844 * xdisp.c (debug_method_add): Use BVAR.
13845 (check_window_end, dump_glyph_matrix, dump_glyph)
13846 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13847
13848 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13849 Likewise.
13850
13851 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13852 check till after the cache is created in init_frame_faces.
13853
13854 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13855
13856 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13857
13858 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13859
13860 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13861 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13862 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13863
13864 Improve buffer-overflow checking (Bug#8873).
13865 * fileio.c (Finsert_file_contents):
13866 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13867 Remove the old (too-loose) buffer overflow checks.
13868 They weren't needed, since make_gap checks for buffer overflow.
13869 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13870 The old code merely checked for Emacs fixnum overflow, and relied
13871 on undefined (wraparound) behavior. The new code avoids undefined
13872 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13873
13874 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13875 Tune. Don't use wider integers than needed. Don't use alloca.
13876 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13877
13878 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13879
13880 * insdel.c, lisp.h (buffer_overflow): New function.
13881 (insert_from_buffer_1, replace_range, replace_range_2):
13882 * insdel.c (make_gap_larger):
13883 * editfns.c (Finsert_char):
13884 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13885
13886 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13887
13888 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13889
13890 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13891
13892 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13893 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13894
13895 * fileio.c: Don't assume EMACS_INT fits in off_t.
13896 (emacs_lseek): New static function.
13897 (Finsert_file_contents, Fwrite_region): Use it.
13898 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13899
13900 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13901
13902 * fns.c: Don't overflow int when computing a list length.
13903 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13904 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13905 truncation on 64-bit hosts. Check for QUIT every
13906 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13907 faster and is responsive enough.
13908 (Flength): Report an error instead of overflowing an integer.
13909 (Fsafe_length): Return a float if the value is not representable
13910 as a fixnum. This shouldn't happen except in contrived situations.
13911 (Fnthcdr, Fsort): Don't assume list length fits in int.
13912 (Fcopy_sequence): Don't assume vector length fits in int.
13913
13914 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13915 (header_size, word_size): New constants.
13916 (allocate_vectorlike): Don't check size overflow here.
13917 (allocate_vector): Check it here instead, since this is the only
13918 caller of allocate_vectorlike that could cause overflow.
13919 Check that the new vector's length is representable as a fixnum.
13920
13921 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13922 The previous code was bogus. For example, next_almost_prime (32)
13923 returned 39, which is undesirable as it is a multiple of 3; and
13924 next_almost_prime (24) returned 25, which is a multiple of 5 so
13925 why was the code bothering to check for multiples of 7?
13926
13927 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13928
13929 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13930
13931 Variadic C functions now count arguments with ptrdiff_t.
13932 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13933 Back then I didn't know that the Emacs coding style prefers signed int.
13934 Also, in the meantime I found a few more instances where arguments
13935 were being counted with int, which may truncate counts on 64-bit
13936 machines, or EMACS_INT, which may be unnecessarily wide.
13937 * lisp.h (struct Lisp_Subr.function.aMANY)
13938 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13939 Arg counts are now ptrdiff_t, not size_t.
13940 All variadic functions and their callers changed accordingly.
13941 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13942 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13943 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13944 * callint.c (Fcall_interactively): Check arg count for overflow,
13945 to avoid potential buffer overrun. Use signed char, not 'int',
13946 for 'varies' array, so that we needn't bother to check its size
13947 calculation for overflow.
13948 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13949 * eval.c (apply_lambda):
13950 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13951 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13952 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13953
13954 * callint.c (Fcall_interactively): Don't use index var as event count.
13955
13956 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13957 * mem-limits.h (SIZE): Remove; no longer used.
13958
13959 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13960
13961 Remove unnecessary casts.
13962 * xterm.c (x_term_init):
13963 * xfns.c (x_set_border_pixel):
13964 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13965 These aren't needed now that we assume ANSI C.
13966
13967 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13968 It's more likely to cause problems (due to unsigned overflow)
13969 than to cure them.
13970
13971 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13972
13973 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13974
13975 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13976
13977 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13978
13979 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13980
13981 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13982
13983 GLYPH_CODE_FACE returns EMACS_INT, not int.
13984 * dispextern.h (merge_faces):
13985 * xfaces.c (merge_faces):
13986 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13987 Don't assume EMACS_INT fits in int.
13988
13989 * character.h (CHAR_VALID_P): Remove unused parameter.
13990 * fontset.c, lisp.h, xdisp.c: All uses changed.
13991
13992 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13993
13994 * fns.c (concat): Minor tuning based on overflow analysis.
13995 This doesn't fix any bugs. Use int to hold character, instead
13996 of constantly refetching from Emacs object. Use XFASTINT, not
13997 XINT, for value known to be a character. Don't bother comparing
13998 a single byte to 0400, as it's always less.
13999
14000 * floatfns.c (Fexpt):
14001 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14002
14003 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14004 for characters.
14005
14006 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14007
14008 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14009 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14010 incorrectly succeed when S was a string, because 4294967386 was
14011 truncated before it was used.
14012
14013 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14014 Otherwise, an out-of-range integer could cause undefined behavior
14015 on a 64-bit host.
14016
14017 * composite.c: Use int, not EMACS_INT, for characters.
14018 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14019 EMACS_INT, for values that are known to be in character range.
14020 This doesn't fix any bugs but is the usual style inside Emacs and
14021 may generate better code on 32-bit machines.
14022
14023 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14024 This is for reasons similar to the recent CHAR_STRING fix.
14025 * charset.c (Fencode_char): Check that character arg is actually
14026 a character. Pass an int to ENCODE_CHAR.
14027 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14028 wider than 'int', as a compile-time check to prevent future regressions
14029 in this area.
14030
14031 * character.c (char_string): Remove unnecessary casts.
14032
14033 Make sure a 64-bit char is never passed to CHAR_STRING.
14034 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14035 by silently ignoring the top 32 bits, allowing some values
14036 that were far too large to be valid characters.
14037 * character.h: Include <verify.h>.
14038 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14039 arguments are no wider than unsigned, as a compile-time check
14040 to prevent future regressions in this area.
14041 * data.c (Faset):
14042 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14043 (Fsubst_char_in_region):
14044 * fns.c (concat):
14045 * xdisp.c (decode_mode_spec_coding):
14046 Adjust to CHAR_STRING's new requirement.
14047 * editfns.c (Finsert_char, Fsubst_char_in_region):
14048 * fns.c (concat): Check that character args are actually
14049 characters. Without this test, these functions did the wrong
14050 thing with wildly out-of-range values on 64-bit hosts.
14051
14052 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14053 These casts should not be needed on 32-bit hosts, either.
14054 * keyboard.c (read_char):
14055 * lread.c (Fload): Remove casts to unsigned.
14056
14057 * lisp.h (UNSIGNED_CMP): New macro.
14058 This fixes comparison bugs on 64-bit hosts.
14059 (ASCII_CHAR_P): Use it.
14060 * casefiddle.c (casify_object):
14061 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14062 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14063 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14064 * dispextern.h (FACE_FROM_ID):
14065 * keyboard.c (read_char): Use UNSIGNED_CMP.
14066
14067 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14068 not to EMACS_INT, to avoid GCC warning.
14069
14070 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14071
14072 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14073 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14074 isn't needed on 32-bit machines.
14075
14076 * buffer.c (Fgenerate_new_buffer_name):
14077 Use EMACS_INT for count, not int.
14078 (advance_to_char_boundary): Return EMACS_INT, not int.
14079
14080 * data.c (Qcompiled_function): Now static.
14081
14082 * window.c (window_body_lines): Now static.
14083
14084 * image.c (gif_load): Rename local to avoid shadowing.
14085
14086 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14087 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14088 * alloc.c (make_save_value): Integer argument is now of type
14089 ptrdiff_t, not int.
14090 (mark_object): Use ptrdiff_t, not int.
14091 * lisp.h (pD): New macro.
14092 * print.c (print_object): Use it.
14093
14094 * alloc.c: Use EMACS_INT, not int, to count objects.
14095 (total_conses, total_markers, total_symbols, total_vector_size)
14096 (total_free_conses, total_free_markers, total_free_symbols)
14097 (total_free_floats, total_floats, total_free_intervals)
14098 (total_intervals, total_strings, total_free_strings):
14099 Now EMACS_INT, not int. All uses changed.
14100 (Fgarbage_collect): Compute overall total using a double, so that
14101 integer overflow is less likely to be a problem. Check for overflow
14102 when converting back to an integer.
14103 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14104 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14105 These were 'int' variables that could overflow on 64-bit hosts;
14106 they were never used, so remove them instead of repairing them.
14107 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14108 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14109 Previously, this ceilinged at INT_MAX, but that doesn't work on
14110 64-bit machines.
14111 (allocate_pseudovector): Don't use EMACS_INT when int would do.
14112
14113 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14114 (allocate_vectorlike): Check for ptrdiff_t overflow.
14115 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14116 when a (possibly-narrower) signed value would do just as well.
14117 We prefer using signed arithmetic, to avoid comparison confusion.
14118
14119 * alloc.c: Catch some string size overflows that we were missing.
14120 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14121 for convenience in STRING_BYTES_MAX.
14122 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14123 The definition here is exact; the one in lisp.h was approximate.
14124 (allocate_string_data): Check for string overflow. This catches
14125 some instances we weren't catching before. Also, it catches
14126 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14127 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14128 and ptrdiff_t and EMACS_INT are both 64 bits.
14129
14130 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14131 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14132 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14133
14134 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14135
14136 * alloc.c (Fmake_string): Check for out-of-range init.
14137
14138 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14139
14140 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14141
14142 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14143
14144 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14145 xg_get_default_scrollbar_width.
14146
14147 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14148 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14149 (style_changed_cb): Call update_theme_scrollbar_width and call
14150 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14151 all frames (Bug#8505).
14152 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14153 Call gtk_window_set_resizable if HAVE_GTK3.
14154 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14155 and height if HAVE_GTK3 (Bug#8505).
14156 (scroll_bar_width_for_theme): New variable.
14157 (update_theme_scrollbar_width): New function.
14158 (xg_get_default_scrollbar_width): Move code to
14159 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14160 (xg_initialize): Call update_theme_scrollbar_width.
14161
14162 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14163
14164 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14165
14166 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14167
14168 * frame.c (make_frame): Call other_buffer_safely instead of
14169 other_buffer.
14170
14171 * window.c (temp_output_buffer_show): Call display_buffer with
14172 second argument Vtemp_buffer_show_specifiers and reset latter
14173 immediately after the call.
14174 (Vtemp_buffer_show_specifiers): New variable.
14175 (auto_window_vscroll_p, next_screen_context_lines)
14176 (Vscroll_preserve_screen_position): Remove leading asterisks from
14177 doc-strings.
14178
14179 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
14180
14181 Fix minor problems found by GCC 4.6.0 static checking.
14182 * buffer.c (Qclone_number): Remove for now, as it's unused.
14183 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14184 (record_buffer): Remove unused local.
14185 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14186 (set_frame_buffer_list): Remove; unused.
14187 * frame.h (other_visible_frames): Remove decl.
14188 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14189 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14190 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14191 if HAVE_GPM.
14192 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14193 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14194 Define only if HAVE_GPM.
14195 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14196 (update_hints_inhibit): Remove; never set. All uses removed.
14197 * widgetprv.h (emacsFrameClassRec): Remove decl.
14198 * window.c (delete_deletable_window): Now returns void, since it
14199 wasn't returning anything.
14200 (compare_window_configurations): Remove unused locals.
14201 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14202 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14203 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14204 the same widths as pointers. This follows up on the 2011-05-06 patch.
14205 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14206 * xterm.h: Likewise.
14207 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14208
14209 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
14210
14211 * makefile.w32-in: Update dependencies.
14212 (LISP_H): Add lib/intprops.h.
14213
14214 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14215
14216 * image.c (gif_load): Add animation frame delay to the metadata.
14217 (syms_of_image): Use DEFSYM. New symbol `delay'.
14218
14219 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14220
14221 * window.c (delete_deletable_window): Re-add.
14222 (Fset_window_configuration): Rewrite to handle dead buffers and
14223 consequently deletable windows.
14224 (window_tree, Fwindow_tree): Remove. Supply functionality in
14225 window.el.
14226 (compare_window_configurations): Simplify code.
14227
14228 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14229
14230 * image.c (imagemagick_load_image): Fix type mismatch.
14231 (Fimagemagick_types): Likewise.
14232
14233 * window.h (replace_buffer_in_windows): Declare.
14234
14235 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14236
14237 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14238 Qclone_number. Remove external declaration of Qdelete_window.
14239 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14240 code.
14241 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14242 Run Qbuffer_list_update_hook if allowed.
14243 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14244 buffer list implementation.
14245 (other_buffer_safely): New function.
14246 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14247 calls to replace_buffer_in_windows and
14248 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14249 if allowed.
14250 (record_buffer): Inhibit quitting and rewrite using quittable
14251 functions. Run Qbuffer_list_update_hook if allowed.
14252 (Frecord_buffer, Funrecord_buffer): New functions.
14253 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14254 Move switch-to-buffer to window.el.
14255 (bury-buffer): Move to window.el.
14256 (Vbuffer_list_update_hook): New variable.
14257
14258 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14259 section.
14260
14261 * window.h (resize_frame_windows): Move up in code.
14262 (Fwindow_frame): Remove EXFUN.
14263 (replace_buffer_in_all_windows): Remove prototype.
14264 (replace_buffer_in_windows_safely): Add prototype.
14265
14266 * window.c: Declare Qdelete_window static again. Move down
14267 declaration of select_count.
14268 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14269 (Fother_window): Move to window.el.
14270 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14271 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14272 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14273 window.el.
14274 (replace_buffer_in_windows): Implement by calling
14275 Qreplace_buffer_in_windows.
14276 (replace_buffer_in_all_windows): Remove with some functionality
14277 moved into replace_buffer_in_windows_safely.
14278 (replace_buffer_in_windows_safely): New function.
14279 (select_window_norecord, select_frame_norecord): Move in front
14280 of run_window_configuration_change_hook. Remove now obsolete
14281 declarations.
14282 (Fset_window_buffer): Rewrite doc-string.
14283 Call Qrecord_window_buffer.
14284 (keys_of_window): Move binding for other-window to window.el.
14285
14286 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14287
14288 * dispextern.h (struct image): Replace data member, whose int_val
14289 and ptr_val fields were not used by anything, with a single
14290 lisp_val object.
14291
14292 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14293 (gif_clear_image, gif_load, imagemagick_load_image)
14294 (gs_clear_image, gs_load): Callers changed.
14295
14296 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14297
14298 * buffer.h: Include <time.h>, for time_t.
14299 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14300
14301 Fix minor problems found by static checking.
14302
14303 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14304
14305 Make identifiers static if they are not used in other modules.
14306 * data.c (Qcompiled_function, Qframe, Qvector):
14307 * image.c (QimageMagick, Qsvg):
14308 * minibuf.c (Qmetadata):
14309 * window.c (resize_window_check, resize_root_window): Now static.
14310 * window.h (resize_window_check, resize_root_window): Remove decls.
14311
14312 * window.c (window_deletion_count, delete_deletable_window):
14313 Remove; unused.
14314 (window_body_lines): Now static.
14315 (Fdelete_other_windows_internal): Mark vars as initialized.
14316 Make sure 'resize_failed' is initialized.
14317 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14318 (resize_window_apply): Remove unused local.
14319 * window.h (delete_deletable_window): Remove decl.
14320
14321 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14322 (imagemagick_load_image): Fix pointer signedness problem by changing
14323 last arg from unsigned char * to char *. All uses changed.
14324 Also, fix a local for similar reasons.
14325 Remove unused locals. Remove locals to avoid shadowing.
14326 (fn_rsvg_handle_free): Remove; unused.
14327 (svg_load, svg_load_image): Fix pointer signedness problem.
14328 (imagemagick_load_image): Don't use garbage pointer image_wand.
14329
14330 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14331
14332 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
14333
14334 * image.c (gif_load): Fix omitted cast error introduced by
14335 2011-06-06 change.
14336
14337 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14338
14339 * window.h (resize_proportionally, orig_total_lines)
14340 (orig_top_line): Remove from window structure.
14341 (set_window_height, set_window_width, change_window_heights)
14342 (Fdelete_window): Remove prototypes.
14343 (resize_frame_windows): Remove duplicate declaration.
14344
14345 2011-06-10 Eli Zaretskii <eliz@gnu.org>
14346
14347 * window.h (resize_frame_windows, resize_window_check)
14348 (delete_deletable_window, resize_root_window)
14349 (resize_frame_windows): Declare prototypes.
14350
14351 * window.c (resize_window_apply): Make definition be "static" to
14352 match the prototype.
14353
14354 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14355
14356 * window.c: Remove declarations of Qwindow_size_fixed,
14357 window_min_size_1, window_min_size_2, window_min_size,
14358 size_window, window_fixed_size_p, enlarge_window, delete_window.
14359 Remove static from declaration of Qdelete_window, it's
14360 temporarily needed by Fbury_buffer.
14361 (replace_window): Don't assign orig_top_line and
14362 orig_total_lines.
14363 (Fdelete_window, delete_window): Remove. Window deletion is
14364 handled by window.el.
14365 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14366 Replace Fdelete_window calls with calls to Qdelete_window.
14367 (Fdelete_other_windows): Remove. Deleting other windows is
14368 handled by window.el.
14369 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14370 handled in window.el.
14371 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14372 Window minimum sizes are handled in window.el.
14373 (shrink_windows, size_window, set_window_height)
14374 (set_window_width, change_window_heights, window_height)
14375 (window_width, CURBEG, CURSIZE, enlarge_window)
14376 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14377 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14378 handled in window.el.
14379 (make_dummy_parent): Rename to make_parent_window and give it a
14380 second argument horflag.
14381 (make_window): Don't set resize_proportionally any more.
14382 (Fsplit_window): Remove. Windows are split in window.el.
14383 (save_restore_action, save_restore_orig_size)
14384 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14385 Resize mini windows in window.el.
14386 (grow_mini_window, shrink_mini_window): Implement by calling
14387 Qresize_root_window_vertically, resize_window_check and
14388 resize_window_apply.
14389 (saved_window, Fset_window_configuration, save_window_save):
14390 Do not handle orig_top_line, orig_total_lines, and
14391 resize_proportionally.
14392 (window_min_height, window_min_width): Move to window.el.
14393 (keys_of_window): Move bindings for delete-other-windows,
14394 split-window, delete-window and enlarge-window to window.el.
14395
14396 * buffer.c: Temporarily extern Qdelete_window.
14397 (Fbury_buffer): Temporarily call Qdelete_window instead of
14398 Fdelete_window (Fbury_buffer will move to window.el soon).
14399
14400 * frame.c (set_menu_bar_lines_1): Remove code handling
14401 orig_top_line and orig_total_lines.
14402
14403 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14404 set_window_height but set heights directly.
14405 (change_frame_size_1): Use resize_frame_windows.
14406
14407 * xdisp.c (init_xdisp): Don't use set_window_height but set
14408 heights directly.
14409
14410 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14411 Use resize_frame_windows instead of change_window_heights and run
14412 run_window_configuration_change_hook.
14413
14414 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14415 instead of change_window_heights and run
14416 run_window_configuration_change_hook.
14417
14418 2011-06-09 Martin Rudalics <rudalics@gmx.at>
14419
14420 * window.c (replace_window): Rename second argument REPLACEMENT to
14421 NEW. New third argument SETFLAG. Rewrite.
14422 (delete_window, make_dummy_parent): Call replace_window with
14423 third argument 1.
14424 (window_list_1): Move down in code.
14425 (run_window_configuration_change_hook): Move set_buffer part
14426 before select_frame_norecord part in order to unwind correctly.
14427 Rename count1 to count.
14428 (recombine_windows, delete_deletable_window, resize_root_window)
14429 (Fdelete_other_windows_internal)
14430 (Frun_window_configuration_change_hook, make_parent_window)
14431 (resize_window_check, resize_window_apply, Fresize_window_apply)
14432 (resize_frame_windows, Fsplit_window_internal)
14433 (Fdelete_window_internal, Fresize_mini_window_internal):
14434 New functions.
14435 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14436
14437 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14438
14439 * window.h (window): Add some new members to window structure -
14440 normal_lines, normal_cols, new_total, new_normal, clone_number,
14441 splits, nest, prev_buffers, next_buffers.
14442 (WINDOW_TOTAL_SIZE): Move here from window.c.
14443 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14444
14445 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14446 Remove.
14447 (make_dummy_parent): Set new members of windows structure.
14448 (make_window): Move down in code. Handle new members of window
14449 structure.
14450 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14451 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14452 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14453 (Fset_window_prev_buffers, Fwindow_next_buffers)
14454 (Fset_window_next_buffers, Fset_window_clone_number):
14455 New functions.
14456 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14457 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14458 Doc-string fixes.
14459 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14460 Argument WINDOW can be now internal window too.
14461 (Fwindow_use_time): Move up in code.
14462 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14463 Rewrite doc-string.
14464 (Fset_window_configuration, saved_window)
14465 (Fcurrent_window_configuration, save_window_save): Handle new
14466 members of window structure.
14467 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14468 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14469 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14470 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14471 Qget_mru_window, Qresize_root_window,
14472 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14473 Qauto_buffer_name; staticpro them.
14474
14475 2011-06-07 Martin Rudalics <rudalics@gmx.at>
14476
14477 * window.c (Fwindow_total_size, Fwindow_left_column)
14478 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14479 (Fwindow_list_1): New functions.
14480 (window_box_text_cols): Replace with window_body_cols.
14481 (Fwindow_width, Fscroll_left, Fscroll_right):
14482 Use window_body_cols instead of window_box_text_cols.
14483 (delete_window, Fset_window_configuration):
14484 Call delete_all_subwindows with window as argument.
14485 (delete_all_subwindows): Take a window as argument and not a
14486 structure. Rewrite.
14487 (window_loop): Remove handling of GET_LRU_WINDOW and
14488 GET_LARGEST_WINDOW.
14489 (Fget_lru_window, Fget_largest_window): Move to window.el.
14490
14491 * window.h: Extern window_body_cols instead of
14492 window_box_text_cols. delete_all_subwindows now takes a
14493 Lisp_Object as argument.
14494
14495 * indent.c (compute_motion, Fcompute_motion):
14496 Use window_body_cols instead of window_box_text_cols.
14497
14498 * frame.c (delete_frame): Call delete_all_subwindows with root
14499 window as argument.
14500
14501 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14502
14503 * fns.c (Fputhash): Document return value.
14504
14505 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
14506
14507 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14508
14509 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14510
14511 Cons<->int and similar integer overflow fixes (Bug#8794).
14512
14513 Check for overflow when converting integer to cons and back.
14514 * charset.c (Fdefine_charset_internal, Fdecode_char):
14515 Use cons_to_unsigned to catch overflow.
14516 (Fencode_char): Use INTEGER_TO_CONS.
14517 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14518 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14519 * data.c (long_to_cons, cons_to_long): Remove.
14520 (cons_to_unsigned, cons_to_signed): New functions.
14521 These signal an error for invalid or out-of-range values.
14522 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14523 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14524 * font.c (Ffont_variation_glyphs):
14525 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14526 * lisp.h: Include <intprops.h>.
14527 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14528 (cons_to_signed, cons_to_unsigned): New decls.
14529 (long_to_cons, cons_to_long): Remove decls.
14530 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14531 (Fprimitive_undo): Use CONS_TO_INTEGER.
14532 * xfns.c (Fx_window_property): Likewise.
14533 * xselect.c: Include <limits.h>.
14534 (x_own_selection, selection_data_to_lisp_data):
14535 Use INTEGER_TO_CONS.
14536 (x_handle_selection_request, x_handle_selection_clear)
14537 (x_get_foreign_selection, Fx_disown_selection_internal)
14538 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14539 (lisp_data_to_selection_data): Use cons_to_unsigned.
14540 (x_fill_property_data): Use cons_to_signed.
14541 Report values out of range.
14542
14543 Check for buffer and string overflow more precisely.
14544 * buffer.h (BUF_BYTES_MAX): New macro.
14545 * lisp.h (STRING_BYTES_MAX): New macro.
14546 * alloc.c (Fmake_string):
14547 * character.c (string_escape_byte8):
14548 * coding.c (coding_alloc_by_realloc):
14549 * doprnt.c (doprnt):
14550 * editfns.c (Fformat):
14551 * eval.c (verror):
14552 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14553 since they may not be the same number.
14554 * editfns.c (Finsert_char):
14555 * fileio.c (Finsert_file_contents):
14556 Likewise for BUF_BYTES_MAX.
14557
14558 * image.c: Use ptrdiff_t, not int, for sizes.
14559 (slurp_file): Switch from int to ptrdiff_t.
14560 All uses changed.
14561 (slurp_file): Check that file size fits in both size_t (for
14562 malloc) and ptrdiff_t (for sanity and safety).
14563
14564 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14565 if b->modtime has its maximal value.
14566
14567 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14568
14569 Don't assume time_t can fit into int.
14570 * buffer.h (struct buffer.modtime): Now time_t, not int.
14571 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14572 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14573
14574 Minor fixes for signed vs unsigned integers.
14575 * character.h (MAYBE_UNIFY_CHAR):
14576 * charset.c (maybe_unify_char):
14577 * keyboard.c (read_char, reorder_modifiers):
14578 XINT -> XFASTINT, since the integer must be nonnegative.
14579 * ftfont.c (ftfont_spec_pattern):
14580 * keymap.c (access_keymap, silly_event_symbol_error):
14581 XUINT -> XFASTINT, since the integer must be nonnegative.
14582 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14583 since it makes no difference and we prefer signed.
14584 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14585 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14586 nonnegative.
14587
14588 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14589
14590 * window.h (Fwindow_frame): Declare.
14591
14592 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14593
14594 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14595 (SPARE_MEMORY): Always define.
14596 (LARGE_REQUEST): Remove.
14597 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14598
14599 2011-06-06 Martin Rudalics <rudalics@gmx.at>
14600
14601 * lisp.h: Move EXFUNS for Fframe_root_window,
14602 Fframe_first_window and Fset_frame_selected_window to window.h.
14603
14604 * window.h: Move EXFUNS for Fframe_root_window,
14605 Fframe_first_window and Fset_frame_selected_window here from
14606 lisp.h.
14607
14608 * frame.c (Fwindow_frame, Fframe_first_window)
14609 (Fframe_root_window, Fframe_selected_window)
14610 (Fset_frame_selected_window): Move to window.c.
14611 (Factive_minibuffer_window): Move to minibuf.c.
14612 (Fother_visible_frames_p): New function.
14613
14614 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14615
14616 * window.c (decode_window, decode_any_window): Move up in code.
14617 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14618 (inhibit_frame_unsplittable): Remove unused variable.
14619 (Fwindow_buffer): Move up and rewrite doc-string.
14620 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14621 (Fwindow_prev): New functions.
14622 (Fwindow_frame): Move here from frame.c. Accept any window as
14623 argument.
14624 (Fframe_root_window, Fframe_first_window)
14625 (Fframe_selected_window): Move here from frame.c. Accept frame
14626 or arbitrary window as argument. Update doc-strings.
14627 (Fminibuffer_window): Move up in code.
14628 (Fwindow_minibuffer_p): Move up in code and simplify.
14629 (Fset_frame_selected_window): Move here from frame.c.
14630 Marginal rewrite.
14631 (Fselected_window, select_window, Fselect_window): Move up in
14632 code. Minor doc-string fixes.
14633
14634 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14635
14636 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14637 Do not assume that spare memory exists; that assumption is valid
14638 only if SYSTEM_MALLOC.
14639 (LARGE_REQUEST): New macro, so that the issue of large requests
14640 is separated from the issue of spare memory.
14641
14642 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14643
14644 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14645 format. (Bug#8806)
14646
14647 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14648
14649 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14650 before statements.
14651
14652 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14653
14654 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14655
14656 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14657
14658 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14659 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14660
14661 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
14662
14663 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14664
14665 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
14666
14667 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14668 (x_clipboard_manager_save): Add return value.
14669 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14670 New error handlers.
14671 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14672 Obey Vx_select_enable_clipboard_manager. Catch errors in
14673 x_clipboard_manager_save (Bug#8779).
14674 (Vx_select_enable_clipboard_manager): New variable.
14675 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14676
14677 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
14678
14679 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14680
14681 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14682
14683 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14684 in the current matrix if keep_current_p is non-zero.
14685
14686 2011-06-04 Eli Zaretskii <eliz@gnu.org>
14687
14688 * bidi.c (bidi_level_of_next_char): Fix last change.
14689
14690 2011-06-03 Eli Zaretskii <eliz@gnu.org>
14691
14692 Support bidi reordering of text covered by display properties.
14693
14694 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14695 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14696 (bidi_cache_search, bidi_cache_iterator_state)
14697 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14698 (bidi_level_of_next_char, bidi_move_to_visually_next):
14699 Support character positions inside a run of characters covered by a
14700 display string.
14701 (bidi_paragraph_init, bidi_resolve_explicit_1)
14702 (bidi_level_of_next_char): Call bidi_fetch_char and
14703 bidi_fetch_char_advance instead of FETCH_CHAR and
14704 FETCH_CHAR_ADVANCE.
14705 (bidi_init_it): Initialize new members.
14706 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14707 definitions.
14708 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14709 instead of using explicit *_CHAR codes.
14710 (bidi_resolve_explicit, bidi_resolve_weak):
14711 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14712 bidirectional text is supported only in multibyte buffers.
14713 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14714 it to initialize the frame_window_p member of struct bidi_it.
14715 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14716 (bidi_resolve_explicit, bidi_resolve_weak)
14717 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14718 bidi_it->nchars is non-positive.
14719 (bidi_level_of_next_char): Don't try to lookup the cache for the
14720 next/previous character if nothing is cached there yet, or if we
14721 were just reseat()'ed to a new position.
14722
14723 * xdisp.c (set_cursor_from_row): Set start and stop points
14724 according to the row's direction when priming the loop that looks
14725 for the glyph on which to display cursor.
14726 (single_display_spec_intangible_p): Function deleted.
14727 (display_prop_intangible_p): Reimplement to call
14728 handle_display_spec instead of single_display_spec_intangible_p.
14729 Accept 3 additional arguments needed by handle_display_spec.
14730 This fixes incorrect cursor motion across display property with complex
14731 values: lists, `(when COND...)' forms, etc.
14732 (single_display_spec_string_p): Support property values that are
14733 lists with the argument STRING its top-level element.
14734 (display_prop_string_p): Fix the condition for processing a
14735 property that is a list to be consistent with handle_display_spec.
14736 (handle_display_spec): New function, refactored from the
14737 last portion of handle_display_prop.
14738 (compute_display_string_pos): Accept additional argument
14739 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14740 value of a `display' property is a "replacing spec".
14741 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14742 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14743 the display property, but just return a value indicating whether
14744 the display property will replace the characters it covers.
14745 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14746 frame_window_p members of struct bidi_it.
14747 (compute_display_string_pos, compute_display_string_end):
14748 New functions.
14749 (push_it): Accept second argument POSITION, where pop_it should
14750 jump to continue iteration.
14751 (reseat_1): Initialize bidi_it.disp_pos.
14752
14753 * keyboard.c (adjust_point_for_property): Adjust the call to
14754 display_prop_intangible_p to its new signature.
14755
14756 * dispextern.h (struct bidi_it): New member frame_window_p.
14757 (bidi_init_it): Update prototypes.
14758 (display_prop_intangible_p): Update prototype.
14759 (compute_display_string_pos, compute_display_string_end):
14760 Declare prototypes.
14761 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14762 EMACS_INT.
14763
14764 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14765
14766 Malloc failure behavior now depends on size of allocation.
14767 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14768 * lisp.h: Change signatures accordingly.
14769 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14770 All callers changed. (Bug#8762)
14771
14772 * gnutls.c: Use Emacs's memory allocators.
14773 Without this change, the gnutls library would invoke malloc etc.
14774 directly, which causes problems on non-SYNC_INPUT hosts, and which
14775 runs afoul of improving memory_full behavior. (Bug#8761)
14776 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14777 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14778 xfree instead of the default malloc, realloc, free.
14779 (Fgnutls_boot): No need to check for memory allocation failure,
14780 since xmalloc does that for us.
14781
14782 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14783 * category.c (hash_get_category_set):
14784 * ccl.c (ccl_driver):
14785 * charset.c (Fdefine_charset_internal):
14786 * charset.h (struct charset.hash_index):
14787 * composite.c (get_composition_id, gstring_lookup_cache)
14788 (composition_gstring_put_cache):
14789 * composite.h (struct composition.hash_index):
14790 * dispextern.h (struct image.hash):
14791 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14792 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14793 (hashfn_equal, hashfn_user_defined, make_hash_table)
14794 (maybe_resize_hash_table, hash_lookup, hash_put)
14795 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14796 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14797 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14798 * image.c (make_image, search_image_cache, lookup_image)
14799 (xpm_put_color_table_h):
14800 * lisp.h (struct Lisp_Hash_Table):
14801 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14802 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14803 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14804 * alloc.c (allocate_vectorlike):
14805 Check for overflow in vector size calculations.
14806 * ccl.c (ccl_driver):
14807 Check for overflow when converting EMACS_INT to int.
14808 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14809 need to be updated by these changes.
14810 * fns.c (make_hash_table, maybe_resize_hash_table):
14811 Check for integer overflow with large hash tables.
14812 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14813 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14814 (SXHASH_REDUCE): New macro.
14815 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14816 Use it instead of discarding useful hash info with large hash values.
14817 (sxhash_float): New function.
14818 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14819 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14820 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14821 Rewrite to use FIXNUM_BITS, as this simplifies things.
14822 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14823 Adjust signatures to match updated version of code.
14824 (consing_since_gc): Now EMACS_INT, since a single hash table can
14825 use more than INT_MAX bytes.
14826
14827 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14828
14829 Make it possible to build with GCC-4.6+ -O2 -flto.
14830
14831 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14832
14833 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14834
14835 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14836 Call minibuffer-inactive-mode.
14837
14838 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
14839
14840 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14841 Update dependencies.
14842
14843 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14844
14845 * data.c (init_data): Remove code for UTS, this system is not
14846 supported anymore.
14847
14848 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14849
14850 Don't force ./temacs to start in terminal mode.
14851
14852 * frame.c (make_initial_frame): Initialize faces in all cases, not
14853 only when CANNOT_DUMP is defined.
14854 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14855
14856 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14857
14858 * dispnew.c (add_window_display_history): Use const for the string
14859 pointer. Remove declaration, not needed.
14860
14861 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14862
14863 Use 'inline', not 'INLINE'.
14864 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14865 * alloc.c, fontset.c (INLINE): Remove.
14866 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14867 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14868 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14869 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14870 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14871
14872 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14873
14874 Make it possible to run ./temacs.
14875
14876 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14877 syms_of_callproc does the same thing. Remove test for
14878 "initialized", do it in the caller.
14879 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14880
14881 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14882
14883 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14884 (read_minibuf): Use get_minibuffer.
14885 (syms_of_minibuf): Use DEFSYM.
14886 (Qmetadata): New var.
14887 * data.c (Qbuffer): Don't make it static.
14888 (syms_of_data): Use DEFSYM.
14889
14890 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14891
14892 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14893 (CCL_CODE_MIN): New macro.
14894
14895 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14896
14897 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14898
14899 * eval.c (Qdebug): Now static.
14900 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14901 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14902 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14903
14904 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14905
14906 * image.c: Various fixes to ImageMagick code comments.
14907 (Fimagemagick_types): Doc fix.
14908
14909 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14910
14911 Minor fixes prompted by GCC 4.6.0 warnings.
14912
14913 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14914
14915 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14916 (x_clipboard_manager_save_all): Move extern decl to ...
14917 * xterm.h: ... here, so that it can be checked for consistency.
14918
14919 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14920
14921 * xselect.c (x_clipboard_manager_save_frame)
14922 (x_clipboard_manager_save_all): New functions.
14923 (Fx_clipboard_manager_save): Lisp function deleted.
14924
14925 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14926 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14927
14928 * xterm.h: Update prototype.
14929
14930 2011-05-28 William Xu <william.xwl@gmail.com>
14931
14932 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14933 exiting (Bug#8239).
14934
14935 2011-05-28 Jim Meyering <meyering@redhat.com>
14936
14937 Avoid a sign-extension bug in crypto_hash_function.
14938 * fns.c (to_uchar): Define.
14939 (crypto_hash_function): Use it to convert some newly-signed
14940 variables to unsigned, to avoid sign-extension bugs. For example,
14941 without this change, (md5 "truc") would evaluate to
14942 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14943 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14944 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14945
14946 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14947
14948 Integer overflow fixes.
14949
14950 * dbusbind.c: Serial number integer overflow fixes.
14951 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14952 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14953 to hold a serial number that is too large for a fixnum.
14954 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14955 Check for serial numbers out of range. Decode any serial number
14956 that was so large that it became a float. (Bug#8722)
14957
14958 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14959 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14960 Use XFASTINT rather than XUINT when numbers are nonnegative.
14961 (xd_append_arg, Fdbus_method_return_internal):
14962 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14963 arguments, check that Lisp number is nonnegative, rather than
14964 silently wrapping negative numbers around. (Bug#8722)
14965 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14966 (Bug#8722)
14967
14968 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14969
14970 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14971
14972 ccl: Add integer overflow checks.
14973 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14974 (IN_INT_RANGE): New macros.
14975 (ccl_driver): Use them to check for integer overflow when
14976 decoding a CCL program. Many of the new checks are whether XINT (x)
14977 fits in int; it doesn't always, on 64-bit hosts. The new version
14978 doesn't catch all possible integer overflows, but it's an
14979 improvement. (Bug#8719)
14980
14981 * alloc.c (make_event_array): Use XINT, not XUINT.
14982 There's no need for unsigned here.
14983
14984 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14985 This follows up to the 2011-05-06 change that substituted uintptr_t
14986 for EMACS_INT. This case wasn't caught back then.
14987
14988 Rework Fformat to avoid integer overflow issues.
14989 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14990 now (part of C89). Include <verify.h>.
14991 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14992 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14993 (Fformat): Avoid the prepass trying to compute sizes; it was only
14994 approximate and thus did not catch overflow reliably. Instead, walk
14995 through the format just once, formatting and computing sizes as we go,
14996 checking for integer overflow at every step, and allocating a larger
14997 buffer as needed. Keep track separately whether the format is
14998 multibyte. Keep only the most-recently calculated precision, rather
14999 than them all. Record whether each argument has been converted to
15000 string. Use EMACS_INT, not int, for byte and char and arg counts.
15001 Support field widths and precisions larger than INT_MAX. Avoid
15002 sprintf's undefined behavior with conversion specifications such as %#d
15003 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15004 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15005 formatting out-of-range floating point numbers with int
15006 formats. (Bug#8668)
15007
15008 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15009
15010 * data.c: Avoid integer truncation in expressions involving floats.
15011 * data.c: Include <intprops.h>.
15012 (arith_driver): When there's an integer overflow in an expression
15013 involving floating point, convert the integers to floating point
15014 so that the resulting value does not suffer from catastrophic
15015 integer truncation. For example, on a 64-bit host (* 4
15016 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15017 Do not rely on undefined behavior after integer overflow.
15018
15019 merge count_size_as_multibyte, parse_str_to_multibyte
15020 * character.c, character.h (count_size_as_multibyte):
15021 Rename from parse_str_to_multibyte; all uses changed.
15022 Check for integer overflow.
15023 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15024 since it's now a duplicate of the other. This is more of
15025 a character than a buffer op, so better that it's in character.c.
15026 * fns.c, print.c: Adjust to above changes.
15027
15028 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15029
15030 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15031
15032 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15033
15034 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15035 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15036 (x_clipboard_manager_save): Now static.
15037 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15038
15039 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15040 (crypto_hash_function): Now static.
15041 Fix pointer signedness problems. Avoid unnecessary initializations.
15042
15043 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15044
15045 * termhooks.h (Vselection_alist): Make it terminal-local.
15046
15047 * terminal.c (create_terminal): Initialize it.
15048
15049 * xselect.c: Support for clipboard managers.
15050 (Vselection_alist): Move to termhooks.h as terminal-local var.
15051 (LOCAL_SELECTION): New macro.
15052 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15053 (symbol_to_x_atom): Remove gratuitous arg.
15054 (x_handle_selection_request, lisp_data_to_selection_data)
15055 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15056 (x_own_selection, x_get_local_selection, x_convert_selection):
15057 New arg, specifying work frame. Use terminal-local Vselection_alist.
15058 (some_frame_on_display): Delete unused function.
15059 (Fx_own_selection_internal, Fx_get_selection_internal)
15060 (Fx_disown_selection_internal, Fx_selection_owner_p)
15061 (Fx_selection_exists_p): New optional frame arg.
15062 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15063 (x_handle_selection_clear): Don't treat other terminals with the
15064 same keyboard specially. Use the terminal-local Vselection_alist.
15065 (x_clear_frame_selections): Use Frun_hook_with_args.
15066
15067 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15068
15069 * xterm.h: Add support for those atoms.
15070
15071 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
15072
15073 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15074 (converted_selections, conversion_fail_tag): New global variables.
15075 (x_selection_request_lisp_error): Free the above.
15076 (x_get_local_selection): Remove unnecessary code.
15077 (x_reply_selection_request): Args changed; handle arbitrary array
15078 of converted selections stored in converted_selections.
15079 Separate the XChangeProperty and SelectionNotify steps.
15080 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15081 (x_convert_selection): New function.
15082 (x_handle_selection_event): Simplify.
15083 (x_get_foreign_selection): Don't ignore incoming requests while
15084 waiting for an answer; this will fail when we implement
15085 SAVE_TARGETS, and seems unnecessary anyway.
15086 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15087 (Vx_sent_selection_functions): Doc fix.
15088
15089 2011-05-26 Leo Liu <sdl.web@gmail.com>
15090
15091 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15092
15093 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15094
15095 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15096
15097 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15098 for fringe update if it has periodic bitmap.
15099 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15100 and fringe_bitmap_periodic_p.
15101
15102 * fringe.c (get_fringe_bitmap_data): New function.
15103 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15104 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15105 row. Mark glyph row for fringe update if periodicity changed.
15106
15107 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15108 for fringe update unless it has periodic bitmap.
15109
15110 2011-05-25 Kenichi Handa <handa@m17n.org>
15111
15112 * xdisp.c (get_next_display_element): Set correct it->face_id for
15113 a static composition.
15114
15115 2011-05-24 Leo Liu <sdl.web@gmail.com>
15116
15117 * deps.mk (fns.o):
15118 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15119
15120 * fns.c (crypto_hash_function, Fsha1): New function.
15121 (Fmd5): Use crypto_hash_function.
15122 (syms_of_fns): Add Ssha1.
15123
15124 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15125
15126 * gnutls.c: Remove unused macros.
15127 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15128 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15129 Remove macros that are defined and never used.
15130 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15131
15132 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15133
15134 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15135 (Fx_get_selection_internal): Minor cleanup.
15136 (Fx_own_selection_internal): Rename arguments for consistency with
15137 select.el.
15138
15139 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15140
15141 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15142
15143 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15144
15145 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15146
15147 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15148
15149 * dispnew.c (scrolling_window): Don't exclude the case that the
15150 last enabled row in the desired matrix touches the bottom boundary.
15151
15152 2011-05-21 Glenn Morris <rgm@gnu.org>
15153
15154 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15155 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15156 and add some more files.
15157
15158 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15159
15160 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15161 report_file_error introduced by the change from 2011-05-07.
15162
15163 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15164
15165 * systime.h (Time): Define only if emacs is defined.
15166 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15167 where the include path doesn't have X11/X.h by default. See
15168 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15169
15170 2011-05-20 Kenichi Handa <handa@m17n.org>
15171
15172 * composite.c (find_automatic_composition): Fix previous change.
15173
15174 2011-05-20 Glenn Morris <rgm@gnu.org>
15175
15176 * lisp.mk: New file, split from Makefile.in.
15177 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15178 (shortlisp): Remove.
15179 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15180
15181 2011-05-19 Glenn Morris <rgm@gnu.org>
15182
15183 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15184 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15185 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15186 (lisp): Set the order to that of loadup.el.
15187 (shortlisp): Make it a copy of $lisp.
15188 (SOME_MACHINE_LISP): Remove.
15189 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15190 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15191
15192 2011-05-18 Kenichi Handa <handa@m17n.org>
15193
15194 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15195 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15196 (find_automatic_composition): Mostly rewrite for efficiency.
15197
15198 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
15199
15200 * makefile.w32-in: Update dependencies.
15201
15202 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15203
15204 * menu.c: Include limits.h (fixes the MS-Windows build broken by
15205 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15206
15207 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
15208
15209 Fix some integer overflow issues, such as string length overflow.
15210
15211 * insdel.c (count_size_as_multibyte): Check for string overflow.
15212
15213 * character.c (lisp_string_width): Check for string overflow.
15214 Use EMACS_INT, not int, for string indexes and lengths; in
15215 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15216 the resulting string length overflows an EMACS_INT; instead,
15217 report a string overflow if no precision given. When checking for
15218 precision exhaustion, use a check that cannot possibly have
15219 integer overflow. (Bug#8675)
15220 * character.h (lisp_string_width): Adjust to new signature.
15221
15222 * alloc.c (string_overflow): New function.
15223 (Fmake_string): Use it. This doesn't change behavior, but saves
15224 a few bytes and will simplify future changes.
15225 * character.c (string_escape_byte8): Likewise.
15226 * lisp.h (string_overflow): New decl.
15227
15228 Fixups, following up to the user-interface timestamp change.
15229 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15230 for UI timestamps, instead of unsigned long.
15231 * msdos.c (mouse_get_pos): Likewise.
15232 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15233 * w32gui.h (Time): Define by including "systime.h" rather than by
15234 declaring it ourselves. (Bug#8664)
15235
15236 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15237 * image.c (clear_image_cache): Likewise.
15238
15239 * term.c (term_mouse_position): Don't assume time_t wraparound.
15240
15241 Be more systematic about user-interface timestamps.
15242 Before, the code sometimes used 'Time', sometimes 'unsigned long',
15243 and sometimes 'EMACS_UINT', to represent these timestamps.
15244 This change causes it to use 'Time' uniformly, as that's what X uses.
15245 This makes the code easier to follow, and makes it easier to catch
15246 integer overflow bugs such as Bug#8664.
15247 * frame.c (Fmouse_position, Fmouse_pixel_position):
15248 Use Time, not unsigned long, for user-interface timestamps.
15249 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15250 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15251 * keyboard.h (last_event_timestamp): Likewise.
15252 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15253 * menu.h (xmenu_show): Likewise.
15254 * term.c (term_mouse_position): Likewise.
15255 * termhooks.h (struct input_event.timestamp): Likewise.
15256 (struct terminal.mouse_position_hook): Likewise.
15257 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15258 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15259 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15260 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15261 what it was before.
15262 * menu.h, termhooks.h: Include "systime.h", for Time.
15263
15264 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15265 Don't assume that the difference between two unsigned long values
15266 can fit into an integer. At this point, we know button_down_time
15267 <= event->timestamp, so the difference must be nonnegative, so
15268 there's no need to cast the result if double-click-time is
15269 nonnegative, as it should be; check that it's nonnegative, just in
15270 case. This bug is triggered when events are more than 2**31 ms
15271 apart (about 25 days). (Bug#8664)
15272
15273 * xselect.c (last_event_timestamp): Remove duplicate decl.
15274 (x_own_selection): Remove needless cast to unsigned long.
15275
15276 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15277 that always fit in int. Use a sentinel instead of a counter, to
15278 avoid a temp and to allay GCC's concerns about possible int overflow.
15279 * frame.h (struct frame): Use int for menu_bar_items_used
15280 instead of EMACS_INT, since it always fits in int.
15281
15282 * menu.c (grow_menu_items): Check for int overflow.
15283
15284 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15285
15286 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15287 Before, the code was not consistent. These values cannot exceed
15288 2**31 - 1 so there's no need to make them unsigned.
15289 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15290 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15291 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15292 as modifiers.
15293 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15294
15295 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15296 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15297 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15298 presumably because the widths might not match.
15299
15300 * window.c (size_window): Avoid needless test at loop start.
15301
15302 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15303
15304 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15305
15306 2011-05-12 Drew Adams <drew.adams@oracle.com>
15307
15308 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15309
15310 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15311
15312 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15313 `width' to `bar_area_x' and `bar_area_width', respectively.
15314 (x_scroll_run): Take account of fringe background extension.
15315
15316 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15317 Rename local vars `left' and `width' to `bar_area_x' and
15318 `bar_area_width', respectively.
15319 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15320 background extension.
15321
15322 2011-05-10 Jim Meyering <meyering@redhat.com>
15323
15324 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15325
15326 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
15327
15328 * image.c (Finit_image_library): Return t for built-in image types,
15329 like pbm and xbm. (Bug#8640)
15330
15331 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15332
15333 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15334
15335 2011-05-07 Eli Zaretskii <eliz@gnu.org>
15336
15337 * w32console.c (Fset_screen_color): Doc fix.
15338 (Fget_screen_color): New function.
15339 (syms_of_ntterm): Defsubr it.
15340
15341 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15342 unlink the temporary file if Fcall_process didn't create it in the
15343 first place.
15344 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15345 child process will be redirected to a file specified with `:file'.
15346 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15347 cue to call_process_cleanup not to close that handle.
15348
15349 2011-05-07 Ben Key <bkey76@gmail.com>
15350
15351 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15352 one of two shell specific rules, either bootstrap-temacs-CMD or
15353 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15354 to the previous implementation of the bootstrap-temacs rule.
15355 The bootstrap-temacs-CMD rule is similar to the previous
15356 implementation of the bootstrap-temacs rule except that it
15357 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15358 variable.
15359
15360 These changes, along with some changes to nt/configure.bat,
15361 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15362 earlier fix to add support for --cflags and --ldflags options
15363 that include quotes so that it works whether make uses cmd or
15364 sh as the shell.
15365
15366 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
15367
15368 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15369 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15370 is a constant.
15371 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15372 a string. Handle both cases.
15373 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15374 (Fdbus_register_method): Use Qinvalid_function.
15375
15376 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15377
15378 * makefile.w32-in: Update dependencies.
15379 (LISP_H): Add inttypes.h and stdin.h.
15380 (PROCESS_H): Add unistd.h.
15381
15382 2011-05-06 Eli Zaretskii <eliz@gnu.org>
15383
15384 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15385 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15386
15387 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
15388
15389 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15390
15391 * term.c (vfatal): Remove stray call to va_end.
15392 It's not needed and the C Standard doesn't allow it here anyway.
15393
15394 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15395 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15396
15397 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15398 bytes.
15399
15400 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15401
15402 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15403
15404 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15405
15406 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15407
15408 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15409
15410 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15411 * charset.c (Fdefine_charset_internal): Don't initialize
15412 charset.code_space[15]. The value was garbage, on hosts with
15413 32-bit int (Bug#8600).
15414
15415 * lread.c (read_integer): Be more consistent with string-to-number.
15416 Use string_to_number to do the actual conversion; this avoids
15417 rounding errors and fixes some other screwups. Without this fix,
15418 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15419 (digit_to_number): Move earlier, for benefit of read_integer.
15420 Return -1 if the digit is out of range for the base, -2 if it is
15421 not a digit in any supported base. (Bug#8602)
15422
15423 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15424
15425 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15426 to match comment at start of function. This also removes a
15427 GCC warning about overflow in a 32+64-bit port.
15428
15429 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15430
15431 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15432 Reported by Stefan Monnier in
15433 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15434 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15435 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15436
15437 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15438 (EMACS_UINTPTR): Likewise, with uintptr_t.
15439
15440 * lisp.h: Prefer 64-bit EMACS_INT if available.
15441 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15442 on 32-bit hosts that have 64-bit int, so that they can access
15443 large files.
15444 However, temporarily disable this change unless the temporary
15445 symbol WIDE_EMACS_INT is defined.
15446
15447 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15448
15449 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15450 This removes an assumption that EMACS_INT and long are the same
15451 width as pointers. The assumption is true for Emacs porting targets
15452 now, but we want to make other targets possible.
15453 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15454 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15455 In the rest of the code, change types of integers that hold casted
15456 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15457 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15458 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15459 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15460 No need to cast type when ORing.
15461 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15462 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15463 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15464 assume EMACS_INT is the same width as char *.
15465 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15466 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15467 Remove no-longer-needed casts.
15468 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15469 (xg_tool_bar_help_callback, xg_make_tool_item):
15470 Use EMACS_INTPTR to hold an integer
15471 that will be cast to void *; this can avoid a GCC warning
15472 if EMACS_INT is not the same width as void *.
15473 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15474 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15475 (current_message_1, set_message_1):
15476 Use a local to convert to proper width without a cast.
15477 * xmenu.c (dialog_selection_callback): Likewise.
15478
15479 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15480 Also, don't assume VALBITS / RAND_BITS is less than 5,
15481 and don't rely on undefined behavior when shifting a 1 left into
15482 the sign bit.
15483 * lisp.h (get_random): Change signature to match.
15484
15485 * lread.c (hash_string): Use size_t, not int, for hash computation.
15486 Normally we prefer signed values; but hashing is special, because
15487 it's better to use unsigned division on hash table sizes so that
15488 the remainder is nonnegative. Also, size_t is the natural width
15489 for hashing into memory. The previous code used 'int', which doesn't
15490 retain enough info to hash well into very large tables.
15491 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15492
15493 * dbusbind.c: Don't possibly lose pointer info when converting.
15494 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15495 Use XPNTR rather than XHASH, so that the high-order bits of
15496 the pointer aren't lost when converting through void *.
15497
15498 * eval.c (Fautoload): Don't double-shift a pointer.
15499
15500 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15501
15502 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15503
15504 * gnutls.c (DEF_GNUTLS_FN):
15505 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15506
15507 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15508
15509 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15510 marker. (Bug#8610)
15511
15512 2011-05-05 Eli Zaretskii <eliz@gnu.org>
15513
15514 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15515 New version that can reserve upto 2GB of heap space.
15516
15517 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
15518
15519 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15520
15521 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15522
15523 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15524 `gnutls_certificate_set_x509_key_file'.
15525
15526 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
15527
15528 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15529 Update dependencies.
15530
15531 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15532
15533 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15534 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15535 Remove unused parameter `fildes'.
15536 * process.c (read_process_output, send_process): Don't pass it.
15537
15538 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15539
15540 Fix previous change: the library cache is defined in w32.c.
15541 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15542 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15543
15544 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15545
15546 Implement dynamic loading of GnuTLS on Windows.
15547
15548 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15549 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15550 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15551 Declare.
15552
15553 * gnutls.c (Qgnutls_dll): Define.
15554 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15555 (gnutls_*): Declare function pointers.
15556 (init_gnutls_functions): New function to initialize function pointers.
15557 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15558 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15559 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15560 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15561 (emacs_gnutls_write, emacs_gnutls_read)
15562 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15563 (Fgnutls_available_p): New function.
15564 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15565 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15566 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15567
15568 * image.c: Include w32.h.
15569 (Vimage_type_cache): Delete.
15570 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15571 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15572 (w32_delayed_load): Move to w32.c.
15573
15574 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15575
15576 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15577 (w32_delayed_load): Move from image.c. When loading a library, record
15578 its filename in the :loaded-from property of the library id.
15579 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15580 Initialize and staticpro them.
15581 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15582
15583 * process.c: Include lisp.h before w32.h, not after.
15584 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15585 instead of gnutls_record_check_pending.
15586
15587 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15588
15589 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15590
15591 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15592 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15593 as passed in.
15594
15595 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15596
15597 * xterm.c (x_set_frame_alpha): Do not set property on anything
15598 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15599
15600 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15601
15602 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15603
15604 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15605
15606 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15607 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15608 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15609 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15610 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15611 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15612 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15613 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15614 (Qgnutls_bootprop_callbacks_verify): Make static.
15615
15616 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15617
15618 * callproc.c: Indentation fixup.
15619
15620 * sysdep.c (wait_for_termination_1): Make static.
15621 (wait_for_termination, interruptible_wait_for_termination):
15622 Move after wait_for_termination_1.
15623
15624 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15625
15626 * sysdep.c (interruptible_wait_for_termination): New function
15627 which is like wait_for_termination, but allows keyboard
15628 interruptions.
15629
15630 * callproc.c (Fcall_process): Add (:file "file") as an option for
15631 the STDOUT buffer.
15632 (Fcall_process_region): Ditto.
15633
15634 2011-04-30 Eli Zaretskii <eliz@gnu.org>
15635
15636 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15637 rather than `XVECTOR (FOO)->size'.
15638
15639 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15640 inttypes.h, as a gnulib replacement is used if it not available in
15641 system headers.
15642
15643 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15644
15645 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15646 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15647 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15648
15649 * coding.c (coding_alloc_by_realloc): Error out if destination
15650 will grow beyond MOST_POSITIVE_FIXNUM.
15651 (decode_coding_emacs_mule): Abort if there isn't enough place in
15652 charbuf for the composition carryover bytes. Reserve an extra
15653 space for up to 2 characters produced in a loop.
15654 (decode_coding_iso_2022): Abort if there isn't enough place in
15655 charbuf for the composition carryover bytes.
15656
15657 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15658
15659 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15660 aborting when %lld or %lll format is passed.
15661 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15662 %llo or %llx format is passed. (Bug#8545)
15663
15664 * window.c (window_scroll_line_based): Use a marker instead of
15665 simple variables to record original value of point. (Bug#7952)
15666
15667 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15668 produced by %s or %c overflows available buffer space. (Bug#8545)
15669
15670 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15671
15672 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15673 (SIZE_MAX): Move defn after all includes, as they might #define it.
15674
15675 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15676
15677 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15678
15679 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15680
15681 * keyboard.c (Qdelayed_warnings_hook): Define.
15682 (command_loop_1): Run `delayed-warnings-hook'
15683 if Vdelayed_warnings_list is non-nil.
15684 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15685 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15686
15687 2011-04-28 Eli Zaretskii <eliz@gnu.org>
15688
15689 * doprnt.c (doprnt): Don't return value smaller than the buffer
15690 size if the message was truncated. (Bug#8545).
15691
15692 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15693
15694 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15695 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15696
15697 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15698
15699 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15700
15701 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
15702
15703 * makefile.w32-in: Update dependencies.
15704
15705 2011-04-27 Eli Zaretskii <eliz@gnu.org>
15706
15707 Improve `doprnt' and its usage. (Bug#8545)
15708 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15709 `format_end'. Remove support for %l as a conversion specifier.
15710 Don't use xrealloc. Improve diagnostics when the %l size modifier
15711 is used. Update the commentary.
15712
15713 * eval.c (verror): Simplify calculation of size_t.
15714
15715 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15716 messages.
15717
15718 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15719
15720 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15721 change.
15722
15723 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15724
15725 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15726 This makes this file independent of the recent pseudovector change.
15727
15728 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
15729
15730 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15731
15732 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15733 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15734 Remove unused local.
15735 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15736
15737 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
15738 GCC 4.6.0 optimizes based on type-based alias analysis.
15739 For example, if b is of type struct buffer * and v of type struct
15740 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15741 != &v->size, and therefore "v->size = 1; b->size = 2; return
15742 v->size;" must therefore return 1. This assumption is incorrect
15743 for Emacs, since it type-puns struct Lisp_Vector * with many other
15744 types. To fix this problem, this patch adds a new type struct
15745 vectorlike_header that documents the constraints on layout of vectors
15746 and pseudovectors, and helps optimizing compilers not get fooled
15747 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15748 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15749 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15750 the size member.
15751 (XSETPVECTYPE): Rewrite in terms of new macro.
15752 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15753 This is a bit clearer, and further avoids the possibility of
15754 undesirable aliasing.
15755 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15756 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15757 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15758 since Lisp_Subr is a special case (no "next" field).
15759 (ASIZE): Now uses header.size rather than size.
15760 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15761 to avoid the hassle of writing XVECTOR (foo)->header.size.
15762 (struct vectorlike_header): New type.
15763 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15764 object, to help avoid aliasing.
15765 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15766 (SUBRP): Likewise, since Lisp_Subr is a special case.
15767 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15768 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15769 (struct Lisp_Hash_Table): Combine first two members into a single
15770 struct vectorlike_header member. All uses of "size" and "next" members
15771 changed to be "header.size" and "header.next".
15772 * buffer.h (struct buffer): Likewise.
15773 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15774 * frame.h (struct frame): Likewise.
15775 * process.h (struct Lisp_Process): Likewise.
15776 * termhooks.h (struct terminal): Likewise.
15777 * window.c (struct save_window_data, struct saved_window): Likewise.
15778 * window.h (struct window): Likewise.
15779 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15780 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15781 * buffer.c (init_buffer_once): Likewise.
15782 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15783 special case.
15784 * process.c (Fformat_network_address): Use local var for size,
15785 for brevity.
15786
15787 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15788
15789 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15790 * data.c (atof): Remove decl; no longer used or needed.
15791 (digit_to_number): Move to lread.c.
15792 (Fstring_to_number): Use new string_to_number function, to be
15793 consistent with how the Lisp reader treats infinities and NaNs.
15794 Do not assume that floating-point numbers represent EMACS_INT
15795 without losing information; this is not true on most 64-bit hosts.
15796 Avoid double-rounding errors, by insisting on integers when
15797 parsing non-base-10 numbers, as the documentation specifies.
15798 * lisp.h (string_to_number): New decl, replacing ...
15799 (isfloat_string): Remove.
15800 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15801 (read1): Do not accept +. and -. as integers; this
15802 appears to have been a coding error. Similarly, do not accept
15803 strings like +-1e0 as floating point numbers. Do not report
15804 overflow for integer overflows unless the base is not 10 which
15805 means we have no simple and reliable way to continue.
15806 Break out the floating-point parsing into a new
15807 function string_to_number, so that Fstring_to_number parses
15808 floating point numbers consistently with the Lisp reader.
15809 (digit_to_number): Move here from data.c. Make it static inline.
15810 (E_CHAR, EXP_INT): Remove, replacing with ...
15811 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15812 (string_to_number): New function, replacing isfloat_string.
15813 This function checks for valid syntax and produces the resulting
15814 Lisp float number too. Rework it so that string-to-number
15815 no longer mishandles examples like "1.0e+". Use strtoumax,
15816 so that overflow for non-base-10 numbers is reported only when
15817 there's no portable and simple way to convert to floating point.
15818
15819 * textprop.c (set_text_properties_1): Rewrite for clarity,
15820 and to avoid GCC warning about integer overflow.
15821
15822 * intervals.h (struct interval): Use EMACS_INT for members
15823 where EMACS_UINT might cause problems. See
15824 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15825 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15826 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15827 All uses changed.
15828 (offset_intervals): Tell GCC not to worry about length overflow
15829 when negating a negative length.
15830
15831 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15832 (overrun_check_free): Likewise.
15833
15834 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15835 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15836 word size.
15837
15838 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15839 (gnutls_make_error): Rename local to avoid shadowing.
15840 (gnutls_emacs_global_deinit): ifdef out; not used.
15841 (Fgnutls_boot): Use const for pointer to readonly storage.
15842 Comment out unused local. Fix pointer signedness problems.
15843
15844 * lread.c (openp): Don't stuff size_t into an 'int'.
15845 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15846 about possible signed overflow.
15847
15848 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15849 (GDK_KEY_g): Don't define if already defined.
15850 (xg_prepare_tooltip): Avoid pointer signedness problem.
15851 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15852
15853 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15854 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15855
15856 * xfns.c (Fx_window_property): Simplify a bit,
15857 to make a bit faster and to avoid GCC 4.6.0 warning.
15858 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15859
15860 * fns.c (internal_equal): Don't assume size_t fits in int.
15861
15862 * alloc.c (compact_small_strings): Tighten assertion a little.
15863
15864 Replace pEd with more-general pI, and fix some printf arg casts.
15865 * lisp.h (pI): New macro, generalizing old pEd macro to other
15866 conversion specifiers. For example, use "...%"pI"d..." rather
15867 than "...%"pEd"...".
15868 (pEd): Remove. All uses replaced with similar uses of pI.
15869 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15870 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15871 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15872 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15873 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15874 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15875 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15876 64-bit hosts.
15877 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15878 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15879 * print.c (safe_debug_print, print_object): Likewise.
15880 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15881 to int.
15882 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15883 avoiding the 0 flag, which is not portable.
15884 * process.c (Fmake_network_process): Use pI to avoid cast.
15885 * region-cache.c (pp_cache): Likewise.
15886 * xdisp.c (decode_mode_spec): Likewise.
15887 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15888 behavior on 64-bit hosts with printf arg.
15889 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15890 (x_stop_queuing_selection_requests): Likewise.
15891 (x_get_window_property): Don't truncate byte count to an 'int'
15892 when tracing.
15893
15894 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15895 here, since it parses constructs like leading '-' and spaces,
15896 which are not wanted; and it overflows with large numbers.
15897 Instead, simply match F[0-9]+, which is what is wanted anyway.
15898
15899 * alloc.c: Remove unportable assumptions about struct layout.
15900 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15901 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15902 (allocate_vectorlike, make_pure_vector): Use the new macros,
15903 plus offsetof, to remove unportable assumptions about struct layout.
15904 These assumptions hold on all porting targets that I know of, but
15905 they are not guaranteed, they're easy to remove, and removing them
15906 makes further changes easier.
15907
15908 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15909 This doesn't fix a bug but makes the code clearer.
15910 (string_overrun_cookie): Now const. Use initializers that
15911 don't formally overflow signed char, to avoid warnings.
15912 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15913 can cause Emacs to crash when string overrun checking is enabled.
15914 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15915 multiple of sizeof (EMACS_INT); it need not be, if
15916 alignof(EMACS_INT) < sizeof (EMACS_INT).
15917 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15918
15919 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
15920
15921 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15922
15923 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15924
15925 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15926 supposed to be handshaking. (Bug#8556)
15927 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15928
15929 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15930
15931 * lisp.h (Qdebug): List symbol.
15932 * eval.c (Qdebug): Restore global linkage.
15933 * keyboard.c (debug-on-event): New variable.
15934 (handle_user_signal): Break into debugger when debug-on-event
15935 matches the current signal symbol.
15936
15937 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15938
15939 * alloc.c (check_sblock, check_string_bytes)
15940 (check_string_free_list): Convert to standard C.
15941
15942 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15943
15944 * w32.c (emacs_gnutls_push): Fix typo.
15945
15946 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15947
15948 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15949 "cast to pointer from integer of different size".
15950
15951 Improve doprnt and its use in verror. (Bug#8545)
15952 * doprnt.c (doprnt): Document the set of format control sequences
15953 supported by the function. Use SAFE_ALLOCA instead of always
15954 using `alloca'.
15955
15956 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15957 is one byte too soon. Don't use xrealloc; instead xfree and
15958 xmalloc anew.
15959
15960 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15961
15962 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15963 callbacks stage.
15964
15965 * gnutls.c: Renamed global_initialized to
15966 gnutls_global_initialized. Added internals for the
15967 :verify-hostname-error, :verify-error, and :verify-flags
15968 parameters of `gnutls-boot' and documented those parameters in the
15969 docstring. Start callback support.
15970 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15971 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15972 on error. Return error code.
15973 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15974 (emacs_gnutls_read): Likewise.
15975 (Fgnutls_boot): Return handshake error code.
15976 (emacs_gnutls_handle_error): New function.
15977 (wsaerror_to_errno): Likewise.
15978
15979 * w32.h (emacs_gnutls_pull): Add prototype.
15980 (emacs_gnutls_push): Likewise.
15981
15982 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15983 (emacs_gnutls_push): Likewise.
15984
15985 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15986
15987 * process.c (wait_reading_process_output): Check if GnuTLS
15988 buffered some data internally if no FDs are set for TLS
15989 connections.
15990
15991 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15992 (LIBS): Link to USER_LIBS.
15993 ($(BLD)/gnutls.$(0)): New target.
15994
15995 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15996
15997 * xdisp.c (handle_single_display_spec): Rename the
15998 display_replaced_before_p argument into display_replaced_p, to
15999 make it consistent with the commentary. Fix typos in the
16000 commentary.
16001
16002 * textprop.c (syms_of_textprop): Remove dead code.
16003 (copy_text_properties): Delete obsolete commentary about an
16004 interface that was deleted long ago. Fix typos in the description
16005 of arguments.
16006
16007 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16008 to changes in oldXMenu/XMenu.h from 2011-04-16.
16009 <menu_help_message, prev_menu_help_message>: Constify.
16010 (IT_menu_make_room): menu->help_text is now `const char **';
16011 adjust.
16012
16013 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16014 to changes in oldXMenu/XMenu.h from 2011-04-16.
16015 (struct XMenu): Declare `help_text' `const char **'.
16016
16017 * xfaces.c <Qunspecified>: Make extern again.
16018
16019 * syntax.c: Include sys/types.h before including regex.h, as
16020 required by POSIX.
16021
16022 * doc.c (get_doc_string): Improve the format passed to `error'.
16023
16024 * doprnt.c (doprnt): Improve commentary.
16025
16026 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16027
16028 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16029 them with etags.
16030
16031 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16032 changes in globals.h immediately force recompilation.
16033 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16034 $(CURDIR)/s/ms-w32.h.
16035 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16036
16037 * character.c (Fchar_direction): Function deleted.
16038 (syms_of_character): Don't defsubr it.
16039 <char-direction-table>: Deleted.
16040
16041 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16042
16043 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16044 * doprnt.c: Include limits.h.
16045 (SIZE_MAX): New macro.
16046 (doprnt): Return a size_t value. 2nd arg is now size_t.
16047 Many local variables are now size_t instead of int or unsigned.
16048 Improve overflow protection. Support `l' modifier for integer
16049 conversions. Support %l conversion. Don't assume an EMACS_INT
16050 argument for integer conversions and for %c.
16051
16052 * lisp.h (doprnt): Restore prototype.
16053
16054 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16055 $(SRC)/character.h.
16056
16057 * Makefile.in (base_obj): Add back doprnt.o.
16058
16059 * deps.mk (doprnt.o): Add back prerequisites.
16060 (callint.o): Depend on character.h.
16061
16062 * eval.c (internal_lisp_condition_case): Include the handler
16063 representation in the error message.
16064 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16065 when breaking from the loop.
16066
16067 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16068
16069 * callint.c (Fcall_interactively): When displaying error message
16070 about invalid control letter, pass the character's codepoint, not
16071 a pointer to its multibyte form. Improve display of the character
16072 in octal and display also its hex code.
16073
16074 * character.c (char_string): Use %x to display the (unsigned)
16075 codepoint of an invalid character, to avoid displaying a bogus
16076 negative value.
16077
16078 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16079 `error', not SYMBOL_NAME itself.
16080
16081 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16082 character arguments to `error'.
16083
16084 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16085 to `error' in error message about FINAL_CHAR argument. Make sure
16086 FINAL_CHAR is a character, and use %c when it is passed as
16087 argument to `error'.
16088
16089 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16090
16091 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16092
16093 * w32.c: Include <time.h>.
16094 (sys_localtime): New function.
16095
16096 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
16097
16098 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16099
16100 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16101
16102 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
16103
16104 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16105 zombies (Bug#8467).
16106
16107 2011-04-19 Eli Zaretskii <eliz@gnu.org>
16108
16109 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16110 gl_state.e_property when gl_state.object is Qt.
16111
16112 * insdel.c (make_gap_larger): Remove limitation of buffer size
16113 to <= INT_MAX.
16114
16115 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
16116
16117 * xdisp.c (lookup_glyphless_char_display)
16118 (produce_glyphless_glyph): Handle cons cell entry in
16119 glyphless-char-display.
16120 (Vglyphless_char_display): Document it.
16121
16122 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16123 glyphless-char-display.
16124
16125 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
16126
16127 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16128
16129 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16130
16131 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16132 definition for no-X builds.
16133
16134 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
16135
16136 Static checks with GCC 4.6.0 and non-default toolkits.
16137
16138 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16139
16140 * process.c (keyboard_bit_set): Define only if SIGIO.
16141 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16142 (send_process): Repair possible setjmp clobbering.
16143
16144 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16145
16146 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16147
16148 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16149
16150 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16151 Define only if needed.
16152
16153 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16154 by pacifying GCC about it. Maybe it's time to retire it?
16155 * xfaces.c (USG, __TIMEVAL__): Likewise.
16156
16157 * dispextern.h (struct redisplay_interface): Rename param
16158 to avoid shadowing.
16159 * termhooks.h (struct terminal): Likewise.
16160 * xterm.c (xembed_send_message): Likewise.
16161
16162 * insdel.c (make_gap_smaller): Define only if
16163 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16164
16165 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16166 it.
16167
16168 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16169 so that we aren't warned about unused symbols.
16170
16171 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16172
16173 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16174
16175 * xfns.c (x_real_positions): Mark locals as initialized.
16176
16177 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16178
16179 * xterm.c: Fix problems found by static analysis with other toolkits.
16180 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16181 (x_dispatch_event): Declare static if USE_GTK, and
16182 define if USE_GTK || USE_X_TOOLKIT.
16183 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16184 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16185 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16186 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16187
16188 * xmenu.c (menu_help_callback): Pointer type fixes.
16189 Use const pointers when pointing at readonly data. Avoid pointer
16190 signedness clashes.
16191 (FALSE): Remove unused macro.
16192 (update_frame_menubar): Remove unused decl.
16193
16194 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16195
16196 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16197 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16198 (single_menu_item): Rename local to avoid shadowing.
16199
16200 * keyboard.c (make_lispy_event): Remove unused local var.
16201
16202 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16203 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16204
16205 * bitmaps: Change bitmaps from unsigned char back to the X11
16206 compatible char. Avoid the old compiler warnings about
16207 out-of-range initializers by using, for example, '\xab' rather
16208 than 0xab.
16209
16210 * xgselect.c (xgselect_initialize): Check vs interface
16211 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16212
16213 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16214
16215 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16216 to read-only memory.
16217
16218 * fns.c (vector): Remove; this old hack is no longer needed.
16219
16220 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16221 Remove unused var.
16222 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16223
16224 * xrdb.c (x_load_resources): Omit unused local.
16225
16226 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16227 (x_window): Rename locals to avoid shadowing.
16228 (USG): Use the kludged USG macro, to pacify gcc.
16229
16230 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16231 (x_term_init): Remove local to avoid shadowing.
16232
16233 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16234
16235 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16236 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16237
16238 2011-04-16 Eli Zaretskii <eliz@gnu.org>
16239
16240 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16241
16242 Fix regex.c, syntax.c and friends for buffers > 2GB.
16243 * syntax.h (struct gl_state_s): Declare character position members
16244 EMACS_INT.
16245
16246 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16247
16248 * textprop.c (verify_interval_modification, interval_of):
16249 Declare arguments EMACS_INT.
16250
16251 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16252 EMACS_INT.
16253
16254 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16255
16256 * indent.c (Fvertical_motion): Local variable it_start is now
16257 EMACS_INT.
16258
16259 * regex.c (re_match, re_match_2, re_match_2_internal)
16260 (bcmp_translate, regcomp, regexec, print_double_string)
16261 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16262 (re_compile_pattern, re_exec): Declare arguments and local
16263 variables `size_t' and `ssize_t' and return values `regoff_t', as
16264 appropriate.
16265 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16266 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16267 <compile_stack_type>: `size' and `avail' are now `size_t'.
16268
16269 * regex.h <regoff_t>: Use ssize_t, not int.
16270 (re_search, re_search_2, re_match, re_match_2): Arguments that
16271 specify buffer/string position and length are now ssize_t and
16272 size_t. Return type is regoff_t.
16273
16274 2011-04-16 Ben Key <bkey76@gmail.com>
16275
16276 * nsfont.m: Fixed bugs in ns_get_family and
16277 ns_descriptor_to_entity that were caused by using free to
16278 deallocate memory blocks that were allocated by xmalloc (via
16279 xstrdup). This caused Emacs to crash when compiled with
16280 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16281 --enable-checking=xmallocoverrun). xfree is now used to
16282 deallocate these memory blocks.
16283
16284 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
16285
16286 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16287
16288 emacs_write: Accept and return EMACS_INT for sizes.
16289 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16290 et seq.
16291 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16292 Accept and return EMACS_INT.
16293 (emacs_gnutls_write): Return the number of bytes written on
16294 partial writes.
16295 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16296 (emacs_read, emacs_write): Remove check for negative size, as the
16297 Emacs source code has been audited now.
16298 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16299 (emacs_read, emacs_write): Use it.
16300 * process.c (send_process): Adjust to the new signatures of
16301 emacs_write and emacs_gnutls_write. Do not attempt to store
16302 a byte offset into an 'int'; it might overflow.
16303 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16304
16305 * sound.c: Don't assume sizes fit in 'int'.
16306 (struct sound_device.period_size, alsa_period_size):
16307 Return EMACS_INT, not int.
16308 (struct sound_device.write, vox_write, alsa_write):
16309 Accept EMACS_INT, not int.
16310 (wav_play, au_play): Use EMACS_INT to store sizes and to
16311 record read return values.
16312
16313 2011-04-15 Ben Key <bkey76@gmail.com>
16314
16315 * keyboard.c (Qundefined): Don't declare static since it is used
16316 in nsfns.m.
16317 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16318 static since they are used in nsfont.m.
16319
16320 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16321
16322 * process.c (Qprocessp): Don't declare static.
16323 * lisp.h (Qprocessp): Declare again.
16324
16325 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
16326
16327 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16328
16329 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16330
16331 Improve C-level modularity by making more things 'static'.
16332
16333 Don't publish debugger-only interfaces to other modules.
16334 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16335 (verify_bytepos, count_markers): Move decls to the only modules
16336 that need them.
16337 * region-cache.h (pp_cache): Likewise.
16338 * window.h (check_all_windows): Likewise.
16339 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16340
16341 * sysdep.c (croak): Now static, if
16342 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16343 * syssignal.h (croak): Declare only if not static.
16344
16345 * alloc.c (refill_memory_reserve): Now static if
16346 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16347 * lisp.h (refill_memory_reserve): Declare only if not static.
16348
16349 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16350 Define only if USE_LUCID.
16351
16352 * xrdb.c (x_customization_string, x_rm_string): Now static.
16353
16354 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16355 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16356
16357 * xdisp.c (draw_row_with_mouse_face): Now static.
16358 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16359
16360 * window.h (check_all_windows): Mark externally visible.
16361
16362 * window.c (window_deletion_count): Now static.
16363
16364 * undo.c: Make symbols static if they're not exported.
16365 (last_undo_buffer, last_boundary_position, pending_boundary):
16366 Now static.
16367
16368 * textprop.c (interval_insert_behind_hooks): Now static.
16369 (interval_insert_in_front_hooks): Likewise.
16370
16371 * term.c: Make symbols static if they're not exported.
16372 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16373 (max_frame_lines, tty_set_terminal_modes):
16374 (tty_reset_terminal_modes, tty_turn_off_highlight):
16375 (get_tty_terminal): Now static.
16376 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16377 * termhooks.h (term_mouse_moveto): Do not declare if
16378 HAVE_WINDOW_SYSTEM.
16379 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16380 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16381
16382 * sysdep.c: Make symbols static if they're not exported.
16383 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16384 Now static.
16385 (sigprocmask_set, full_mask): Remove; unused.
16386 (wait_debugging): Mark as visible.
16387 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16388 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16389
16390 * syntax.c (syntax_temp): Define only if !__GNUC__.
16391
16392 * sound.c (current_sound_device, current_sound): Now static.
16393
16394 * search.c (searchbufs, searchbuf_head): Now static.
16395
16396 * scroll.c (scroll_cost): Remove; unused.
16397 * dispextern.h (scroll_cost): Remove decl.
16398
16399 * region-cache.h (pp_cache): Mark as externally visible.
16400
16401 * process.c: Make symbols static if they're not exported.
16402 (process_tick, update_tick, create_process, chan_process):
16403 (Vprocess_alist, proc_buffered_char, datagram_access):
16404 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16405 (deactivate_process): Mark defn as static, as well as decl.
16406 * lisp.h (create_process): Remove decl.
16407 * process.h (chan_process, Vprocess_alist): Remove decls.
16408
16409 * print.c: Make symbols static if they're not exported.
16410 (print_depth, new_backquote_output, being_printed, print_buffer):
16411 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16412 (print_interval, print_number_index, initial_stderr_stream):
16413 Now static.
16414 * lisp.h (Fprinc): Remove decl.
16415 (debug_output_compilation_hack): Mark as externally visible.
16416
16417 * sysdep.c (croak): Move decl from here to syssignal.h.
16418 * syssignal.h (croak): Put it here, so the API can be checked when
16419 'croak' is called from dissociate_if_controlling_tty.
16420
16421 * minibuf.c: Make symbols static if they're not exported.
16422 (minibuf_save_list, choose_minibuf_frame): Now static.
16423 * lisp.h (choose_minibuf_frame): Remove decl.
16424
16425 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16426
16427 * lread.c: Make symbols static if they're not exported.
16428 (read_objects, initial_obarray, oblookup_last_bucket_number):
16429 Now static.
16430 (make_symbol): Remove; unused.
16431 * lisp.h (initial_obarray, make_symbol): Remove decls.
16432
16433 * keyboard.c: Make symbols static if they're not exported.
16434 (single_kboard, recent_keys_index, total_keys, recent_keys):
16435 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16436 (this_single_command_key_start, echoing, last_auto_save):
16437 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16438 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16439 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16440 (Vlispy_mouse_stem, double_click_count):
16441 Now static.
16442 (force_auto_save_soon): Define only if SIGDANGER.
16443 (ignore_mouse_drag_p): Now static if
16444 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16445 (print_help): Remove; unused.
16446 (stop_character, last_timer_event): Mark as externally visible.
16447 * keyboard.h (ignore_mouse_drag_p): Declare only if
16448 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16449 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16450 * lisp.h (echoing): Remove decl.
16451 (force_auto_save_soon): Declare only if SIGDANGER.
16452 * xdisp.c (redisplay_window): Simplify code, to make it more
16453 obvious that ignore_mouse_drag_p is not accessed if !defined
16454 USE_GTK && !defined HAVE_NS.
16455
16456 * intervals.c: Make symbols static if they're not exported.
16457 (merge_properties_sticky, merge_interval_right, delete_interval):
16458 Now static.
16459 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16460
16461 * insdel.c: Make symbols static if they're not exported.
16462 However, leave prepare_to_modify_buffer alone. It's never
16463 called from outside this function, but that appears to be a bug.
16464 (combine_after_change_list, combine_after_change_buffer):
16465 (adjust_after_replace, signal_before_change): Now static.
16466 (adjust_after_replace_noundo): Remove; unused.
16467 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16468 (signal_before_change): Remove decls.
16469
16470 * indent.c (val_compute_motion, val_vmotion): Now static.
16471
16472 * image.c: Make symbols static if they're not exported.
16473 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16474 if USE_GTK.
16475 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16476 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16477
16478 * fringe.c (standard_bitmaps): Now static.
16479 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16480
16481 * frame.c: Make symbols static if they're not exported.
16482 (x_report_frame_params, make_terminal_frame): Now static.
16483 (get_frame_param): Now static, unless HAVE_NS.
16484 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16485 (x_get_resource_string): Remove; not used.
16486 * frame.h (make_terminal_frame, x_report_frame_params):
16487 (x_get_resource_string); Remove decls.
16488 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16489 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16490
16491 * font.c, fontset.c: Make symbols static if they're not exported.
16492 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16493 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16494 * font.c (font_close_object): Now static.
16495 * font.h (font_close_object): Remove.
16496 * fontset.c (FONTSET_OBJLIST): Remove.
16497 (free_realized_fontset) #if-0 the body, which does nothing.
16498 (face_suitable_for_char_p): #if-0, as it's never called.
16499 * fontset.h (face_suitable_for_char_p): Remove decl.
16500 * xfaces.c (face_at_string_position):
16501 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16502 since 0 is always ASCII.
16503
16504 * fns.c (weak_hash_tables): Now static.
16505
16506 * fileio.c: Make symbols static if they're not exported.
16507 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16508 (Vwrite_region_annotation_buffers): Now static.
16509
16510 * eval.c: Make symbols static if they're not exported.
16511 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16512 * lisp.h (backtrace_list): Remove decl.
16513
16514 * emacs.c: Make symbols static if they're not exported.
16515 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16516 (fatal_error_code, fatal_error_signal_hook, standard_args):
16517 Now static.
16518 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16519 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16520 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16521 * lisp.h (fatal_error_signal_hook): Remove decl.
16522 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16523
16524 * editfns.c: Move a (normally-unused) function to its only use.
16525 * editfns.c, lisp.h (get_operating_system_release): Remove.
16526 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16527 worth the hassle of breaking this out.
16528
16529 * xterm.c: Make symbols static if they're not exported.
16530 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16531 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16532 (x_destroy_window, x_delete_display):
16533 Now static.
16534 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16535 (x_mouse_leave): Remove; unused.
16536 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16537 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16538 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16539 Remove decls.
16540 (x_mouse_leave): Declare only if WINDOWSNT.
16541 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16542 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16543 USE_X_TOOLKIT.
16544
16545 * ftxfont.c: Make symbols static if they're not exported.
16546 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16547 HAVE_FREETYPE.
16548 * font.h (ftxfont_driver): Likewise.
16549
16550 * xfns.c: Make symbols static if they're not exported.
16551 (x_last_font_name, x_display_info_for_name):
16552 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16553 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16554 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16555 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16556 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16557 (last_show_tip_args): Now static.
16558 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16559 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16560 (x_screen_planes): Remove; unused.
16561 * dispextern.h (x_screen_planes): Remove decl.
16562
16563 * dispnew.c: Make symbols static if they're not exported.
16564 * dispextern.h (redraw_garbaged_frames, scrolling):
16565 (increment_row_positions): Remove.
16566 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16567 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16568 Now static.
16569 (redraw_garbaged_frames): Remove; unused.
16570
16571 * xfaces.c: Make symbols static if they're not exported.
16572 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16573 Remove decls.
16574 * xterm.h (defined_color): Remove decls.
16575 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16576 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16577 (menu_face_changed_default, defined_color, free_realized_face):
16578 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16579 (ascii_face_of_lisp_face): Remove; unused.
16580
16581 * xdisp.c: Make symbols static if they're not exported.
16582 * dispextern.h (scratch_glyph_row, window_box_edges):
16583 (glyph_to_pixel_coords, set_cursor_from_row):
16584 (get_next_display_element, set_iterator_to_next):
16585 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16586 (show_mouse_face): Remove decls
16587 * frame.h (message_buf_print): Likewise.
16588 * lisp.h (pop_message, set_message, check_point_in_composition):
16589 Likewise.
16590 * xterm.h (set_vertical_scroll_bar): Likewise.
16591 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16592 (message_buf_print, scratch_glyph_row, displayed_buffer):
16593 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16594 (get_next_display_element, show_mouse_face, window_box_edges):
16595 (frame_to_window_pixel_xy, check_point_in_composition):
16596 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16597 (glyph_to_pixel_coords): Remove; unused.
16598
16599 * dired.c (file_name_completion): Now static.
16600
16601 * dbusbind.c (xd_in_read_queued_messages): Now static.
16602
16603 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16604 * data.c (circular_list_error): Remove.
16605
16606 * commands.h (last_point_position, last_point_position_buffer):
16607 (last_point_position_window): Remove decls.
16608 * keyboard.c: Make these variables static.
16609
16610 * coding.h (coding, code_convert_region, encode_coding_gap):
16611 Remove decls.
16612 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16613 (iso_code_class, detect_coding, code_convert_region): Now static.
16614 (encode_coding_gap): Remove; unused.
16615
16616 * chartab.c (chartab_chars, chartab_bits): Now static.
16617
16618 * charset.h (charset_iso_8859_1): Remove decl.
16619 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16620 Now static.
16621
16622 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16623 * ccl.c (Vccl_program_table): Now static.
16624 (check_ccl_update): Remove; unused.
16625
16626 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16627 * category.h: ... from here.
16628 * category.c (check_category_table, set_category_set): Now static.
16629
16630 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16631 * lisp.h: Remove these decls.
16632
16633 * buffer.c (buffer_count): Remove unused var.
16634
16635 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16636 so that it's not optimized away.
16637 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16638 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16639 exported only to the debugger.
16640
16641 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16642 * atimer.h (run_all_atimers): Remove; not exported.
16643
16644 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16645 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16646 was inaccessible from Lisp.
16647 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16648 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16649
16650 alloc.c: Import and export fewer symbols, and remove unused items.
16651 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16652 is defined.
16653 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16654 it's not optimized away by whole-program optimization.
16655 (message_enable_multibyte, free_misc): Remove.
16656 (catchlist, handlerlist, mark_backtrace):
16657 Declare only if BYTE_MARK_STACK.
16658 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16659 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16660 (message_enable_multibyte): Remove decl.
16661 (free_misc, interval_free_list, float_block, float_block_index):
16662 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16663 (cons_free_list, last_marked_index):
16664 Now static.
16665 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16666 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16667 (mark_backtrace): Define only if BYTE_MARK_STACK.
16668 * xdisp.c (message_enable_multibyte): Now static.
16669
16670 Declare Lisp_Object Q* variables to be 'static' if not exported.
16671 This makes it easier for human readers (and static analyzers)
16672 to see whether these variables are used from other modules.
16673 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16674 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16675 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16676 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16677 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16678 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16679 * xmenu.c, xselect.c:
16680 Declare Q* vars static if they are not used in other modules.
16681 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16682 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16683 Remove decls of unexported vars.
16684 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16685
16686 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16687
16688 Make Emacs functions such as Fatom 'static' by default.
16689 This makes it easier for human readers (and static analyzers)
16690 to see whether these functions can be called from other modules.
16691 DEFUN now defines a static function. To make the function external
16692 so that it can be used in other C modules, use the new macro DEFUE.
16693 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16694 (Finit_image_library):
16695 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16696 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16697 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16698 Remove decls, since these functions are now static.
16699 (Funintern, Fget_internal_run_time): New decls, since these functions
16700 were already external.
16701
16702 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16703 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16704 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16705 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16706 * keyboard.c, keymap.c, lread.c:
16707 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16708 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16709 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16710 Mark functions with DEFUE instead of DEFUN,
16711 if they are used in other modules.
16712 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16713 decls for now-static functions.
16714 * buffer.h (Fdelete_overlay): Remove decl.
16715 * callproc.c (Fgetenv_internal): Mark as internal.
16716 * composite.c (Fremove_list_of_text_properties): Remove decl.
16717 (Fcomposition_get_gstring): New forward static decl.
16718 * composite.h (Fcomposite_get_gstring): Remove decl.
16719 * dired.c (Ffile_attributes): New forward static decl.
16720 * doc.c (Fdocumntation_property): New forward static decl.
16721 * eval.c (Ffetch_bytecode): New forward static decl.
16722 (Funintern): Remove extern decl; now in .h file where it belongs.
16723 * fileio.c (Fmake_symbolic_link): New forward static decl.
16724 * image.c (Finit_image_library): New forward static decl.
16725 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16726 * intervals.h (Fprevious_property_change):
16727 (Fremove_list_of_text_properties): Remove decls.
16728 * keyboard.c (Fthis_command_keys): Remove decl.
16729 (Fcommand_execute): New forward static decl.
16730 * keymap.c (Flookup_key): New forward static decl.
16731 (Fcopy_keymap): Now static.
16732 * keymap.h (Flookup_key): Remove decl.
16733 * process.c (Fget_process): New forward static decl.
16734 (Fprocess_datagram_address): Mark as internal.
16735 * syntax.c (Fsyntax_table_p): New forward static decl.
16736 (skip_chars): Remove duplicate decl.
16737 * textprop.c (Fprevious_property_change): New forward static decl.
16738 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16739 Now internal.
16740 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16741 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16742
16743 * editfns.c (Fformat): Remove unreachable code.
16744
16745 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16746
16747 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16748 change. (Bug#8496)
16749
16750 2011-04-13 Eli Zaretskii <eliz@gnu.org>
16751
16752 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16753 when at ZV. (Bug#8487)
16754
16755 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16756
16757 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16758 (Bug#8437)
16759 * keyboard.c (parse_tool_bar_item): Likewise.
16760 * sound.c (sound_cleanup, alsa_close): Likewise.
16761 * termcap.c (tgetent): Likewise.
16762 * xfns.c (x_default_font_parameter): Likewise.
16763 * xsettings.c (read_and_apply_settings): Likewise.
16764
16765 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16766 (overrun_check_free): Protoize.
16767
16768 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16769
16770 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16771 since callers should never pass a negative size.
16772 Change the signature to match that of plain 'read' and 'write'; see
16773 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16774 * lisp.h: Update prototypes of emacs_write and emacs_read.
16775
16776 2011-04-11 Eli Zaretskii <eliz@gnu.org>
16777
16778 * xdisp.c (redisplay_window): Don't try to determine the character
16779 position of the scroll margin if the window start point w->startp
16780 is outside the buffer's accessible region. (Bug#8468)
16781
16782 2011-04-10 Eli Zaretskii <eliz@gnu.org>
16783
16784 Fix write-region and its subroutines for buffers > 2GB.
16785 * fileio.c (a_write, e_write): Modify declaration of arguments and
16786 local variables to support buffers larger than 2GB.
16787 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16788
16789 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16790 argument, local variables, and return value.
16791
16792 * lisp.h: Update prototypes of emacs_write and emacs_read.
16793
16794 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16795
16796 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16797
16798 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16799
16800 Fix more problems found by GCC 4.6.0's static checks.
16801
16802 * xdisp.c (vmessage): Use a better test for character truncation.
16803
16804 * charset.c (load_charset_map): <, not <=, for optimization,
16805 and to avoid potential problems with integer overflow.
16806 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16807 * casetab.c (set_identity, shuffle): Likewise.
16808 * editfns.c (Fformat): Likewise.
16809 * syntax.c (skip_chars): Likewise.
16810
16811 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16812 This also lets GCC 4.6.0 generate slightly better loop code.
16813
16814 * callint.c (Fcall_interactively): <, not <=, for optimization.
16815 (Fcall_interactively): Count the number of arguments produced,
16816 not the number of arguments given. This is simpler and lets GCC
16817 4.6.0 generate slightly better code.
16818
16819 * ftfont.c: Distingish more carefully between FcChar8 and char.
16820 The previous code passed unsigned char * to a functions like
16821 strlen and xstrcasecmp that expect char *, which does not
16822 conform to the C standard.
16823 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16824 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16825 char * when the C standard requires it.
16826
16827 * keyboard.c (read_char): Remove unused var.
16828
16829 * eval.c: Port to Windows vsnprintf (Bug#8435).
16830 Include <limits.h>.
16831 (SIZE_MAX): Define if the headers do not.
16832 (verror): Do not give up if vsnprintf returns a negative count.
16833 Instead, grow the buffer. This ports to Windows vsnprintf, which
16834 does not conform to C99. Problem reported by Eli Zaretskii.
16835 Also, simplify the allocation scheme, by avoiding the need for
16836 calling realloc, and removing the ALLOCATED variable.
16837
16838 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16839
16840 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16841 But keep the doprint source code for now, as we might revamp it
16842 and use it again (Bug#8435).
16843 * lisp.h (doprnt): Remove.
16844 * Makefile.in (base_obj): Remove doprnt.o.
16845 * deps.mk (doprnt.o): Remove.
16846
16847 error: Print 32- and 64-bit integers portably (Bug#8435).
16848 Without this change, on typical 64-bit hosts error ("...%d...", N)
16849 was used to print both 32- and 64-bit integers N, which relied on
16850 undefined behavior.
16851 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16852 * lisp.h (error, verror): Mark as printf-like functions.
16853 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16854 Report overflow in size calculations when allocating printf buffer.
16855 Do not truncate output string at its first null byte.
16856 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16857 Truncate the output at a character boundary, since vsnprintf does not
16858 do that.
16859 * charset.c (check_iso_charset_parameter): Convert internal
16860 character to string before calling 'error', since %c now has the
16861 printf meaning.
16862 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16863 overflow when computing char to be passed to 'error'. Do not
16864 pass Lisp_Object to 'error'; pass the integer instead.
16865 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16866 formatted with plain %d.
16867
16868 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16869
16870 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16871
16872 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16873
16874 * xterm.c (x_catch_errors): Remove duplicate declaration.
16875
16876 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16877
16878 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16879
16880 2011-04-10 Jim Meyering <meyering@redhat.com>
16881
16882 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16883 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16884 return ssize_t not "int", and use size_t as the buffer length.
16885 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16886 * gnutls.h: Update declarations.
16887 * process.c (read_process_output): Use ssize_t, to match.
16888 (send_process): Likewise.
16889
16890 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16891
16892 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16893
16894 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16895
16896 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16897 Use unsigned char, to match FcChar8 type definition.
16898
16899 * xterm.c (handle_one_xevent):
16900 * xmenu.c (create_and_show_popup_menu):
16901 * xselect.c (x_decline_selection_request)
16902 (x_reply_selection_request): Avoid type-punned deref of X events.
16903
16904 2011-04-09 Eli Zaretskii <eliz@gnu.org>
16905
16906 Fix some uses of `int' instead of EMACS_INT.
16907 * search.c (string_match_1, fast_string_match)
16908 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16909 (scan_buffer, find_next_newline_no_quit)
16910 (find_before_next_newline, search_command, Freplace_match)
16911 (Fmatch_data): Make some `int' variables be EMACS_INT.
16912
16913 * xdisp.c (display_count_lines): 3rd argument and return value now
16914 EMACS_INT. All callers changed.
16915 (pint2hrstr): Last argument is now EMACS_INT.
16916
16917 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16918 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16919 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16920 (decode_coding_utf_16, decode_coding_emacs_mule)
16921 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16922 (decode_coding_ccl, decode_coding_charset)
16923 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16924 (decode_coding_iso_2022, decode_coding_emacs_mule)
16925 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16926 <char_offset, last_offset>: Declare EMACS_INT.
16927 (encode_coding_utf_8, encode_coding_utf_16)
16928 (encode_coding_emacs_mule, encode_invocation_designation)
16929 (encode_designation_at_bol, encode_coding_iso_2022)
16930 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16931 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16932 Declare EMACS_INT.
16933 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16934 (encode_invocation_designation): Last argument P_NCHARS is now
16935 EMACS_INT.
16936 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16937 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16938
16939 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16940 All users changed.
16941
16942 * ccl.c (Fccl_execute_on_string): Declare some variables
16943 EMACS_INT.
16944
16945 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16946
16947 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16948
16949 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16950
16951 * process.c (Fformat_network_address): Doc fix.
16952
16953 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16954
16955 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16956
16957 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16958
16959 * keyboard.c (read_char): Call Lisp function help-form-show,
16960 instead of using internal_with_output_to_temp_buffer.
16961 (Qhelp_form_show): New var.
16962 (syms_of_keyboard): Use DEFSYM macro.
16963
16964 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16965
16966 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16967
16968 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16969
16970 * process.c (Flist_processes): Remove to Lisp.
16971 (list_processes_1): Delete.
16972
16973 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16974
16975 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16976
16977 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16978
16979 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16980
16981 Fix more problems found by GCC 4.6.0's static checks.
16982
16983 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16984
16985 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16986
16987 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16988
16989 * xdisp.c (vmessage): Mark as a printf-like function.
16990
16991 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16992
16993 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16994
16995 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16996 printf-like functions.
16997 (tiff_load): Add casts to remove these marks before passing them
16998 to system-supplied API.
16999
17000 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17001
17002 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17003 This avoids several warnings with gcc -Wstrict-overflow.
17004 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17005 directly, rather than having caller test rule sign. This avoids
17006 some unnecessary tests.
17007 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17008 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17009 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17010
17011 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17012 (xfont_open): Avoid unnecessary tests.
17013
17014 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17015
17016 * composite.h, composite.c (composition_gstring_put_cache):
17017 Use EMACS_INT, not int, for length.
17018
17019 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17020 breaking out part of COMPOSITION_DECODE_RULE.
17021 (COMPOSITION_DECODE_RULE): Use it.
17022 * composite.c (get_composition_id): Remove unused local vars,
17023 by using the new macro.
17024
17025 * textprop.c (set_text_properties_1): Change while to do-while,
17026 since the condition is always true at first.
17027
17028 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17029 (interval_deletion_adjustment): Return unsigned value.
17030 All uses changed.
17031
17032 * process.c (list_processes_1, create_pty, read_process_output):
17033 (exec_sentinel): Remove vars that were set but not used.
17034 (create_pty): Remove unnecessary "volatile"s.
17035 (Fnetwork_interface_info): Avoid possibility of int overflow.
17036 (read_process_output): Do adaptive read buffering even if carryover.
17037 (read_process_output): Simplify nbytes computation if buffered.
17038
17039 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17040
17041 * syntax.c (scan_words): Remove var that was set but not used.
17042 (update_syntax_table): Use unsigned instead of int.
17043
17044 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17045 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17046 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17047
17048 * print.c (print_error_message): Avoid int overflow.
17049
17050 * font.c (font_list_entities): Redo for clarity,
17051 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17052
17053 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17054 (font_score): Avoid potential overflow in diff calculation.
17055
17056 * fns.c (substring_both): Remove var that is set but not used.
17057 (sxhash): Redo loop for clarity and to avoid wraparound warning.
17058
17059 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17060
17061 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17062 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17063 can always succeed if overflow has undefined behavior.
17064
17065 * search.c (boyer_moore, wordify): Remove vars set but not used.
17066 (wordify): Omit three unnecessary tests.
17067
17068 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17069 All callers changed. This avoids the need for an unused var.
17070
17071 * casefiddle.c (casify_region): Remove var that is set but not used.
17072
17073 * dired.c (file_name_completion): Remove var that is set but not used.
17074
17075 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17076
17077 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17078 (Finsert_file_contents): Remove unnecessary code checking fd.
17079
17080 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17081 Check for integer overflow on size calculations.
17082
17083 * buffer.c (Fprevious_overlay_change): Remove var that is set
17084 but not used.
17085
17086 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17087 Remove vars that are set but not used.
17088 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17089 (timer_check_2): Mark vars as initialized.
17090
17091 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17092
17093 * image.c (lookup_image): Remove var that is set but not used.
17094 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17095
17096 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17097 that are set but not used.
17098
17099 * xfns.c (make_invisible_cursor): Don't return garbage
17100 if XCreateBitmapFromData fails (Bug#8410).
17101
17102 * xselect.c (x_get_local_selection, x_handle_property_notify):
17103 Remove vars that are set but not used.
17104
17105 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17106 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17107
17108 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17109 Remove var that is set but not used.
17110 (scroll_bar_windows_size): Now size_t, not int.
17111 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17112 Check for overflow.
17113
17114 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17115 (map_tty_color) [!defined MSDOS]: Likewise.
17116
17117 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17118
17119 * coding.c: Remove vars that are set but not used.
17120 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17121 All callers changed.
17122 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17123 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17124 (decode_coding_charset): Remove vars that are set but not used.
17125
17126 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17127 that is set but not used.
17128
17129 * print.c (print_object): Remove var that is set but not used.
17130
17131 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17132 The gnulib version avoids calling malloc in the usual case,
17133 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17134 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17135 * filelock.c (current_lock_owner): Likewise.
17136 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17137 * sysdep.c: Include allocator.h, careadlinkat.h.
17138 (emacs_no_realloc_allocator): New static constant.
17139 (emacs_readlink): New function.
17140 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17141 ../lib/careadlinkat.h.
17142
17143 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17144
17145 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17146 first non-nil return value).
17147
17148 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17149
17150 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17151 if not defined (Bug#8403).
17152
17153 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17154
17155 * xdisp.c (display_count_lines): Remove parameter `start',
17156 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17157 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17158 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17159 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17160 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17161 and thereabouts. All callers changed.
17162 (get_per_char_metric): Remove parameter `f', unused since
17163 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17164
17165 2011-04-02 Jim Meyering <meyering@redhat.com>
17166
17167 do not dereference NULL upon failed strdup
17168 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17169 (ns_get_family): Likewise.
17170
17171 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17172
17173 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17174
17175 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17176
17177 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17178 later (Bug#8403).
17179
17180 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17181
17182 Add lexical binding.
17183
17184 * window.c (Ftemp_output_buffer_show): New fun.
17185 (Fsave_window_excursion):
17186 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17187
17188 * lread.c (lisp_file_lexically_bound_p): New function.
17189 (Fload): Bind Qlexical_binding.
17190 (readevalloop): Remove `evalfun' arg.
17191 Bind Qinternal_interpreter_environment.
17192 (Feval_buffer): Bind Qlexical_binding.
17193 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17194 Mark as dynamic.
17195 (syms_of_lread): Declare `lexical-binding'.
17196
17197 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17198
17199 * keyboard.c (eval_dyn): New fun.
17200 (menu_item_eval_property): Use it.
17201
17202 * image.c (parse_image_spec): Use Ffunctionp.
17203
17204 * fns.c (concat, mapcar1): Accept byte-code-functions.
17205
17206 * eval.c (Fsetq): Handle lexical vars.
17207 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17208 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17209 (FletX, Flet): Obey lexical binding.
17210 (Fcommandp): Handle closures.
17211 (Feval): New `lexical' arg.
17212 (eval_sub): New function extracted from Feval. Use it almost
17213 everywhere where Feval was used. Look up vars in lexical env.
17214 Handle closures.
17215 (Ffunctionp): Move from subr.el.
17216 (Ffuncall): Handle closures.
17217 (apply_lambda): Remove `eval_flags'.
17218 (funcall_lambda): Handle closures and new byte-code-functions.
17219 (Fspecial_variable_p): New function.
17220 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17221 but without exporting it to Lisp.
17222
17223 * doc.c (Fdocumentation, store_function_docstring):
17224 * data.c (Finteractive_form): Handle closures.
17225
17226 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17227 interactive spec.
17228
17229 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17230 New byte-codes.
17231 (exec_byte_code): New function extracted from Fbyte_code to handle new
17232 calling convention for byte-code-functions. Add new byte-codes.
17233
17234 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17235
17236 * alloc.c (Fmake_symbol): Init new `declared_special' field.
17237
17238 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17239
17240 * xdisp.c (redisplay_internal): Fix prototype.
17241
17242 2011-03-31 Eli Zaretskii <eliz@gnu.org>
17243
17244 * xdisp.c (SCROLL_LIMIT): New macro.
17245 (try_scrolling): Use it when setting scroll_limit.
17246 Limit scrolling to 100 screen lines.
17247 (redisplay_window): Even when falling back on "recentering",
17248 position point in the window according to scroll-conservatively,
17249 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17250
17251 (try_scrolling): When point is above the window, allow searching
17252 as far as scroll_max, or one screenful, to compute vertical
17253 distance from PT to the scroll margin position. This prevents
17254 try_scrolling from unnecessarily failing when
17255 scroll-conservatively is set to a value slightly larger than the
17256 window height. Clean up the case of PT below the margin at bottom
17257 of window: scroll_max can no longer be INT_MAX. When aggressive
17258 scrolling is in use, don't let point enter the opposite scroll
17259 margin as result of the scroll.
17260 (syms_of_xdisp) <scroll-conservatively>: Document the
17261 threshold of 100 lines for never-recentering scrolling.
17262
17263 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17264
17265 * dispextern.h (move_it_by_lines):
17266 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17267 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17268 (message_log_check_duplicate): Remove parameters `prev_bol' and
17269 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17270 (redisplay_internal): Remove parameter `preserve_echo_area',
17271 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17272
17273 * indent.c (Fvertical_motion):
17274 * window.c (window_scroll_pixel_based, Frecenter):
17275 Don't pass `need_y_p' to `move_it_by_lines'.
17276
17277 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17278
17279 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17280 steal a few bits to be more compact.
17281 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17282 Remove unneeded casts.
17283
17284 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17285
17286 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17287
17288 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17289 binding" message (bug#7967).
17290
17291 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17292
17293 Fix more problems found by GCC 4.6.0's static checks.
17294
17295 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17296 Remove unused local var.
17297
17298 * editfns.c (Fmessage_box): Remove unused local var.
17299
17300 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17301 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17302 Omit unused local vars.
17303 * window.c (shrink_windows): Omit unused local var.
17304 * menu.c (digest_single_submenu): Omit unused local var.
17305 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17306 Omit unused local var.
17307
17308 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17309 Don't assume string length fits in int.
17310 (keyremap_step, read_key_sequence): Use size_t for sizes.
17311 (read_key_sequence): Don't check last_real_key_start redundantly.
17312
17313 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17314 instead of alloca (Bug#8344).
17315
17316 * eval.c (Fbacktrace): Don't assume nargs fits in int.
17317 (Fbacktrace_frame): Don't assume nframes fits in int.
17318
17319 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17320
17321 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17322 concerns.
17323
17324 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17325
17326 * cm.c (calccost): Turn while-do into do-while, for clarity.
17327
17328 * keyboard.c (syms_of_keyboard): Use the same style as later
17329 in this function when indexing through an array. This also
17330 works around GCC bug 48267.
17331
17332 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17333
17334 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17335
17336 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17337 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17338
17339 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17340 This avoids undefined behavior on integer overflow, and is a bit
17341 more convenient anyway since it is compared to a size_t variable.
17342
17343 Variadic C functions now count arguments with size_t, not int.
17344 This avoids an unnecessary limitation on 64-bit machines, which
17345 caused (substring ...) to crash on large vectors (Bug#8344).
17346 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17347 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
17348 All variadic functions and their callers changed accordingly.
17349 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17350 * data.c (arith_driver, float_arith_driver): Likewise.
17351 * editfns.c (general_insert_function): Likewise.
17352 * eval.c (struct backtrace.nargs, interactive_p)
17353 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17354 (funcall_lambda, mark_backtrace): Likewise.
17355 * fns.c (concat): Likewise.
17356 * frame.c (x_set_frame_parameters): Likewise.
17357 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17358 0 if not found, not -1. All callers changed.
17359
17360 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17361 (stack_copy_size): Now size_t, not int.
17362 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17363
17364 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17365
17366 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17367 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17368 All callers changed.
17369
17370 * lisp.h (multibyte_char_to_unibyte):
17371 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17372 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17373 * character.h (CHAR_TO_BYTE8):
17374 * cmds.c (internal_self_insert):
17375 * editfns.c (general_insert_function):
17376 * keymap.c (push_key_description):
17377 * search.c (Freplace_match):
17378 * xdisp.c (message_dolog, set_message_1): All callers changed.
17379
17380 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17381
17382 * keyboard.c (safe_run_hook_funcall): New function.
17383 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17384 don't set the hook to nil, but remove the offending function instead.
17385 (Qcommand_hook_internal): Remove, unused.
17386 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17387 Vcommand_hook_internal.
17388
17389 * eval.c (enum run_hooks_condition): Remove.
17390 (funcall_nil, funcall_not): New functions.
17391 (run_hook_with_args): Call each function through a `funcall' argument.
17392 Remove `cond' argument, now redundant.
17393 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17394 (Frun_hook_with_args_until_failure): Adjust accordingly.
17395 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17396
17397 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17398
17399 * dispextern.h (string_buffer_position): Remove declaration.
17400
17401 * print.c (strout): Remove parameter `multibyte', unused since
17402 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17403
17404 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17405 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17406 All callers changed.
17407
17408 * w32.c (_wsa_errlist): Use braces for struct initializers.
17409
17410 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17411 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17412 All callers changed.
17413 (string_buffer_position): Likewise. Also, make static (it's never
17414 used outside xdisp.c).
17415 (cursor_row_p): Remove parameter `w', unused since
17416 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17417 (decode_mode_spec): Remove parameter `precision', introduced during
17418 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17419 All callers changed.
17420
17421 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17422
17423 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17424
17425 2011-03-27 Anders Lindgren <andlind@gmail.com>
17426
17427 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17428 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17429 (ns_update_auto_hide_menu_bar): New functions.
17430 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17431 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17432 ns_constrain_all_frames.
17433 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17434 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17435
17436 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17437
17438 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17439
17440 2011-03-27 Glenn Morris <rgm@gnu.org>
17441
17442 * syssignal.h: Replace RETSIGTYPE with void.
17443 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17444 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17445 Replace SIGTYPE with void everywhere.
17446 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17447 * s/template.h (SIGTYPE): Remove commented out definition.
17448
17449 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17450
17451 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17452 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17453
17454 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17455
17456 * w32.c (read_unc_volume): Use parameter `henum', instead of
17457 global variable `wget_enum_handle'.
17458
17459 * keymap.c (describe_vector): Remove parameters `indices' and
17460 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17461 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17462
17463 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17464
17465 * keyboard.c (timer_check): Remove parameter `do_it_now',
17466 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17467 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17468 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17469
17470 * keyboard.c (read_char):
17471 * w32menu.c (w32_menu_display_help):
17472 * xmenu.c (show_help_event, menu_help_callback):
17473 Adjust calls to `show_help_echo'.
17474
17475 * gtkutil.c (xg_maybe_add_timer):
17476 * keyboard.c (readable_events):
17477 * process.c (wait_reading_process_output):
17478 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17479
17480 * insdel.c (adjust_markers_gap_motion):
17481 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17482 (gap_left, gap_right): Don't call it.
17483
17484 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17485
17486 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17487 incurred during fontification.
17488
17489 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17490
17491 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17492 (DEFVAR_PER_BUFFER): Don't pass it.
17493
17494 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17495 (scrolling_window): Don't pass it.
17496
17497 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17498
17499 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17500
17501 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17502 and `suffix'.
17503 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17504 of variables specific to SELinux and computation of `encoded_absname'.
17505
17506 * image.c (XPutPixel): Remove unused variable `height'.
17507
17508 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17509
17510 * unexw32.c (get_section_info): Remove unused variable `section'.
17511
17512 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17513 (system_process_attributes): Remove unused variable `sess'.
17514 (sys_read): Remove unused variable `err'.
17515
17516 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17517 (w32_wnd_proc): Remove unused variable `isdead'.
17518 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17519 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17520 (x_create_tip_frame): Remove unused variable `tem'.
17521
17522 * w32inevt.c (w32_console_read_socket):
17523 Remove unused variable `no_events'.
17524
17525 * w32term.c (x_draw_composite_glyph_string_foreground):
17526 Remove unused variable `width'.
17527
17528 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17529
17530 * w32term.c (x_set_glyph_string_clipping):
17531 Don't pass uninitialized region to CombineRgn.
17532
17533 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17534
17535 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17536 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17537 (Fx_close_connection): Remove unused variable `i'.
17538
17539 * w32font.c (w32font_draw): Return number of glyphs.
17540 (w32font_open_internal): Remove unused variable `i'.
17541 (w32font_driver): Add missing initializer.
17542
17543 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17544 (fill_in_menu): Remove unused variable `items_added'.
17545
17546 * w32term.c (last_mouse_press_frame): Remove static global variable.
17547 (w32_clip_to_row): Remove unused variable `f'.
17548 (x_delete_terminal): Remove unused variable `i'.
17549
17550 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17551 (NOTHING): Remove unused static global variable.
17552 (uniscribe_check_otf): Remove unused variable `table'.
17553 (uniscribe_font_driver): Add missing initializers.
17554
17555 2011-03-23 Julien Danjou <julien@danjou.info>
17556
17557 * term.c (Fsuspend_tty, Fresume_tty):
17558 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17559 * window.c (temp_output_buffer_show):
17560 * insdel.c (signal_before_change):
17561 * frame.c (Fhandle_switch_frame):
17562 * fileio.c (Fdo_auto_save):
17563 * emacs.c (Fkill_emacs):
17564 * editfns.c (save_excursion_restore):
17565 * cmds.c (internal_self_insert):
17566 * callint.c (Fcall_interactively):
17567 * buffer.c (Fkill_all_local_variables):
17568 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17569 Use Frun_hooks.
17570 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17571 unconditionally since it does the check itself.
17572
17573 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17574
17575 Fix more problems found by GCC 4.5.2's static checks.
17576
17577 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17578 the first time through the loop, since we know p0 < p1 then.
17579 This also avoids a gcc -Wstrict-overflow warning.
17580
17581 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17582 leading to a memory leak, possible in functions like
17583 load_charset_map_from_file that can allocate an unbounded number
17584 of objects (Bug#8318).
17585
17586 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17587 that could (at least in theory) be that large.
17588
17589 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17590 This is less likely to overflow, and avoids undefined behavior if
17591 overflow does occur. All callers changed. Use strtoul to scan
17592 for the unsigned long integer.
17593 (pint2hrstr): Simplify and tune code slightly.
17594 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17595
17596 * scroll.c (do_scrolling): Work around GCC bug 48228.
17597 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17598
17599 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17600 This also avoids a warning with gcc -Wstrict-overflow.
17601 (validate_x_resource_name): Simplify count usage.
17602 This also avoids a warning with gcc -Wstrict-overflow.
17603
17604 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17605 fail (Bug#8306).
17606
17607 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17608
17609 * process.c (Fmake_network_process): Use socklen_t, not int,
17610 where POSIX says socklen_t is required in portable programs.
17611 This fixes a porting bug on hosts like 64-bit HP-UX, where
17612 socklen_t is wider than int (Bug#8277).
17613 (Fmake_network_process, server_accept_connection):
17614 (wait_reading_process_output, read_process_output):
17615 Likewise.
17616
17617 * process.c: Rename or move locals to avoid shadowing.
17618 (list_processes_1, Fmake_network_process):
17619 (read_process_output_error_handler, exec_sentinel_error_handler):
17620 Rename or move locals.
17621 (Fmake_network_process): Define label "retry_connect" only if needed.
17622 (Fnetwork_interface_info): Fix pointer signedness.
17623 (process_send_signal): Add cast to avoid pointer signedness problem.
17624 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17625 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17626
17627 Make tparam.h and terminfo.c consistent.
17628 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17629 Include tparam.h instead, since it declares them.
17630 * cm.h (PC): Remove extern decl; tparam.h now does this.
17631 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17632 * terminfo.c: Include tparam.h, to check interfaces.
17633 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17634 (tparam): Adjust signature to match interface in tparam.h;
17635 this removes some undefined behavior. Check that outstring and len
17636 are zero, which they always are with Emacs.
17637 * tparam.h (PC, BC, UP): New extern decls.
17638
17639 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17640 (xftfont_open): Rename locals to avoid shadowing.
17641
17642 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17643 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17644 (OTF_TAG_SYM): Omit macro if not needed.
17645 (ftfont_list): Remove unused local.
17646 (get_adstyle_property, ftfont_pattern_entity):
17647 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17648 Rename locals to avoid shadowing.
17649
17650 * xfont.c (xfont_list_family): Mark var as initialized.
17651
17652 * xml.c (make_dom): Now static.
17653
17654 * composite.c (composition_compute_stop_pos): Rename local to
17655 avoid shadowing.
17656 (composition_reseat_it): Remove unused locals.
17657 (find_automatic_composition, composition_adjust_point): Likewise.
17658 (composition_update_it): Mark var as initialized.
17659 (find_automatic_composition): Mark vars as initialized,
17660 with a FIXME (Bug#8290).
17661
17662 character.h: Rename locals to avoid shadowing.
17663 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17664 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17665 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17666 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17667 to avoid shadowing.
17668
17669 * textprop.c (property_change_between_p): Remove; unused.
17670
17671 * intervals.c (interval_start_pos): Now static.
17672
17673 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17674
17675 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17676 Rename locals to avoid shadowing.
17677
17678 * sound.c (wav_play, au_play, Fplay_sound_internal):
17679 Fix pointer signedness.
17680 (alsa_choose_format): Remove unused local var.
17681 (wav_play): Initialize a variable to 0, to prevent undefined
17682 behavior (Bug#8278).
17683
17684 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17685
17686 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17687
17688 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17689 clobbering (Bug#8298).
17690 * sysdep.c (sys_subshell): Likewise.
17691 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17692
17693 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17694 This should get cleaned up, so that child_setup has the
17695 same signature on all platforms.
17696
17697 * callproc.c (call_process_cleanup): Now static.
17698 (relocate_fd): Rename locals to avoid shadowing.
17699
17700 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
17701
17702 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17703 not to be necessary, and produces flickering.
17704
17705 2011-03-20 Glenn Morris <rgm@gnu.org>
17706
17707 * config.in: Remove file.
17708
17709 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
17710
17711 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17712 are now in src/globals.h.
17713 (syms_of_minibuf): Remove spurious & from previous change.
17714
17715 2011-03-20 Leo Liu <sdl.web@gmail.com>
17716
17717 * minibuf.c (completing-read-function): New variable.
17718 (completing-read-default): Rename from completing-read.
17719 (completing-read): Call completing-read-function.
17720
17721 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17722
17723 * xfaces.c (Fx_load_color_file):
17724 Read color file from absolute filename (bug#8250).
17725
17726 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17727
17728 * makefile.w32-in: Update dependencies.
17729
17730 2011-03-17 Eli Zaretskii <eliz@gnu.org>
17731
17732 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17733
17734 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17735
17736 Fix more problems found by GCC 4.5.2's static checks.
17737
17738 * process.c (make_serial_process_unwind, send_process_trap):
17739 (sigchld_handler): Now static.
17740
17741 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17742 That way, the code declares only the vars that it needs.
17743 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17744 * s/cygwin.h (PTY_ITERATION): Likewise.
17745 * s/darwin.h (PTY_ITERATION): Likewise.
17746 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17747
17748 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17749 * process.c (allocate_pty): Don't declare stb unless it's needed.
17750
17751 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17752 (CONSTANTLIM): Remove; unused.
17753 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17754 Define only if needed.
17755
17756 * unexelf.c (unexec): Name an expression,
17757 to avoid gcc -Wbad-function-cast warning.
17758 Use a different way to cause a compilation error if anyone uses
17759 n rather than nn, a way that does not involve shadowing.
17760 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17761
17762 * deps.mk (unexalpha.o): Remove; unused.
17763
17764 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17765 * unexec.h: New file.
17766 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17767 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17768 Depend on unexec.h.
17769 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17770 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17771 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17772 Change as necessary to match prototype in unexec.h.
17773
17774 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17775 shadowing.
17776 (back_comment, skip_chars): Mark vars as initialized.
17777
17778 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17779 Rename locals to avoid shadowing.
17780
17781 * lread.c (read1): Rewrite so as not to use empty "else".
17782 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17783
17784 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17785
17786 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17787 warning when compiling print.c.
17788
17789 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17790 instead of using an uninitialized var.
17791 (font_sort_entities): Mark var as initialized.
17792
17793 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17794
17795 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17796 pointers to constants.
17797 (font_parse_fcname): Remove unused vars.
17798 (font_delete_unmatched): Now static.
17799 (font_get_spec): Remove; unused.
17800 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17801 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17802 Rename or move locals to avoid shadowing.
17803
17804 * fns.c (require_nesting_list, require_unwind): Now static.
17805 (Ffillarray): Rename locals to avoid shadowing.
17806
17807 * floatfns.c (domain_error2): Define only if needed.
17808 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17809
17810 * alloc.c (mark_backtrace): Move decl from here ...
17811 * lisp.h: ... to here, so that it can be checked.
17812
17813 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17814 (Fdefvar): Rewrite so as not to use empty "else".
17815 (lisp_indirect_variable): Name an expression,
17816 to avoid gcc -Wbad-function-cast warning.
17817 (Fdefvar): Rename locals to avoid shadowing.
17818
17819 * callint.c (quotify_arg, quotify_args): Now static.
17820 (Fcall_interactively): Rename locals to avoid shadowing.
17821 Use const pointer when appropriate.
17822
17823 * lisp.h (get_system_name, get_operating_system_release):
17824 Move decls here, to check interfaces.
17825 * process.c (get_operating_system_release): Move decl to lisp.h.
17826 * xrdb.c (get_system_name): Likewise.
17827 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17828 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17829 some of which prompt warnings from gcc -Wbad-function-cast.
17830 (Fformat_time_string, Fencode_time, Finsert_char):
17831 (Ftranslate_region_internal, Fformat):
17832 Rename or remove local vars to avoid shadowing.
17833 (Ftranslate_region_internal): Mark var as initialized.
17834
17835 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17836 avoid shadowing.
17837
17838 * lisp.h (eassert): Check that the argument compiles, even if
17839 ENABLE_CHECKING is not defined.
17840
17841 * data.c (Findirect_variable): Name an expression, to avoid
17842 gcc -Wbad-function-cast warning.
17843 (default_value, arithcompare, arith_driver, arith_error): Now static.
17844 (store_symval_forwarding): Rename local to avoid shadowing.
17845 (Fmake_variable_buffer_local, Fmake_local_variable):
17846 Mark variables as initialized.
17847 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17848
17849 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17850 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17851 Rename locals to avoid shadowing.
17852 (mark_stack): Move local variables into the #ifdef region where
17853 they're used.
17854 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17855 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17856 needed otherwise.
17857 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17858 (GC_STRING_CHARS): Remove; not used.
17859 (Fmemory_limit): Cast sbrk's returned value to char *.
17860
17861 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17862 avoids undefined behavior in theory.
17863
17864 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17865
17866 Use functions, not macros, for up- and down-casing (Bug#8254).
17867 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17868 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17869 to use the following functions instead of these macros.
17870 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17871 EMACS_INT, since callers assume the returned value fits in int.
17872 (upcase1): Likewise, for UPCASE_TABLE.
17873 (uppercasep, lowercasep, upcase): New static inline functions.
17874 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17875 the race-condition problem in the old DOWNCASE.
17876
17877 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17878 Rename locals to avoid shadowing.
17879 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17880 (regex_compile, re_search_2, re_match_2_internal):
17881 Remove unused local vars.
17882 (FREE_VAR): Rewrite so as not to use empty "else",
17883 which gcc can warn about.
17884 (regex_compile, re_match_2_internal): Mark locals as initialized.
17885 (RETALLOC_IF): Define only if needed.
17886 (WORDCHAR_P): Likewise. This one is never needed, but is used
17887 only in a comment talking about a compiler bug, so put inside
17888 the #if 0 of that comment.
17889 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17890 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17891 Remove; unused.
17892
17893 * search.c (boyer_moore): Rename locals to avoid shadowing.
17894 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17895 (PREV_CHAR_BOUNDARY): Likewise.
17896
17897 * search.c (simple_search): Remove unused var.
17898
17899 * dired.c (compile_pattern): Move decl from here ...
17900 * lisp.h: ... to here, so that it can be checked.
17901 (struct re_registers): New forward decl.
17902
17903 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17904
17905 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17906 All uses changed.
17907 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17908 Rename locals to avoid shadowing.
17909 (Fvertical_motion): Mark locals as initialized.
17910
17911 * casefiddle.c (casify_object, casify_region): Now static.
17912 (casify_region): Mark local as initialized.
17913
17914 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17915
17916 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17917 New macros, so that the caller can use some names other than
17918 gcpro1, gcpro2, etc.
17919 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17920 of the new macros.
17921 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17922 argument, for consistency with GCPRO2_VAR, etc: it is now the
17923 prefix of the variable, not the variable itself. All uses
17924 changed.
17925 * dired.c (directory_files_internal, file_name_completion):
17926 Rename locals to avoid shadowing.
17927
17928 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17929 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17930 dired.c's scmp function, had undefined behavior.
17931 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17932 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17933 * buffer.h: ... to here, because these macros use current_buffer,
17934 and the new implementation with inline functions needs to have
17935 current_buffer in scope now, rather than later when the macros
17936 are used.
17937 (downcase, upcase1): New static inline functions.
17938 (DOWNCASE, UPCASE1): Reimplement using these functions.
17939 This avoids undefined behavior in expressions like
17940 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17941 from race conditions in accessing the global variables
17942 case_temp1 and case_temp2.
17943 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17944 * lisp.h (case_temp1, case_temp2): Remove their decls.
17945 * character.h (ASCII_CHAR_P): Move from here ...
17946 * lisp.h: ... to here, so that the inline functions mentioned
17947 above can use them.
17948
17949 * dired.c (directory_files_internal_unwind): Now static.
17950
17951 * fileio.c (file_name_as_directory, directory_file_name):
17952 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17953 Now static.
17954 (file_name_as_directory): Use const pointers when appropriate.
17955 (Fexpand_file_name): Likewise. In particular, newdir might
17956 point at constant storage, so make it a const pointer.
17957 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17958 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17959 signedness issues.
17960 (Fset_file_times, Finsert_file_contents, auto_save_error):
17961 Rename locals to avoid shadowing.
17962
17963 * minibuf.c (choose_minibuf_frame_1): Now static.
17964 (Ftry_completion, Fall_completions): Rename or remove locals
17965 to avoid shadowing.
17966
17967 * marker.c (bytepos_to_charpos): Remove; unused.
17968
17969 * lisp.h (verify_bytepos, count_markers): New decls,
17970 so that gcc does not warn that these functions aren't declared.
17971
17972 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17973 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17974 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17975 (copy_text): Remove unused local var.
17976
17977 * filelock.c (within_one_second): Now static.
17978 (lock_file_1): Rename local to avoid shadowing.
17979
17980 * buffer.c (fix_overlays_before): Mark locals as initialized.
17981 (fix_start_end_in_overlays): Likewise. This function should be
17982 simplified by using pointers-to-pointers, but that's a different
17983 matter.
17984 (switch_to_buffer_1): Now static.
17985 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17986 (report_overlay_modification): Rename locals to avoid shadowing.
17987
17988 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17989 Fix pointer signedness issue.
17990 (sys_subshell): Mark local as volatile if checking for lint,
17991 to suppress a gcc -Wclobbered warning that does not seem to be right.
17992 (MAXPATHLEN): Define only if needed.
17993
17994 * process.c (serial_open, serial_configure): Move decls from here ...
17995 * systty.h: ... to here, so that they can be checked.
17996
17997 * fns.c (get_random, seed_random): Move extern decls from here ...
17998 * lisp.h: ... to here, so that they can be checked.
17999
18000 * sysdep.c (reset_io): Now static.
18001 (wait_for_termination_signal): Remove; unused.
18002
18003 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18004 (copy_keymap_item, append_key, push_text_char_description):
18005 Now static.
18006 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18007 (DENSE_TABLE_SIZE): Remove; unused.
18008 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18009 (describe_map_tree):
18010 Rename locals to avoid shadowing.
18011
18012 * keyboard.c: Declare functions static if they are not used elsewhere.
18013 (echo_char, echo_dash, cmd_error, top_level_2):
18014 (poll_for_input, handle_async_input): Now static.
18015 (read_char, kbd_buffer_get_event, make_lispy_position):
18016 (make_lispy_event, make_lispy_movement, apply_modifiers):
18017 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18018 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18019 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18020 (read_key_sequence, read_char): Mark locals as initialized.
18021 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18022
18023 * keyboard.h (make_ctrl_char): New decl.
18024 (mark_kboards): Move decl here ...
18025 * alloc.c (mark_kboards): ... from here.
18026
18027 * lisp.h (force_auto_save_soon): New decl.
18028
18029 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18030 (DEFINE_DUMMY_FUNCTION): New macro.
18031 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18032 Use it.
18033 (main): Add casts to avoid warnings
18034 if GCC considers string literals to be constants.
18035
18036 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18037
18038 * dbusbind.c: Pointer signedness fixes.
18039 (xd_signature, xd_append_arg, xd_initialize):
18040 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18041 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18042 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18043 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18044
18045 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18046 if GCC considers string literals to be constants.
18047 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18048
18049 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18050
18051 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18052 (print_preprocess, print_object): New macro to fix last change.
18053
18054 * print.c (print_preprocess): Don't forget font objects.
18055
18056 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
18057
18058 * emacs.c (USAGE3): Doc fixes.
18059
18060 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18061
18062 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18063 structure.
18064
18065 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
18066
18067 * lisp.h (VWindow_system, Qfile_name_history):
18068 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18069 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18070 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18071
18072 * w32select.c: Don't #include "keyboard.h".
18073 (run_protected): Add extern declaration for waiting_for_input.
18074
18075 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18076 * w32console.c (detect_input_pending, read_input_pending)
18077 (encode_terminal_code):
18078 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18079 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18080 (w32_system_caret_y, Qfile_name_history):
18081 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18082 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18083 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18084 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18085 * w32proc.c (Qlocal, report_file_error):
18086 * w32term.c (Vwindow_system, updating_frame):
18087 * w32uniscribe.c (initialized, uniscribe_font_driver):
18088 Remove unneeded extern declarations.
18089
18090 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
18091
18092 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18093
18094 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
18095
18096 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18097 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18098 These macros can no longer be used for assignment.
18099
18100 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18101 Assign struct members directly, instead of using BUF_BEGV etc.
18102 (record_buffer_markers, fetch_buffer_markers): New functions for
18103 recording and fetching special buffer markers.
18104 (set_buffer_internal_1, set_buffer_temp): Use them.
18105
18106 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18107
18108 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18109
18110 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18111 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18112
18113 * xdisp.c (hscroll_window_tree):
18114 (reconsider_clip_changes): Use PT instead of BUF_PT.
18115
18116 2011-03-13 Eli Zaretskii <eliz@gnu.org>
18117
18118 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18119 $(EMACS_ROOT)/lib/intprops.h.
18120
18121 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18122
18123 Fix more problems found by GCC 4.5.2's static checks.
18124
18125 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18126 to unsigned char * to avoid compiler diagnostic.
18127 (xg_free_frame_widgets): Make it clear that a local variable is
18128 needed only if USE_GTK_TOOLTIP.
18129 (gdk_window_get_screen): Make it clear that this macro is needed
18130 only if USE_GTK_TOOLTIP.
18131 (int_gtk_range_get_value): New function, which avoids a diagnostic
18132 from gcc -Wbad-function-cast.
18133 (xg_set_toolkit_scroll_bar_thumb): Use it.
18134 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18135 diagnostic from gcc -Wbad-function-cast.
18136 (get_utf8_string, xg_get_file_with_chooser):
18137 Rename locals to avoid shadowing.
18138 (create_dialog): Move locals to avoid shadowing.
18139
18140 * xgselect.c (xg_select): Remove unused var.
18141
18142 * image.c (four_corners_best): Mark locals as initialized.
18143 (gif_load): Initialize transparent_p to zero (Bug#8238).
18144 Mark another local as initialized.
18145 (my_png_error, my_error_exit): Mark with NO_RETURN.
18146
18147 * image.c (clear_image_cache): Now static.
18148 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18149 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18150 (x_edge_detection): Remove unnecessary cast that
18151 gcc -Wbad-function-cast diagnoses.
18152 (gif_load): Fix pointer signedness.
18153 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18154 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18155
18156 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18157
18158 Improve quality of tests for time stamp overflow.
18159 For example, without this patch (encode-time 0 0 0 1 1
18160 1152921504606846976) returns the obviously-bogus value (-948597
18161 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18162 reports time overflow. See
18163 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18164 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18165 * editfns.c: Include limits.h and intprops.h.
18166 (TIME_T_MIN, TIME_T_MAX): New macros.
18167 (time_overflow): Move earlier, to before first use.
18168 (hi_time, lo_time): New functions, for an accurate test for
18169 out-of-range times.
18170 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18171 (Fget_internal_run_time): Don't assume time_t fits in int.
18172 (make_time): Use list2 instead of Fcons twice.
18173 (Fdecode_time): More accurate test for out-of-range times.
18174 (check_tm_member): New function.
18175 (Fencode_time): Use it, to test for out-of-range times.
18176 (lisp_time_argument): Don't rely on undefined left-shift and
18177 right-shift behavior when checking for time stamp overflow.
18178
18179 * editfns.c (time_overflow): New function, refactoring common code.
18180 (Fformat_time_string, Fdecode_time, Fencode_time):
18181 (Fcurrent_time_string): Use it.
18182
18183 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18184 * dired.c (make_time): Move to ...
18185 * editfns.c (make_time): ... here.
18186 * systime.h: Note the move.
18187
18188 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18189
18190 * fringe.c (update_window_fringes): Remove unused variables.
18191
18192 * unexmacosx.c (copy_data_segment): Also copy __got section.
18193 (Bug#8223)
18194
18195 2011-03-12 Eli Zaretskii <eliz@gnu.org>
18196
18197 * termcap.c [MSDOS]: Include "msdos.h".
18198 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18199 Constify `char *' arguments and their references according to
18200 prototypes in tparam.h.
18201
18202 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18203
18204 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18205 Adapt all references accordingly.
18206
18207 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18208
18209 2011-03-11 Tom Tromey <tromey@redhat.com>
18210
18211 * buffer.c (syms_of_buffer): Remove obsolete comment.
18212
18213 2011-03-11 Eli Zaretskii <eliz@gnu.org>
18214
18215 * termhooks.h (encode_terminal_code): Declare prototype.
18216
18217 * msdos.c (encode_terminal_code): Don't declare prototype.
18218
18219 * term.c (encode_terminal_code): Now external again, used by
18220 w32console.c and msdos.c.
18221
18222 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18223 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18224
18225 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
18226
18227 Fix some minor problems found by GCC 4.5.2's static checks.
18228
18229 * fringe.c (update_window_fringes): Mark locals as initialized
18230 (Bug#8227).
18231 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18232
18233 * alloc.c (mark_fringe_data): Move decl from here ...
18234 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18235 to check its interface.
18236 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18237
18238 * fontset.c (free_realized_fontset): Now static.
18239 (Fset_fontset_font): Rename local to avoid shadowing.
18240 (fontset_font): Mark local as initialized.
18241 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18242
18243 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18244
18245 * xselect.c (x_disown_buffer_selections): Remove; not used.
18246 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18247 (x_own_selection, Fx_disown_selection_internal): Rename locals
18248 to avoid shadowing.
18249 (x_handle_dnd_message): Remove local to avoid shadowing.
18250
18251 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18252 so that the caller can use some name other than gcpro1.
18253 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18254 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18255 (Fx_backspace_delete_keys_p):
18256 Use them to avoid shadowing, and rename vars to avoid shadowing.
18257 (x_decode_color, x_set_name, x_window): Now static.
18258 (Fx_create_frame): Add braces to silence GCC warning.
18259 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18260 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18261 Remove unused locals.
18262 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18263 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18264 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18265 macros.
18266
18267 * xterm.h (x_mouse_leave): New decl.
18268
18269 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18270 Remove unused functions.
18271 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18272 (x_calc_absolute_position): Now static.
18273 (XTread_socket): Don't define label "out" unless it's used.
18274 Don't declare local "event" unless it's used.
18275 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18276 unless they are used.
18277 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18278 (x_fatal_error_signal): Remove; not used.
18279 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18280 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18281 (x_error_catcher, x_connection_closed, x_error_handler):
18282 (x_error_quitter, xembed_send_message, x_iconify_frame):
18283 (my_log_handler): Rename locals to avoid shadowing.
18284 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18285 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18286
18287 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18288 Rename or move locals to avoid shadowing.
18289 (tty_defined_color, merge_face_heights): Now static.
18290 (free_realized_faces_for_fontset): Remove; not used.
18291 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18292 does not deduce is never used uninitialized.
18293 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18294 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18295
18296 * terminal.c (store_terminal_param): Now static.
18297
18298 * xmenu.c (menu_highlight_callback): Now static.
18299 (set_frame_menubar): Remove unused local.
18300 (xmenu_show): Rename parameter to avoid shadowing.
18301 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18302 since they might point to immutable storage.
18303 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18304 since it's unused otherwise.
18305
18306 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18307 Add a FIXME, since the code still doesn't look right. (Bug#8215)
18308 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18309 avoids a gcc -Wuninitialized diagnostic.
18310 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18311 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18312 does not deduce are never used uninitialized.
18313
18314 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18315
18316 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18317 * window.c (window_loop, size_window):
18318 (run_window_configuration_change_hook, enlarge_window): Likewise.
18319
18320 * window.c (display_buffer): Now static.
18321 (size_window): Mark variables that gcc -Wuninitialized
18322 does not deduce are never used uninitialized.
18323 * window.h (check_all_windows): New decl, to forestall
18324 gcc -Wmissing-prototypes diagnostic.
18325 * dispextern.h (bidi_dump_cached_states): Likewise.
18326
18327 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18328 shadowing.
18329 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18330 Include <limits.h>.
18331 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18332 and to avoid gcc -Wuninitialized warning.
18333 (load_charset_map): Mark variables that gcc -Wuninitialized
18334 does not deduce are never used uninitialized.
18335 (load_charset): Abort instead of using uninitialized var (Bug#8229).
18336
18337 * coding.c (coding_set_source, coding_set_destination):
18338 Use "else { /* comment */ }" rather than "else /* comment */;"
18339 for clarity, and to avoid gcc -Wempty-body warning.
18340 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18341 a block, when the outer 'i' will do.
18342 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18343 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18344 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18345 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18346 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18347 Rename locals to avoid shadowing.
18348 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
18349 * coding.c (emacs_mule_char, encode_invocation_designation):
18350 Now static, since they're not used elsewhere.
18351 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
18352 (decode_coding_object, encode_coding_object, detect_coding_system):
18353 (decode_coding_emacs_mule): Mark variables that gcc
18354 -Wuninitialized does not deduce are never used uninitialized.
18355 (detect_coding_iso_2022): Initialize a local variable that might
18356 be used uninitialized. Leave a FIXME because it's not clear that
18357 this initialization is needed. (Bug#8211)
18358 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18359 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18360 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18361 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18362 Remove unused macros.
18363
18364 * category.c (hash_get_category_set): Remove unused local var.
18365 (copy_category_table): Now static, since it's not used elsewhere.
18366 * character.c (string_count_byte8): Likewise.
18367
18368 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18369 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18370
18371 * chartab.c (copy_sub_char_table): Now static, since it's not used
18372 elsewhere.
18373 (sub_char_table_ref_and_range, char_table_ref_and_range):
18374 Rename locals to avoid shadowing.
18375 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
18376
18377 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18378 (BIDI_BOB): Remove unused macro.
18379
18380 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18381 deduce are never used uninitialized.
18382 * term.c (encode_terminal_code): Likewise.
18383
18384 * term.c (encode_terminal_code): Now static. Remove unused local.
18385
18386 * tparam.h: New file.
18387 * term.c, tparam.h: Include it.
18388 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18389 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18390 Move these decls to tparam.h, and make them agree with what
18391 is actually in tparam.c. The previous trick of using incompatible
18392 decls in different modules does not conform to the C standard.
18393 All callers of tparam changed to use tparam's actual API.
18394 * tparam.c (tparam1, tparam, tgoto):
18395 Use const pointers where appropriate.
18396
18397 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18398 * cm.h (struct cm): Likewise.
18399 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18400 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18401 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18402 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18403 (turn_on_face, init_tty): Likewise.
18404 * termchar.h (struct tty_display_info): Likewise.
18405
18406 * term.c (term_mouse_position): Rename local to avoid shadowing.
18407
18408 * alloc.c (mark_ttys): Move decl from here ...
18409 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18410
18411 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18412
18413 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18414
18415 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
18416
18417 * search.c (compile_pattern_1): Remove argument regp, unused since
18418 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18419 (compile_pattern): Don't pass it.
18420
18421 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18422
18423 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18424 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18425 for ! HAVE_GTK3.
18426 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18427
18428 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18429
18430 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18431 gdk_window_get_screen, gdk_window_get_geometry,
18432 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18433 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18434 (xg_get_pixbuf_from_pixmap): New function.
18435 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18436 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18437 Call xg_get_pixbuf_from_pixmap instead of
18438 gdk_pixbuf_get_from_drawable.
18439 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18440 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18441 (xg_check_special_colors): Use GtkStyleContext and its functions
18442 for HAVE_GTK3.
18443 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18444 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18445 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18446 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18447 Call gtk_widget_get_preferred_size.
18448 (xg_frame_resized): gdk_window_get_geometry only takes 5
18449 parameters.
18450 (xg_win_to_widget, xg_event_is_for_menubar):
18451 Call gdk_x11_window_lookup_for_display.
18452 (xg_set_widget_bg): New function.
18453 (delete_cb): New function.
18454 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18455 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18456 (xg_set_background_color): Call xg_set_widget_bg.
18457 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18458 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18459 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18460 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18461 if ! HAVE_GTK3.
18462 (update_frame_tool_bar): Call gtk_widget_hide.
18463 (xg_initialize): Use GDK_KEY_g.
18464
18465 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18466 if ! HAVE_GTK3
18467 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18468
18469 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18470 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18471 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18472
18473 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18474
18475 * w32xfns.c (select_palette): Check success of RealizePalette against
18476 GDI_ERROR, not zero.
18477
18478 See ChangeLog.11 for earlier changes.
18479
18480 ;; Local Variables:
18481 ;; coding: utf-8
18482 ;; End:
18483
18484 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18485
18486 This file is part of GNU Emacs.
18487
18488 GNU Emacs is free software: you can redistribute it and/or modify
18489 it under the terms of the GNU General Public License as published by
18490 the Free Software Foundation, either version 3 of the License, or
18491 (at your option) any later version.
18492
18493 GNU Emacs is distributed in the hope that it will be useful,
18494 but WITHOUT ANY WARRANTY; without even the implied warranty of
18495 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18496 GNU General Public License for more details.
18497
18498 You should have received a copy of the GNU General Public License
18499 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.