Misc minor simplifications in C code.
[bpt/emacs.git] / src / ChangeLog
1 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4
5 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
6 case for the special 0 coding-system.
7
8 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
9 (Fmake_overlay): Remove redundant tests.
10
11 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
12
13 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
14 Update dependencies.
15
16 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
17
18 Fix a malloc race condition involving strsignal.
19 A signal can arrive in the middle of a malloc, and Emacs's signal
20 handler can invoke strsignal, which can invoke malloc, which is
21 not portable. This race condition bug makes Emacs hang on GNU/Linux.
22 Fix it by altering the signal handler so that it does not invoke
23 strsignal.
24 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
25 * process.c (status_message): Use const pointer, in case strsignal
26 is #defined to safe_strsignal.
27 * sysdep.c (sys_siglist, init_signals): Always define and
28 initialize a substitute sys_siglist if the system does not define
29 one, even if HAVE_STRSIGNAL.
30 (safe_strsignal): Rename from strsignal. Always define,
31 using sys_siglist. Return a const pointer.
32 * syssignal.h (safe_strsignal): New decl.
33 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
34
35 2012-10-01 Eli Zaretskii <eliz@gnu.org>
36
37 * w32proc.c (timer_loop): Fix code that waits for timer
38 expiration, to avoid high CPU usage.
39
40 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
41
42 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
43 (sweep_weak_table): Remove redundant prototypes.
44
45 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
46
47 * emacs.c: Move the inclusion of TERM_HEADER after including
48 windows.h on WINDOWSNT. This avoids compilation problems with
49 MSVC.
50
51 2012-10-01 Eli Zaretskii <eliz@gnu.org>
52
53 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
54 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
55 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
56 as the previous version used 'void *'.
57
58 * ralloc.c (ROUNDUP): Fix last change.
59 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
60 'size_t'.
61
62 * w32proc.c <disable_itimers>: New static flag.
63 (init_timers): Initialize it to zero, after creating the critical
64 sections used by the timer threads.
65 (term_timers): Set to 1 before deleting the critical sections.
66 (getitimer, setitimer): If disable_itimers is non-zero, return an
67 error indication without doing anything. Reported by Fabrice
68 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
69 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
70 return results.
71 [!HAVE_SETITIMER]: Behave as the previous version that didn't
72 support timers.
73
74 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
75 term_ntproc after all the other bookkeeping, to get timers working
76 as long as possible.
77
78 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
79
80 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
81 Suggested by Juri Linkov in
82 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
83
84 Prefer plain 'static' to 'static inline' (Bug#12541).
85 With static functions, modern compilers inline pretty well by
86 themselves; advice from programmers often hurts as much as it helps.
87 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
88 this change shrinks the text size of the Emacs executable by 1.1%
89 without affecting CPU significantly in my benchmark.
90 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
91 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
92 (mark_maybe_object, mark_maybe_pointer, bounded_number):
93 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
94 (bset_auto_fill_function, bset_auto_save_file_format)
95 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
96 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
97 (bset_cache_long_line_scans, bset_case_fold_search)
98 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
99 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
100 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
101 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
102 (bset_header_line_format, bset_indicate_buffer_boundaries)
103 (bset_indicate_empty_lines, bset_invisibility_spec)
104 (bset_left_fringe_width, bset_major_mode, bset_mark)
105 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
106 (bset_name, bset_overwrite_mode, bset_pt_marker)
107 (bset_right_fringe_width, bset_save_length)
108 (bset_scroll_bar_width, bset_scroll_down_aggressively)
109 (bset_scroll_up_aggressively, bset_selective_display)
110 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
111 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
112 (set_buffer_overlays_after):
113 * category.c (bset_category_table):
114 * charset.c (read_hex):
115 * coding.c (produce_composition, produce_charset)
116 (handle_composition_annotation, handle_charset_annotation)
117 (char_encodable_p):
118 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
119 (assign_row, set_frame_matrix_frame, make_current)
120 (add_row_entry):
121 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
122 * fns.c (maybe_resize_hash_table):
123 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
124 * gmalloc.c (register_heapinfo):
125 * image.c (lookup_image_type):
126 * intervals.c (set_interval_object, set_interval_left)
127 (set_interval_right, copy_interval_parent, rotate_right)
128 (rotate_left, balance_possible_root_interval):
129 * keyboard.c (kset_echo_string, kset_kbd_queue)
130 (kset_keyboard_translate_table, kset_last_prefix_arg)
131 (kset_last_repeatable_command, kset_local_function_key_map)
132 (kset_overriding_terminal_local_map, kset_real_last_command)
133 (kset_system_key_syms, clear_event, set_prop):
134 * lread.c (digit_to_number):
135 * marker.c (attach_marker, live_buffer, set_marker_internal):
136 * nsterm.m (ns_compute_glyph_string_overhangs):
137 * process.c (pset_buffer, pset_command)
138 (pset_decode_coding_system, pset_decoding_buf)
139 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
140 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
141 (pset_status, pset_tty_name, pset_type, pset_write_queue):
142 * syntax.c (bset_syntax_table, dec_bytepos):
143 * terminal.c (tset_param_alist):
144 * textprop.c (interval_has_some_properties)
145 (interval_has_some_properties_list):
146 * window.c (wset_combination_limit, wset_dedicated)
147 (wset_display_table, wset_hchild, wset_left_fringe_width)
148 (wset_left_margin_cols, wset_new_normal, wset_new_total)
149 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
150 (wset_right_fringe_width, wset_right_margin_cols)
151 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
152 (wset_vertical_scroll_bar_type, wset_window_parameters):
153 * xdisp.c (wset_base_line_number, wset_base_line_pos)
154 (wset_column_number_displayed, wset_region_showing)
155 (window_box_edges, run_window_scroll_functions)
156 (append_glyph_string_lists, prepend_glyph_string_lists)
157 (append_glyph_string, set_glyph_string_background_width)
158 (append_glyph, append_composite_glyph)
159 (take_vertical_position_into_account):
160 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
161 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
162 (lface_hash, lface_same_font_attributes_p, lookup_face):
163 * xml.c (libxml2_loaded_p):
164 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
165 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
166 Now 'static', not 'static inline'.
167
168 * bidi.c: Tune.
169 (bidi_copy_it): Do the whole copy with a single memcpy.
170 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
171
172 Revert the FOLLOW-SYMLINKS change for file-attributes.
173 Doing it right would require several changes to Tramp, and there's
174 not enough time to get that tested before the freeze today.
175 * dired.c (directory_files_internal, Ffile_attributes):
176 Undo last change.
177
178 * frame.c (x_report_frame_params): Port better to wider ints.
179 Do not assume that EMACS_UINT is the same width as uprintmax_t,
180 or that pointers can be printed in 15 decimal digits.
181 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
182
183 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
184
185 Support x64 build on MS-Windows.
186 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
187 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
188 compatibility with x64.
189 (x_get_focus_frame): Add prototype.
190
191 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
192 defining an XRectangle structure.
193
194 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
195 arithmetics for compatibility with x64.
196
197 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
198 compatibility with x64.
199
200 * w32heap.h: Adjust prototypes and declarations.
201
202 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
203 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
204 DWORD, long, and unsigned long, for compatibility with x64.
205 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
206 (sbrk): Argument is now of type ptrdiff_t.
207
208 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
209 less than 0x0500.
210 (w32_msg_pump): Use WPARAM type for 'result'.
211
212 * w32.c (init_environment, get_emacs_configuration): Support AMD64
213 architecture.
214 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
215 compatibility with x64.
216
217 * vm-limit.c (lim_data): Now size_t.
218 (check_memory_limits): Adjust prototypes of real_morecore and
219 __morecore to receive argument of type ptrdiff_t. Use size_t for
220 five_percent and data_size.
221
222 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
223 variables, for compatibility with x64.
224 (rva_to_section, offset_to_section, relocate_offset)
225 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
226 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
227 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
228 for compatibility with x64.
229
230 * sysdep.c (STDERR_FILENO): Define if not already defined.
231
232 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
233 (__morecore): Argument type is now ptrdiff_t.
234 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
235 (relinquish): Use ptrdiff_t type for 'excess'.
236 (r_alloc_sbrk): Argument type is now ptrdiff_t.
237
238 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
239 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
240 instead of a literal number.
241
242 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
243 (min): Define only if not already defined.
244
245 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
246 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
247 hosts.
248
249 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
250 'bitmaps' is a pointer.
251
252 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
253
254 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
255
256 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
257
258 file-attributes has a new optional arg FOLLOW-SYMLINKS.
259 * dired.c (directory_files_internal, Ffile_attributes):
260 New arg follow_symlinks. All uses changed.
261
262 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
263
264 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
265
266 2012-09-30 Eli Zaretskii <eliz@gnu.org>
267
268 Support atimers and CPU profiler via profile.c on MS-Windows.
269 * w32proc.c (sig_mask, crit_sig): New static variables.
270 (sys_signal): Support SIGALRM and SIGPROF.
271 (sigemptyset, sigaddset, sigfillset, sigprocmask)
272 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
273 sigfillset, and sigprocmask are no longer no-ops.
274 (sigismember): New function.
275 (struct itimer_data): New definition.
276 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
277 (crit_prof): New static variables.
278 (MAX_SINGLE_SLEEP): New definition.
279 (timer_loop, stop_timer_thread, term_timers, init_timers)
280 (start_timer_thread, getitimer, setitimer): New functions.
281 (alarm): No longer a no-op, calls setitimer.
282
283 * w32.c (term_ntproc): Call term_timers.
284 (init_ntproc): Make sure all signals are unblocked at startup, to
285 erase any traces of dumping. Call init_timers.
286
287 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
288 Windows-specific code to display the hourglass mouse pointer is no
289 longer used.
290 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
291 to hourglass timer expiration.
292 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
293 Remove, no longer used.
294 (w32_note_current_window, show_hourglass, hide_hourglass):
295 New functions, in support of hourglass cursor display similar to other
296 window systems.
297 (syms_of_w32fns): Don't initialize hourglass_timer.
298
299 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
300 WINDOWSNT as well.
301 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
302
303 * w32.h (init_timers, term_timers): Add prototypes.
304
305 2012-09-30 Kenichi Handa <handa@gnu.org>
306
307 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
308 to the buffer relocation which may be caused by ccl_driver.
309
310 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
311
312 * xfns.c (Fx_file_dialog): Update comment.
313
314 * w32fns.c (Fx_file_dialog): Update comment.
315
316 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
317 Initialize panel name field if OSX >= 10.6.
318
319 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
320
321 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
322
323 * nsterm.m (NEW_STYLE_FS): New define.
324 (ns_fullscreen_hook, windowWillEnterFullScreen)
325 (windowDidEnterFullScreen, windowWillExitFullScreen)
326 (windowDidExitFullScreen, toggleFullScreen, handleFS)
327 (setFSValue): New functions.
328 (EmacsFSWindow): New implementation.
329 (canBecomeKeyWindow): New function for EmacsFSWindow.
330 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
331 (dealloc): Release nonfs_window if in fullscreen.
332 (updateFrameSize:): Call windowDidMove to update top/left.
333 (windowWillResize:toSize:): Check if frame is still maximized.
334 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
335 next_maximized, maximized_width, maximized_height and nonfs_window.
336 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
337 tbar_height.
338 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
339 fullscreen. Set maximized_width/height. Act on next_maximized.
340
341 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
342 (EmacsView): Add variables for fullscreen.
343 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
344 (EmacsFSWindow): New interface for fullscreen.
345
346 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
347
348 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
349
350 2012-09-30 Chong Yidong <cyd@gnu.org>
351
352 * fns.c (Frandom): Doc fix.
353
354 2012-09-30 Martin Rudalics <rudalics@gmx.at>
355
356 * window.c (Vwindow_combination_limit): New default value.
357 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
358
359 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
360
361 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
362 Suggested by Eli Zaretskii in
363 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
364
365 2012-09-30 Eli Zaretskii <eliz@gnu.org>
366
367 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
368 HAVE_TIMER_SETTIME is defined.
369
370 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
371
372 Profiler improvements: more-accurate timers, overflow checks.
373 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
374 signal.h, setjmp.h. Include systime.h instead.
375 (saturated_add): New function.
376 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
377 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
378 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
379 New static vars.
380 (enum profiler_cpu_running): New enum.
381 (profiler_cpu_running): Now of that enum type, not bool.
382 All uses changed to store the new value.
383 (handle_profiler_signal): Rename from sigprof_handler_1,
384 for consistency with other handlers. Do not check whether
385 cpu_log is a hash-table if garbage collecting, since it
386 doesn't matter in that case.
387 (deliver_profiler_signal): Rename from sigprof_handler,
388 for consistency with other handlers.
389 (setup_cpu_timer): New function, with much of what used to be in
390 Fprofiler_cpu_start. Check for out-of-range argument.
391 Prefer timer_settime if available, and prefer
392 thread cputime clocks, then process cputime clocks, then
393 monotonic clocks, to the old realtime clock. Use make_timeval
394 to round more-correctly when falling back to setitimer.
395 (Fprofiler_cpu_start): Use it.
396 (Fprofiler_cpu_stop): Prefer timer_settime if available.
397 Don't assume that passing NULL as the 2nd argument of setitimer
398 is the same as passing a pointer to all-zero storage.
399 Ignore SIGPROF afterwards.
400 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
401 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
402 non-fatal signal handlers. Ignore SIGPROF on startup.
403 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
404 in profiler.c, since sysdep.c now uses it.
405
406 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
407 Suggested by Eli Zaretskii in
408 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
409
410 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
411
412 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
413
414 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
415
416 * lisp.h (struct backtrace): Remove indirection for `function' field.
417 * xdisp.c (redisplay_internal):
418 * profiler.c (record_backtrace, sigprof_handler_1):
419 * alloc.c (Fgarbage_collect):
420 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
421 (Fbacktrace_frame): Adjust accordingly.
422
423 2012-09-28 Glenn Morris <rgm@gnu.org>
424
425 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
426 (Frun_hook_with_args_until_failure): Doc fixes.
427
428 2012-09-28 Eli Zaretskii <eliz@gnu.org>
429
430 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
431 Qautomatic_redisplay and change the symbol name. All users changed.
432
433 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
434
435 * profiler.c (sigprof_handler): Fix race condition.
436
437 2012-09-28 Glenn Morris <rgm@gnu.org>
438
439 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
440
441 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
442
443 Check more robustly for timer_settime.
444 * Makefile.in (LIB_TIMER_TIME): New macro.
445 (LIBES): Add it.
446 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
447 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
448 call timer_settime.
449
450 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
451
452 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
453
454 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
455
456 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
457
458 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
459
460 * character.h (MAYBE_UNIFY_CHAR): Remove.
461 * charset.c, charset.h (maybe_unify_char): Now static.
462 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
463 Since this stuff is now private to charset.c, there's no need for
464 a public macro and no need to inline by hand.
465
466 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
467 Stefan Monnier <monnier@iro.umontreal.ca>
468 Juanma Barranquero <lekktu@gmail.com>
469
470 * profiler.c: New file.
471 * Makefile.in (base_obj): Add profiler.o.
472 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
473 ($(BLD)/profiler.$(O)): New target.
474 * emacs.c (main): Call syms_of_profiler.
475 * alloc.c (Qautomatic_gc): New constant.
476 (MALLOC_PROBE): New macro.
477 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
478 (total_bytes_of_live_objects): New function.
479 (Fgarbage_collect): Use it. Record itself in backtrace_list.
480 Call malloc_probe for the memory profiler.
481 (syms_of_alloc): Define Qautomatic_gc.
482 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
483 race condition.
484 (struct backtrace): Move definition...
485 * lisp.h (struct backtrace): ..here.
486 (Qautomatic_gc, profiler_memory_running): Declare vars.
487 (malloc_probe, syms_of_profiler): Declare functions.
488 * xdisp.c (Qautomatic_redisplay): New constant.
489 (redisplay_internal): Record itself in backtrace_list.
490 (syms_of_xdisp): Define Qautomatic_redisplay.
491
492 2012-09-25 Eli Zaretskii <eliz@gnu.org>
493 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
494
495 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
496
497 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
498
499 Prefer POSIX timers if available.
500 They avoid a race if the timer is too close to the current time.
501 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
502 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
503 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
504
505 2012-09-25 Eli Zaretskii <eliz@gnu.org>
506
507 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
508 CHAR_STRING_ADVANCE.
509 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
510 STRING_CHAR_ADVANCE.
511
512 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
513
514 Move Vlibrary_cache to emacs.c and reset before dumping.
515
516 * lisp.h (reset_image_types): Declare.
517 [WINDOWSNT] (Vlibrary_cache): Declare.
518
519 * image.c (reset_image_types): New function.
520
521 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
522 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
523 (Fdump_emacs): Reset Vlibrary_cache and image_types.
524
525 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
526 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
527
528 * w32.h (Vlibrary_cache): Do not declare.
529
530 2012-09-25 Eli Zaretskii <eliz@gnu.org>
531
532 * w32proc.c (sys_signal): Handle all signals defined by the
533 MS-Windows runtime, not just SIGCHLD. Actually install the signal
534 handlers for signals supported by Windows. Don't override
535 term_ntproc as the handler for SIGABRT.
536 (sigaction): Rewrite to call sys_signal instead of duplicating its
537 code.
538 (sys_kill): Improve commentary.
539
540 * w32.c (term_ntproc): Accept (and ignore) one argument, for
541 consistency with a signature of a signal handler. All callers
542 changed.
543 (init_ntproc): Accept an argument DUMPING. If dumping, don't
544 install term_ntproc as a signal handler for SIGABRT, as that
545 should be done by the dumped Emacs.
546
547 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
548
549 * w32select.c (term_w32select): Protect against repeated
550 invocation by setting clipboard_owner to NULL after calling
551 DestroyWindow.
552
553 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
554 and term_ntproc to their modified signatures.
555
556 * character.c (char_string, string_char): Remove calls to
557 MAYBE_UNIFY_CHAR. See the discussion starting at
558 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
559 for the details.
560
561 2012-09-25 Chong Yidong <cyd@gnu.org>
562
563 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
564
565 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
566
567 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
568 when encountering an unknown bytecode.
569
570 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
571
572 image.c, indent.c: Use bool for booleans.
573 * dispextern.h (struct image_type): Members valid_p, load, init
574 now return bool, not int. All uses changed.
575 * image.c: Omit unnecessary static decls.
576 (x_create_bitmap_mask, x_build_heuristic_mask):
577 Return void, not int, since callers don't care about the return value.
578 (x_create_bitmap_mask, define_image_type, valid_image_p)
579 (struct image_keyword, parse_image_spec, image_spec_value)
580 (check_image_size, image_background)
581 (image_background_transparent, x_clear_image_1)
582 (postprocess_image, lookup_image, x_check_image_size)
583 (x_create_x_image_and_pixmap, xbm_image_p)
584 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
585 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
586 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
587 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
588 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
589 (png_image_p, init_png_functions, png_load_body, png_load)
590 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
591 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
592 (init_gif_functions, gif_load, imagemagick_image_p)
593 (imagemagick_load_image, imagemagick_load, svg_image_p)
594 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
595 (gs_load):
596 * nsimage.m (ns_load_image):
597 * nsterm.m (ns_defined_color):
598 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
599 * xfns.c (x_defined_color):
600 * xterm.c (x_alloc_lighter_color_for_widget)
601 (x_alloc_nearest_color_1, x_alloc_nearest_color)
602 (x_alloc_lighter_color):
603 * indent.c (disptab_matches_widthtab, current_column)
604 (scan_for_column, string_display_width, indented_beyond_p)
605 (compute_motion, vmotion, Fvertical_motion):
606 Use bool for booleans.
607
608 2012-09-24 Chong Yidong <cyd@gnu.org>
609
610 * chartab.c (Fset_char_table_default): Obsolete function removed.
611
612 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
613
614 Move pid_t related decls out of lisp.h.
615 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
616 (interruptible_wait_for_termination):
617 Move these decls from lisp.h to syswait.h, since they use pid_t.
618 Needed on FreeBSD; see Herbert J. Skuhra in
619 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
620 * callproc.c: Include syswait.h.
621
622 gnutls.c, gtkutil.c: Use bool for boolean.
623 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
624 (emacs_gnutls_handle_error):
625 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
626 (xg_hide_tooltip, xg_create_frame_widgets)
627 (create_dialog, xg_uses_old_file_dialog)
628 (xg_get_file_with_chooser, xg_get_file_with_selection)
629 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
630 (xg_item_label_same_p, xg_update_menubar)
631 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
632 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
633 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
634 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
635 (update_frame_tool_bar, free_frame_tool_bar):
636 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
637 * nsmenu.m (ns_update_menubar):
638 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
639 * xfns.c (Fx_show_tip) [USE_GTK]:
640 Use bool for boolean.
641 * gtkutil.c (xg_update_frame_menubar):
642 * xmenu.c (update_frame_menubar):
643 Return void, not int, since caller ignores return value.
644 * gtkutil.c (xg_change_toolbar_position):
645 Return void, not 1.
646
647 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
648
649 * makefile.w32-in (BLOCKINPUT_H): Remove.
650 (SYSSIGNAL_H): New macro.
651 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
652 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
653 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
654 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
655 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
656 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
657 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
658 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
659 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
660 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
661 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
662 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
663 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
664 ($(BLD)/w32xfns.$(O)): Update dependencies.
665
666 2012-09-23 Eli Zaretskii <eliz@gnu.org>
667
668 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
669 fatal_error_backtrace.
670
671 * w32proc.c (sys_kill): Undo last change: don't do anything when
672 invoked to deliver SIGABRT to our own process. This is now
673 handled by emacs_raise.
674
675 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
676
677 * w32term.c (w32_read_socket): Remove leftover reference to
678 interrupt_input_pending.
679
680 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
681
682 Do not use SA_NODEFER.
683 Problem reported by Dani Moncayo in
684 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
685 * alloc.c (die):
686 * sysdep.c (emacs_abort): Do not reset signal handler.
687 * emacs.c (terminate_due_to_signal): Reset signal handler here.
688 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
689 wanted even on POSIXish hosts, and it doesn't work on Windows.
690
691 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
692
693 * xterm.c (x_term_init): Call fixup_locale before and after calling
694 gtk_init (Bug#12392).
695
696 2012-09-23 Chong Yidong <cyd@gnu.org>
697
698 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
699 Vdynamic_library_alist.
700
701 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
702 (Fgnutls_available_p): Caller changed.
703
704 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
705 (Flibxml_parse_xml_region): Likewise.
706
707 * dispextern.h (struct image_type): Remove arg from init function.
708
709 * image.c (Finit_image_library, lookup_image_type)
710 (define_image_type): Remove now-unneeded second arg.
711 (init_xpm_functions, init_png_functions, init_jpeg_functions)
712 (init_tiff_functions, init_gif_functions, init_svg_functions):
713 Arglist and w32_delayed_load calling convention changed.
714 (gs_type): Remove init_gs_functions; there is no such function.
715 (valid_image_p, make_image): Fix caller to lookup_image_type.
716
717 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
718
719 Simplify and avoid signal-handling races (Bug#12471).
720 * alloc.c (die):
721 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
722 Avoid recursive loop if there's a fatal error in the function itself.
723 * atimer.c (pending_atimers):
724 * blockinput.h: Don't include "atimer.h"; no longer needed.
725 (interrupt_input_pending): Remove. All uses removed.
726 pending_signals now counts both atimers and ordinary interrupts.
727 This is less racy than having three separate pending-signal flags.
728 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
729 (input_blocked_p):
730 Rename from their upper-case counterparts BLOCK_INPUT,
731 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
732 INPUT_BLOCKED_P, and turn into functions. All uses changed.
733 This makes it easier to access volatile variables more accurately.
734 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
735 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
736 that's more reliable if the code is buggy and sets
737 interrupt_input_blocked to a negative value. All uses changed.
738 * atimer.c (deliver_alarm_signal):
739 Remove. No need to deliver this to the parent; any thread can
740 handle this signal now. All uses replaced by underlying handler.
741 * atimer.c (turn_on_atimers):
742 * dispnew.c (handle_window_change_signal):
743 * emacs.c (handle_danger_signal):
744 * keyboard.c (kbd_buffer_get_event):
745 Don't reestablish signal handler; not needed with sigaction.
746 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
747 (UNBLOCK_INPUT_TO):
748 Rework to avoid unnecessary accesses to volatile variables.
749 (UNBLOCK_INPUT_TO): Now a function.
750 (totally_unblock_input, unblock_input): New decls.
751 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
752 (init_data): Remove. Necessary stuff now done in init_signal.
753 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
754 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
755 (fatal_error_code): Remove; no longer needed.
756 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
757 it doesn't always backtrace. All uses changed. No need to reset
758 signal to default, since sigaction and/or die does that for us now.
759 Use emacs_raise (FOO), not kill (getpid (), FOO).
760 (main): Check more-accurately whether we're dumping.
761 Move fatal-error setup to sysdep.c
762 * floatfns.c: Do not include "syssignal.h"; no longer needed.
763 * gtkutil.c (xg_get_file_name, xg_get_font):
764 Remove no-longer-needed signal-mask manipulation.
765 * keyboard.c, process.c (POLL_FOR_INPUT):
766 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
767 * keyboard.c (read_avail_input): Remove.
768 All uses replaced by gobble_input.
769 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
770 (kbd_buffer_store_event_hold, gobble_input):
771 (record_asynch_buffer_change) [USABLE_SIGIO]:
772 (store_user_signal_events):
773 No need to mess with signal mask.
774 (gobble_input): If blocking input and there are terminals, simply
775 set pending_signals to 1 and return. All hooks changed to not
776 worry about whether input is blocked.
777 (process_pending_signals): Clear pending_signals before processing
778 them, in case a signal comes in while we're processing.
779 By convention callers now test pending_signals before calling us.
780 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
781 New functions, to support changes to blockinput.h.
782 (handle_input_available_signal): Now extern.
783 (reinvoke_input_signal): Remove. All uses replaced by
784 handle_async_input.
785 (quit_count): Now volatile, since a signal handler uses it.
786 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
787 All callers changed. Block SIGINT only if not already blocked.
788 Clear sigmask reliably, even if Fsignal returns, which it can.
789 Omit unnecessary accesses to volatile var.
790 (quit_throw_to_read_char): No need to restore sigmask.
791 * keyboard.c (gobble_input, handle_user_signal):
792 * process.c (wait_reading_process_output):
793 Call signal-handling code rather than killing ourselves.
794 * lisp.h: Include <float.h>, for...
795 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
796 (pending_signals): Now volatile.
797 (syms_of_data): Now const if IEEE floating point.
798 (handle_input_available_signal) [USABLE_SIGIO]:
799 (terminate_due_to_signal, record_child_status_change): New decls.
800 * process.c (create_process): Avoid disaster if memory is exhausted
801 while we're processing a vfork, by tightening the critical section
802 around the vfork.
803 (send_process_frame, process_sent_to, handle_pipe_signal)
804 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
805 ignores SIGPIPE.
806 (send_process): No need for setjmp/longjmp any more, since the
807 SIGPIPE stuff is now gone. Instead, report an error if errno
808 is EPIPE.
809 (record_child_status_change): Now extern. PID and W are now args.
810 Return void, not bool. All callers changed.
811 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
812 Remove. All uses removed. This bug should be fixed now in a
813 different way.
814 (wait_for_termination_1): Use waitpid rather than sigsuspend,
815 and record the child status change directly. This avoids the
816 need to futz with the signal mask.
817 (process_fatal_action): Move here from emacs.c.
818 (emacs_sigaction_flags): New function, containing
819 much of what used to be in emacs_sigaction_init.
820 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
821 caught by emacs, to make races less likely.
822 (deliver_process_signal): Rename from handle_on_main_thread.
823 All uses changed.
824 (BACKTRACE_LIMIT_MAX): Now at top level.
825 (thread_backtrace_buffer, threadback_backtrace_pointers):
826 New static vars.
827 (deliver_thread_signal, deliver_fatal_thread_signal):
828 New functions, for more-accurate delivery of thread-specific signals.
829 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
830 (deliver_arith_signal): Handle in this thread, not
831 in the main thread, since it's triggered by this thread.
832 (maybe_fatal_sig): New function.
833 (init_signals): New arg DUMPING so that we can be more accurate
834 about whether we're dumping. Caller changed.
835 Treat thread-specific signals differently from process-general signals.
836 Block all signals while handling fatal error; that's safer.
837 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
838 on IEEE hosts.
839 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
840 Ignore SIGPIPE unless batch.
841 (emacs_backtrace): Output backtrace for the appropriate thread,
842 which is not necessarily the main thread.
843 * syssignal.h: Include <stdbool.h>.
844 (emacs_raise): New macro.
845 * xterm.c (x_connection_signal): Remove; no longer needed
846 now that we use sigaction.
847 (x_connection_closed): No need to mess with sigmask now.
848 (x_initialize): No need to reset SIGPIPE handler here, since
849 init_signals does this for us now.
850
851 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
852
853 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
854 background rect may be larger (Bug#12245).
855
856 2012-09-23 Chong Yidong <cyd@gnu.org>
857
858 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
859
860 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
861
862 * .gdbinit: Just stop at fatal_error_backtrace.
863 See Stefan Monnier's request in
864 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
865 Remove no-longer-used query of system type.
866
867 2012-09-22 Chong Yidong <cyd@gnu.org>
868
869 * search.c (Freplace_match): Doc fix (Bug#12325).
870
871 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
872
873 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
874 (Fline_end_position): Doc fix.
875
876 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
877
878 2012-09-22 Chong Yidong <cyd@gnu.org>
879
880 * dispextern.h (struct image_type): Add new slot, storing a type
881 initialization function.
882
883 * image.c (define_image_type): Call the image initializer function
884 if it is defined. Arguments and return value changed.
885 (valid_image_p, make_image): Callers changed.
886 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
887 (gif_type, imagemagick_type, svg_type, gs_type):
888 Add initialization functions.
889 (Finit_image_library): Call lookup_image_type.
890 (CHECK_LIB_AVAILABLE): Macro deleted.
891 (lookup_image_type): Call define_image_type here, rather than via
892 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
893 (syms_of_image): Move define_image_type calls for xbm_type and
894 pbm_type to lookup_image_type.
895
896 2012-09-22 Eli Zaretskii <eliz@gnu.org>
897
898 * keyboard.c (timer_check_2): Move calculation of 'timers' and
899 'idle_timers' from here ...
900 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
901 lists, to avoid infloops when the timer does something stupid,
902 like reinvoke itself with the same or smaller time-out.
903 (Bug#12447)
904
905 2012-09-22 Martin Rudalics <rudalics@gmx.at>
906
907 * window.c (Fsplit_window_internal): Handle only Qt value of
908 Vwindow_combination_limit separately.
909 (Qtemp_buffer_resize): New symbol.
910 (Vwindow_combination_limit): New default value.
911 Rewrite doc-string.
912
913 2012-09-22 Eli Zaretskii <eliz@gnu.org>
914
915 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
916 the new overlay string. (Bug#10159)
917
918 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
919
920 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
921 or that fprintf is async-signal-safe. POSIX doesn't require
922 either assumption.
923
924 2012-09-22 Chong Yidong <cyd@gnu.org>
925
926 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
927 (Bug#8207).
928
929 2012-09-22 Kenichi Handa <handa@gnu.org>
930
931 * composite.c (composition_reseat_it): Handle the case that a
932 grapheme cluster is not covered by a single font (Bug#12352).
933
934 2012-09-21 Chong Yidong <cyd@gnu.org>
935
936 * image.c (define_image_type): Avoid adding duplicate types to
937 image_types (Bug#12463). Suggested by Jörg Walter.
938
939 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
940
941 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
942 (print_load_command_name): Add case LC_DATA_IN_CODE.
943 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
944
945 2012-09-21 Glenn Morris <rgm@gnu.org>
946
947 * eval.c (Frun_hook_with_args_until_success)
948 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
949
950 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
951
952 * fileio.c (Ffile_selinux_context): Only call freecon when
953 lgetfilecon succeeded.
954 (Fset_file_selinux_context): Likewise. (Bug#12444)
955
956 2012-09-21 Eli Zaretskii <eliz@gnu.org>
957
958 * xdisp.c (try_window_reusing_current_matrix): Under bidi
959 reordering, locate the cursor by calling set_cursor_from_row; if
960 that fails, clear the desired glyph matrix before returning a
961 failure indication to the caller. Fixes leaving garbled display
962 when fast scrolling with a down-key. (Bug#12403)
963 (compute_stop_pos_backwards): Fix a typo that caused crashes while
964 scrolling through multibyte text.
965
966 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
967
968 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
969 calling mark_vectorlike since that's the one that marks the window.
970 (mark_discard_killed_buffers): Mark the final cdr.
971 * window.h (struct window): Move prev/next_buffers to the
972 non-standard fields.
973 * window.c (make_window): Initialize prev/next_buffers manually.
974
975 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
976
977 Omit unused arg EXPECTED from socket hooks.
978 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
979 * nsterm.m (ns_term_init):
980 * termhooks.h (struct terminal.read_socket_hook):
981 * w32inevt.c (w32_console_read_socket):
982 * w32term.c (w32_read_socket):
983 * xterm.c (XTread_socket):
984 Omit unused arg EXPECTED. All callers changed.
985 (store_user_signal_events): Return void, not int, since callers no
986 longer care about the return value. All uses changed.
987
988 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
989
990 * w32gui.h (XParseGeometry): Do not declare.
991
992 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
993
994 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
995 Ignore 'expected'. See Eli Zaretskii in
996 <http://bugs.gnu.org/12471#8> (last line).
997
998 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
999 (XParseGeometry): Now static. Substitute extremal values for
1000 values that are out of range.
1001
1002 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1003
1004 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1005
1006 * nsfns.m (XParseGeometry): Remove.
1007 (Fx_create_frame): Call x_set_offset to correctly interpret
1008 top_pos in geometry.
1009
1010 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1011 (Fx_parse_geometry): If there is a space in string, call
1012 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1013
1014 2012-09-17 Eli Zaretskii <eliz@gnu.org>
1015
1016 * search.c (scan_buffer): Use character positions in calls to
1017 region_cache_forward and region_cache_backward, not byte
1018 positions. (Bug#12196)
1019
1020 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1021 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1022
1023 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1024 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1025 emacs_blocked_malloc, now deleted.
1026
1027 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1028
1029 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1030 The workaround was for improving performance on Solaris 2.4, but
1031 is getting in the way now. Emacs will still work if someone is
1032 still running Solaris 2.4 in a museum somewhere; Sun dropped
1033 support for Solaris 2.4 in 2003.
1034 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1035 * process.c (create_process) [HAVE_WORKING_VFORK]:
1036 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1037 since Emacs no longer uses vfork on that platform.
1038
1039 2012-09-17 Glenn Morris <rgm@gnu.org>
1040
1041 * emacs.c: Use COPYRIGHT.
1042
1043 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1044
1045 Remove configure's --without-sync-input option (Bug#12450).
1046 When auditing signal-handling in preparation for cleaning it up,
1047 I found that SYNC_INPUT has race conditions and would be a real
1048 pain to fix. Since it's an undocumented and deprecated
1049 configure-time option, now seems like a good time to remove it.
1050 Also see <http://bugs.gnu.org/11080#16>.
1051 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1052 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1053 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1054 (malloc_hysteresis):
1055 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1056 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1057 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1058 (dont_register_blocks, bytes_used_when_reconsidered)
1059 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1060 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1061 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1062 Remove. All uses removed.
1063 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1064 implementation, one that depends on whether the new macro
1065 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1066 is defined.
1067 * atimer.c (run_timers, handle_alarm_signal):
1068 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1069 (handle_async_input, process_pending_signals)
1070 (handle_input_available_signal, init_keyboard):
1071 * nsterm.m (ns_read_socket):
1072 * process.c (wait_reading_process_output):
1073 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1074 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1075 (emacs_write):
1076 * xterm.c (XTread_socket):
1077 Assume SYNC_INPUT.
1078 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1079 * eval.c (handling_signal): Remove. All uses removed.
1080 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1081 All uses replaced with the SYNC_INPUT version.
1082 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1083 Remove decls.
1084 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1085 Now static.
1086
1087 * font.c (Ffont_shape_gstring): Remove unused local.
1088
1089 2012-09-16 Glenn Morris <rgm@gnu.org>
1090
1091 * Makefile.in (clean): No longer run nextstep's clean.
1092
1093 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1094 (ns_frag): Remove.
1095 (ns-app): Move here from ns.mk, and simplify.
1096 (clean): Simplify nextstep entry.
1097 * ns.mk: Remove file.
1098
1099 2012-09-17 Kenichi Handa <handa@gnu.org>
1100
1101 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1102 not covert the last few charactes.
1103
1104 2012-09-16 Kenichi Handa <handa@gnu.org>
1105
1106 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1107 here, but just check the validity of glyphs in the glyph-string.
1108
1109 2012-09-16 Martin Rudalics <rudalics@gmx.at>
1110
1111 * window.c (Fwindow_parameter, Fset_window_parameter):
1112 Accept any window as argument (Bug#12452).
1113
1114 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1115
1116 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1117 to ns_term_init to avoid memory leak.
1118
1119 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1120 explicit retain/release.
1121 (ns_term_init): Only allow one display. Initialize outerpool and
1122 ns_*_types.
1123
1124 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1125
1126 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1127 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1128 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1129 the Microsoft problem in a different way, by altering ../nt/config.nt.
1130
1131 2012-09-15 Eli Zaretskii <eliz@gnu.org>
1132
1133 * w32xfns.c:
1134 * w32uniscribe.c:
1135 * w32term.c:
1136 * w32select.c:
1137 * w32reg.c:
1138 * w32proc.c:
1139 * w32menu.c:
1140 * w32inevt.c:
1141 * w32heap.c:
1142 * w32font.c:
1143 * w32fns.c:
1144 * w32console.c:
1145 * w32.c:
1146 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1147 by lisp.h. This completes removal of setjmp.h inclusion
1148 erroneously announced in the previous commit. (Bug#12446)
1149
1150 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1151 more accurate.
1152
1153 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1154 not defined as a macro. The latter happens on MS-Windows.
1155 (Bug#12446)
1156
1157 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1158
1159 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1160 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1161 Some instances of '#include <setjmp.h>' removed, if the
1162 only reason for the instance was because "lisp.h" was included.
1163 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1164 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1165 and _longjmp with the new symbols. Emacs already uses _setjmp if
1166 available, so this change affects only POSIXish hosts that have
1167 sigsetjmp but not _setjmp, such as some versions of Solaris and
1168 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1169 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1170 (png_load_body) [HAVE_PNG]:
1171 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1172 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1173 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1174 since PNG requires jmp_buf. This is the only exception to the
1175 general rule that we now use sys_setjmp and sys_longjmp.
1176 This exception is OK since this code does not change the signal
1177 mask or longjmp out of a signal handler.
1178
1179 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1180
1181 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1182 Include "syssignal.h", for 'main_thread'.
1183
1184 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1185
1186 Avoid out-of-range marker position (Bug#12426).
1187 * insdel.c (replace_range, replace_range_2):
1188 Adjust markers before overlays, as suggested by comments.
1189 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1190 Remove redundant check before calling offset_intervals.
1191
1192 2012-09-14 Martin Rudalics <rudalics@gmx.at>
1193
1194 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1195 current buffer (Bug#12387).
1196
1197 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
1198
1199 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1200
1201 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1202
1203 Use a more backwards-compatible timer format (Bug#12430).
1204 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1205 vector element, not from the 4th, since PSECS is now at the end.
1206 (Fcurrent_idle_time): Doc fix.
1207
1208 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1209
1210 Function to mark objects and remove killed buffers at once.
1211 * alloc.c (discard_killed_buffers): Rename to ...
1212 (mark_discard_killed buffers) ... new name. Add marking
1213 of remaining objects. Fix comment. Adjust users.
1214 (mark_object): Do not touch frame buffer lists here.
1215 * frame.c (delete_frame): Reset frame buffer lists here.
1216
1217 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1218
1219 Better workaround for GNOME bug when --enable-gcc-warnings.
1220 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1221 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1222 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1223
1224 Simplify SIGIO usage (Bug#12408).
1225 The code that dealt with SIGIO was crufty and confusing, e.g., it
1226 played tricks like "#undef SIGIO" but these tricks were not used
1227 consistently. Simplify mostly by not #undeffing standard symbols,
1228 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1229 or not as we please) rather than "defined SIGIO" (standard symbol
1230 that we probably shouldn't #undef).
1231 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1232 Modules that need it can include it.
1233 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1234 * dispextern.h (ignore_sigio): New decl.
1235 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1236 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1237 * emacs.c (shut_down_emacs):
1238 * keyboard.c (kbd_buffer_store_event_hold):
1239 Use ignore_sigio rather than invoking 'signal' directly.
1240 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1241 for FIONREAD.
1242 (FIONREAD, SIGIO): Do not #undef.
1243 (tty_read_avail_input): Use #error rather than a syntax error.
1244 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1245 for I_PIPE, used by SETUP_SLAVE_PTY.
1246 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1247 * sysdep.c (croak): Remove; no longer needed. This bit of
1248 temporary code, with Fred N. Fish's comment that it's temporary,
1249 has been in Emacs since at least 1992!
1250 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1251 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1252 * syssignal.h (croak): Remove decl.
1253 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1254 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1255 now that we're termios-only.
1256 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1257 * term.c (dissociate_if_controlling_tty): Use #error rather than
1258 a run-time error.
1259
1260 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1261 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1262 to work around GNOME bug 683906.
1263 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1264 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1265 This works around GCC bug 54561.
1266
1267 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1268
1269 More fixes for 'volatile' and setjmp/longjmp.
1270 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1271 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1272 (png_load_body) [HAVE_PNG]:
1273 (jpeg_load_body) [HAVE_JPEG]:
1274 New function, with most of the old parent function's body.
1275 (png_load) [HAVE_PNG]:
1276 (jpeg_load) [HAVE_JPEG]:
1277 Invoke the new function, to avoid longjmp munging our locals.
1278 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1279 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1280 longjmp is passed 2, as the C standard doesn't guarantee this.
1281 Instead, store the failure code into mgr->failure_code.
1282
1283 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1284
1285 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1286 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1287 (syms_of_keyboard): Remove support for unread-command-char.
1288
1289 2012-09-12 Eli Zaretskii <eliz@gnu.org>
1290
1291 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1292 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1293 violation. (Bug#12426)
1294
1295 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1296
1297 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1298
1299 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1300
1301 * eval.c: Add `inhibit-debugger'.
1302 (Qinhibit_debugger): New symbol.
1303 (call_debugger): Bind it instead of Qdebug_on_error.
1304 (maybe_call_debugger): Test Vinhibit_debugger.
1305 (syms_of_eval): Define inhibit-debugger.
1306 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1307 (syms_of_xdisp): Remove inhibit-debug-on-message.
1308
1309 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1310
1311 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1312 If a nonvolatile local variable is written before a _longjmp to
1313 the frame containing the variable, and is read after the _longjmp,
1314 the value read is indeterminate. Some local variables of type
1315 'struct handler' and 'struct catchtag' are used in this way, so
1316 mark each of their slots as volatile if the slot can be set before
1317 _longjmp and read afterwards.
1318 * lisp.h (struct handler): var and chosen_clause are now volatile.
1319 (struct catchtag): val, next, and pdlcount are now volatile.
1320
1321 * bidi.c (bidi_push_it, bidi_pop_it):
1322 * fns.c (copy_hash_table):
1323 * image.c (define_image_type):
1324 * keyboard.c (kbd_buffer_store_event_hold):
1325 * process.c (Fprocess_send_eof):
1326 * xfaces.c (x_create_gc) [HAVE_NS]:
1327 * xgselect.c (xg_select):
1328 Prefer assignment to memcpy when either will do.
1329
1330 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1331 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1332 time an item is removed. No need to mark this function 'inline';
1333 the compiler knows better than we do.
1334
1335 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1336
1337 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1338 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1339 to change_frame_size (Bug#12388).
1340 (windowDidResize:): Pass YES to updateFrameSize.
1341
1342 * nsterm.h: Add delay parameter to updateFrameSize.
1343
1344 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1345
1346 Discard killed buffers from deleted window and frame objects.
1347 This reduces an amount of references to killed buffers and
1348 helps GC to reclaim them faster.
1349 * alloc.c (discard_killed_buffers): New function.
1350 (mark_object): Use it for deleted windows and frames.
1351 (mark_object): If symbol's value is set up for a killed buffer
1352 or deleted frame, restore it's global binding.
1353 * data.c (swap_in_global_binding): Add GC notice.
1354 (swap_in_symval_forwarding): Use convenient set_blv_where.
1355 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1356 * window.h: ... to here.
1357
1358 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1359
1360 Convenient macro to check whether the buffer is live.
1361 * buffer.h (BUFFER_LIVE_P): New macro.
1362 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1363 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1364
1365 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1366
1367 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1368 composition cases (Bug#12364).
1369
1370 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1371 overhang of succeeding glyphs overlapping box cursor.
1372
1373 * w32term.c (x_draw_glyph_string): Likewise.
1374
1375 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1376
1377 Simplify, document, and port floating-point (Bug#12381).
1378 The porting part of this patch fixes bugs on non-IEEE platforms
1379 with frexp, ldexp, logb.
1380 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1381 Now static.
1382 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1383 support, by removing commented-out code and briefly listing the
1384 C89 functions excluded. The commented-out stuff was confusing
1385 maintenance, e.g., we thought we needed cbrt but it was commented out.
1386 (logb): Remove decl; no longer needed.
1387 (isfinite): New macro, if not already supplied.
1388 (isnan): Don't replace any existing macro.
1389 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1390 are present on all C89 platforms.
1391 (Ffrexp): Do not special-case zero, as frexp does the right thing
1392 for that case.
1393 (Flogb): Do not use logb, as it doesn't have the desired meaning
1394 on hosts that use non-base-2 floating point. Instead, stick with
1395 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1396 frexp, to avoid getting an unspecified result.
1397
1398 * xdisp.c (Qinhibit_debug_on_message): Now static.
1399
1400 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1401
1402 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1403 NSBezierPath (Bug#12131).
1404
1405 2012-09-10 Chong Yidong <cyd@gnu.org>
1406
1407 * fns.c (Fdelq, Fdelete): Doc fix.
1408
1409 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1410
1411 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1412 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1413
1414 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1415
1416 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1417 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1418 Use it.
1419
1420 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1421
1422 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1423 left fringe if the window has a left margin. This avoids leaving
1424 traces of the cursor because its leftmost pixel is not drawn over.
1425
1426 * dispnew.c (update_window_line): When the left margin area of a
1427 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1428 that screen line. (Bug#12277)
1429
1430 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1431
1432 Assume C89 or later for math functions (Bug#12381).
1433 This simplifies the code, and makes it a bit smaller and faster,
1434 and (most important) makes it easier to clean up signal handling
1435 since we can stop worring about floating-point exceptions in
1436 library code. That was a problem before C89, but the problem
1437 went away many years ago on all practical Emacs targets.
1438 * data.c, image.c, lread.c, print.c:
1439 Don't include <math.h>; no longer needed.
1440 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1441 might be autoconfigured, as that never happens.
1442 * data.c (fmod):
1443 * doprnt.c (DBL_MAX_10_EXP):
1444 * print.c (DBL_DIG):
1445 Remove. C89 or later always defines these.
1446 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1447 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1448 (arith_error, domain_error, domain_error2):
1449 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1450 no longer needed -- we simply return what C returns. All uses removed.
1451 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1452 the wrapped code.
1453 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1454 Remove. All uses expanded, as these macros are no longer used
1455 more than once and are now more trouble than they're worth.
1456 (Ftan): Use tan, not sin / cos.
1457 (Flogb): Assume C89 frexp.
1458 (fmod_float): Assume C89 fmod.
1459 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1460 (init_floatfns): Remove. All uses removed.
1461
1462 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1463
1464 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1465 compositeToPoint for OSX < 10.6 (Bug#12390).
1466
1467 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1468
1469 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1470 This produces more-accurate results.
1471
1472 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1473
1474 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1475 changes (Bug#12088).
1476
1477 2012-09-08 Chong Yidong <cyd@gnu.org>
1478
1479 * syntax.c (Fstring_to_syntax): Doc fix.
1480
1481 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1482
1483 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1484 in the internal border.
1485 (x_set_window_size): Remove static variables and their usage.
1486 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1487 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1488 Remove fringe/internal border adjustment (Bug#11052).
1489 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1490 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1491 (ns_fix_rect_ibw): Remove.
1492 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1493 (ns_dumpglyphs_box_or_relief): Ditto.
1494 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1495 adjustment.
1496 (ns_dumpglyphs_image): Ditto.
1497 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1498 border adjustment.
1499 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1500 their usage. Add fringe_extended_p and its use as in other terms.
1501 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1502 scroll bar was removed.
1503 (updateFrameSize): New function.
1504 (windowDidResize): Move code to updateFrameSize and call it.
1505
1506 * nsterm.h (EmacsView): Add updateFrameSize.
1507
1508 2012-09-07 Chong Yidong <cyd@gnu.org>
1509
1510 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1511
1512 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1513
1514 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1515
1516 More signal-handler cleanup (Bug#12327).
1517 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1518 Problem introduced when merging patches. Noted by Eli Zaretskii in
1519 <http://bugs.gnu.org/12327#67>.
1520 * floatfns.c: Comment fix.
1521 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1522 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1523 and anyway the declaration is harmless even if SIGDANGER is not defined.
1524 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1525 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1526 source files not surprisingly expected syssignal.h to define, or
1527 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1528 Include <sys/ioctl.h>, for FIONREAD.
1529 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1530 This eliminates a problem whereby other files mysteriously had
1531 to include "syssignal.h" before including "systty.h" if they
1532 wanted to use "#ifdef SIGIO".
1533
1534 2012-09-07 Eli Zaretskii <eliz@gnu.org>
1535
1536 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1537
1538 * w32.c (sigemptyset): Empty the set.
1539 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1540
1541 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1542
1543 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1544
1545 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1546 (mark_object): Likewise for frame objects.
1547
1548 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1549
1550 * syssignal.h (handle_on_main_thread): Always declare,
1551 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1552 This ports to platforms without HAVE_PTHREAD.
1553
1554 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1555
1556 Signal-handler cleanup (Bug#12327).
1557 Emacs's signal handlers were written in the old 4.2BSD style with
1558 sigblock and sigmask and so forth, and this led to some
1559 inefficiencies and confusion. Rewrite these to use
1560 pthread_sigmask etc. without copying signal sets around. Also,
1561 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1562 'signal', and instead use functions that do not attempt to take
1563 over the system name space. This patch causes Emacs's text
1564 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1565 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1566 Do not include <signal.h> or "syssignal.h", as these
1567 modules do not use signals.
1568 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1569 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1570 Do not include <signal.h>, as "syssignal.h" does that for us now.
1571 * atimer.c (sigmask_atimers): New function.
1572 (block_atimers, unblock_atimers): New functions,
1573 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1574 All uses replaced.
1575 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1576 no longer needed here.
1577 * emacs.c (main): Inspect existing signal handler with sigaction,
1578 so that there's no need to block and unblock SIGHUP.
1579 * sysdep.c (struct save_signal): New member 'action', replacing
1580 old member 'handler'.
1581 (save_signal_handlers, restore_signal_handlers):
1582 Use sigaction instead of 'signal' to save and restore.
1583 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1584 New function. All users of 'signal' modified to use set_sighandler
1585 if they're writeonly, and to use sys_signal if they're read+write.
1586 (emacs_sigaction_init, forwarded_signal): New functions.
1587 (sys_signal): Remove. All uses replaced by calls to sigaction
1588 and emacs_sigaction_init, or by direct calls to 'signal'.
1589 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1590 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1591 all uses replaced by pthread_sigmask etc. calls.
1592 * syssignal.h: Include <signal.h>.
1593 (emacs_sigaction_init, forwarded_signal): New decls.
1594 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1595 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1596 (sigmask, sys_sigmask): Remove; no longer needed.
1597 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1598 (sigblock, sigunblock, sigfree):
1599 (sigsetmask) [!defined sigsetmask]:
1600 Remove. All uses replaced by pthread_sigmask.
1601 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1602 no longer need to be replaced, and its typical old uses
1603 are now done via emacs_sigaction_init and sigaction.
1604 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1605 (sys_sigdel): Remove; unused.
1606 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1607
1608 2012-09-06 Eli Zaretskii <eliz@gnu.org>
1609
1610 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1611 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1612
1613 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1614
1615 Explicitly mark buffer_defaults and buffer_local_symbols.
1616 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1617 mark_local_symbols here.
1618 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1619 since special buffers aren't marked here any more.
1620 (allocate_buffer): Chain new buffer with all_buffers here...
1621 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1622 not here.
1623 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1624 (syms_of_buffer): Remove staticpro of the above.
1625 (init_buffer_once): Set names for buffer_defaults and
1626 buffer_local_symbols.
1627
1628 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1629
1630 Use bool for booleans in font-related modules.
1631 * font.c (font_intern_prop, font_style_to_value)
1632 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1633 (generate_otf_features, font_check_otf_features, font_check_otf)
1634 (font_match_p, font_list_entities, font_at):
1635 * fontset.c (fontset_id_valid_p, reorder_font_vector
1636 (fontset_find_font, Fset_fontset_font)
1637 (face_suitable_for_char_p) [0]:
1638 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1639 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1640 (m17n_flt_initialized, ftfont_shape_by_flt):
1641 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1642 * nsfont.m (nsfont_draw):
1643 * w32font.c (w32font_draw):
1644 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1645 Use bool for booleans.
1646 * font.h: Adjust to above API changes.
1647 (struct font, struct font_driver, struct font_driver_list):
1648 Use bool for booleans.
1649 (struct font): Remove useless member encoding_type.
1650 All users removed.
1651 * fontset.c, xftfont.c: Omit unnecessary static decls.
1652
1653 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1654
1655 * alloc.c (mark_object): Revert window marking code
1656 since it's unsafe for the Fset_window_configuration.
1657
1658 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1659
1660 Fix race conditions with signal handlers and errno (Bug#12327).
1661 Be more systematic about preserving errno whenever a signal
1662 handler returns, even if it's not in the main thread. Do this by
1663 renaming signal handlers to distinguish between signal delivery
1664 and signal handling. All uses changed.
1665 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1666 * data.c (deliver_arith_signal): Rename from arith_error.
1667 * dispnew.c (deliver_window_change_signal): Rename from
1668 window_change_signal.
1669 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1670 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1671 * keyboard.c (deliver_input_available_signal): Rename from
1672 input_available_signal.
1673 (deliver_user_signal): Rename from handle_user_signal.
1674 (deliver_interrupt_signal): Rename from interrupt_signal.
1675 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1676 (deliver_child_signal): Rename from sigchld_handler.
1677 * atimer.c (handle_alarm_signal):
1678 * data.c (handle_arith_signal):
1679 * dispnew.c (handle_window_change_signal):
1680 * emacs.c (handle_fatal_signal, handle_danger_signal):
1681 * keyboard.c (handle_input_available_signal):
1682 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1683 * process.c (handle_pipe_signal, handle_child_signal):
1684 New functions, with the actual signal-handling code taken from the
1685 original respective signal handlers, sans the sporadic attempts to
1686 preserve errno, since that's now done by handle_on_main_thread.
1687 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1688 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1689 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1690 Move to sysdep.c.
1691 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1692 Move initialization of main_thread to sysdep.c's init_signals.
1693 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1694 our usage, and simplifies the mainline code.
1695 (record_child_status_change): New static function, as a helper
1696 for handle_child_signal, and with most of the old child handler's
1697 contents.
1698 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1699 (handle_child_signal): Use the above.
1700 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1701 Moved here from emacs.c.
1702 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1703 code moved here from emacs.c's main function.
1704 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1705 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1706 This lets callers save and restore errno properly.
1707
1708 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1709
1710 Remove redundant or unused things here and there.
1711 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1712 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1713 * editfns.c (Fcompare_buffer_substrings): Likewise.
1714 * frame.h (struct terminal, struct font_driver_list):
1715 Remove redundant declarations.
1716 * window.h (Qleft, Qright): Likewise.
1717
1718 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1719
1720 Do not mark objects from deleted buffers, windows and frames.
1721 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1722 (mark_object): Likewise for windows and frames.
1723
1724 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1725
1726 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1727 buffer_defaults and buffer_local_symbols as valid objects.
1728 Return special value to denote them.
1729
1730 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1731
1732 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1733 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1734 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1735 (file_name_absolute_p, Fsubstitute_in_file_name):
1736 (check_executable, check_writable, Ffile_accessible_directory_p)
1737 (Fset_file_selinux_context, Fdefault_file_modes)
1738 (Finsert_file_contents, choose_write_coding_system)
1739 (Fwrite_region, build_annotations, a_write, e_write)
1740 (Fdo_auto_save):
1741 * filelock.c (boot_time_initialized, get_boot_time)
1742 (get_boot_time_1, lock_file_1, within_one_second):
1743 * floatfns.c (in_float):
1744 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1745 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1746 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1747 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1748 * window.c (compare_window_configurations):
1749 Use bool for booleans.
1750 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1751 (Fdefault_file_modes): Now mode_t, not int, for modes.
1752 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1753 (internal_delete_file): Now returns void, not a (boolean) int,
1754 since nobody was looking at the return value.
1755 * lisp.h, window.h: Adjust to above API changes.
1756
1757 * xdisp.c (set_message): Simplify and reindent last change.
1758
1759 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
1760
1761 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1762
1763 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1764
1765 * eval.c (call_debugger): Make the function non-static so that we
1766 can call it from set_message.
1767
1768 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1769 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1770
1771 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1772
1773 Give more-useful info on a fatal error (Bug#12328).
1774 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1775 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1776 of doing the work ourselves.
1777 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1778 do most of the work.
1779 (fatal_error_backtrace): New function, taken from the guts
1780 of the old fatal_error_signal, but with a new option to output
1781 a backtrace.
1782 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1783 info about the signal than just its number.
1784 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1785 * sysdep.c: Include <execinfo.h>
1786 (emacs_backtrace): New function, taken partly from the previous
1787 code of the 'die' function.
1788 (emacs_abort): Call fatal_error_backtrace rather than abort.
1789
1790 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1791
1792 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1793 eager (load-time) macro-expansion.
1794 * lisp.mk (lisp): Add macroexp.
1795
1796 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1797
1798 Simplify redefinition of 'abort' (Bug#12316).
1799 Do not try to redefine the 'abort' function. Instead, redo
1800 the code so that it calls 'emacs_abort' rather than 'abort'.
1801 This removes the need for the NO_ABORT configure-time macro
1802 and makes it easier to change the abort code to do a backtrace.
1803 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1804 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1805 Remove; sysdep.c's emacs_abort now takes its place.
1806 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1807 'abort' changed to use 'emacs_abort'.
1808 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1809 (abort) [!defined abort]: Rename to ...
1810 (emacs_abort): ... new name.
1811 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1812 the place of the old 'abort' in emacs.c.
1813 * w32.c, w32fns.c (abort): Do not #undef.
1814 * w32.c (emacs_abort): Rename from w32_abort.
1815
1816 2012-09-04 Eli Zaretskii <eliz@gnu.org>
1817
1818 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1819 offsets[j].dv, since the y axis of the screen coordinates points
1820 down, while the y axis of the font definition coordinates points
1821 up. This fixes display of Arabic diacritics such as KASRA and
1822 KASRATAN. (Bug#11860)
1823
1824 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1825
1826 Be more systematic about _setjmp vs setjmp.
1827 * alloc.c (test_setjmp, mark_stack):
1828 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1829 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1830 (png_load, my_error_exit, jpeg_load):
1831 * process.c (send_process_trap, send_process):
1832 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1833 The underscored versions are up to 30x faster on some hosts.
1834 Formerly, the code used setjmp+longjmp sometimes and
1835 _setjmp+_longjmp at other times, with no particular reason to
1836 prefer setjmp+longjmp.
1837
1838 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1839
1840 Fix minor problem found by static checking.
1841 * buffer.c (Fdelete_all_overlays): Return nil.
1842
1843 2012-09-03 Martin Rudalics <rudalics@gmx.at>
1844
1845 * buffer.c (Fdelete_all_overlays): New function.
1846
1847 2012-09-03 Chong Yidong <cyd@gnu.org>
1848
1849 * gtkutil.c: Add extern decl for Qxft.
1850
1851 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1852
1853 * emacs.c, eval.c: Use bool for boolean.
1854 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1855 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1856 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1857 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1858 (main, decode_env_path, Fdaemon_initialized):
1859 * eval.c (call_debugger, Finteractive_p, interactive_p):
1860 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1861 (maybe_call_debugger, Fbacktrace):
1862 * process.c (read_process_output, exec_sentinel):
1863 Use bool for booleans.
1864 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1865 All callers changed.
1866 * eval.c (interactive_p): Omit always-true boolean argument
1867 EXCLUDE_SUBRS_P. All callers changed.
1868 * dispextern.h, lisp.h: Reflect above API changes.
1869 * firstfile.c (dummy): Use the address of 'main', whose signature
1870 won't change, instead of the address of 'initialize', whose
1871 signature just changed from int to bool.
1872 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1873 * msdos.c (fatal_error_in_progress): ... from here.
1874 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1875 of incrementing it.
1876 (redisplay_internal, unwind_redisplay): Simply clear
1877 REDISPLAYING_P when unwinding, instead of saving its previous,
1878 always-false value and then restoring it.
1879
1880 Clean up some extern decls.
1881 Mostly, this hoists extern decls out of .c files and into .h files.
1882 That way, we're more likely to catch errors if the interfaces change.
1883 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1884 declare xg_mark_data.
1885 * dispextern.h (x_frame_parm_handlers):
1886 * font.h (Qxft):
1887 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1888 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1889 (Qultra_bold, Qoblique, Qitalic):
1890 Move extern decl here from .c file.
1891 * alloc.c (xg_mark_data) [USE_GTK]:
1892 * doc.c (Qclosure):
1893 * eval.c (Qlexical_binding):
1894 * fns.c (time) [!HAVE_UNISTD_H]:
1895 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1896 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1897 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1898 * lread.c (Qinternal_interpreter_environment):
1899 * minibuf.c (Qbuffer):
1900 * process.c (QCfamily, QCfilter):
1901 * widget.c (free_frame_faces):
1902 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1903 * xfont.c (x_clear_errors):
1904 * xterm.c (x_frame_parm_handlers):
1905 Remove now-redundant extern decls.
1906 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1907 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1908 Now static.
1909 * xfaces.c: Remove unnecessary static decls.
1910 * xterm.c (updating_frame): Remove decl of nonexistent object.
1911
1912 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1913 when building globals.h, as the objects that are not built on
1914 this host are not needed to compile C files on this host.
1915
1916 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1917
1918 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1919
1920 * frame.h: Add missing prototype for x_wm_set_size_hint.
1921
1922 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1923
1924 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1925 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1926 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1927 (Fsubstitute_command_keys):
1928 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1929 (save_excursion_save, save_excursion_restore)
1930 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1931 (format_time_string, general_insert_function)
1932 (make_buffer_string, make_buffer_string_both)
1933 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1934 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1935 (copy_text, insert_1, insert_1_both, insert_from_string)
1936 (insert_from_string_before_markers, insert_from_string_1)
1937 (insert_from_buffer, insert_from_buffer_1, replace_range)
1938 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1939 (del_range_2, modify_region):
1940 * intervals.c (intervals_equal, balance_possible_root_interval)
1941 (adjust_intervals_for_insertion, merge_properties_sticky)
1942 (graft_intervals_into_buffer, lookup_char_property)
1943 (adjust_for_invis_intang, set_point_both)
1944 (get_property_and_range, compare_string_intervals)
1945 (set_intervals_multibyte_1, set_intervals_multibyte):
1946 * keyboard.c (decode_timer):
1947 Use bool for boolean.
1948 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1949 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1950
1951 2012-09-02 Chong Yidong <cyd@gnu.org>
1952
1953 * keymap.c (push_key_description): Print M-TAB as C-M-i
1954 (Bug#11758).
1955
1956 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1957
1958 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1959 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1960 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1961 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1962 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1963 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1964 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1965
1966 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1967
1968 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1969 more than one grapheme cluster passed to the shaper: compute the
1970 offset adjustment values separately for each cluster. (Bug#11860)
1971
1972 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1973 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1974 about implicit conversions from integer to pointer.
1975
1976 2012-09-01 Daniel Colascione <dancol@dancol.org>
1977
1978 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1979 system used too early.
1980
1981 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1982
1983 Better seed support for (random).
1984 * emacs.c (main): Call init_random.
1985 * fns.c (Frandom): Set the seed from a string argument, if given.
1986 Remove long-obsolete Gentzel cruft.
1987 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1988 (init_random): New function.
1989
1990 2012-09-01 Daniel Colascione <dancol@dancol.org>
1991
1992 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1993 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1994 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1995 x_wm_set_size_hint, x_query_colors, x_real_positions,
1996 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1997 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1998 all of which have been moved to common code.
1999
2000 * xfaces.c: Include TERM_HEADER instead of listing all possible
2001 window-system headers.
2002
2003 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2004 to match header.
2005
2006 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2007 directly accessing frame internals.
2008
2009 * w32font.h: Include font.h. Define syms_of_w32font and
2010 globals_of_w32font.
2011
2012 * process.c: Include TERM_HEADER instead of listing all possible
2013 window-system headers.
2014
2015 * nsterm.h: Remove declarations now in frame.h.
2016 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2017
2018 * menu.c: Include TERM_HEADER instead of listing all possible
2019 window-system headers.
2020
2021 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2022 window system.
2023
2024 * keyboard.c: Include TERM_HEADER instead of listing all possible
2025 window-system headers.
2026
2027 * image.c: Include TERM_HEADER instead of listing all possible
2028 window-system headers. Declare Vlibrary_cache when compiling for
2029 Windows.
2030
2031 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2032 window system declarations.
2033
2034 * frame.h: Move common functions here: set_frame_menubar,
2035 x_set_window_size, x_sync, x_get_focus_frame,
2036 x_set_mouse_position, x_set_mouse_pixel_position,
2037 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2038 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2039 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2040 x_activate_menubar, x_real_positions, x_bitmap_icon,
2041 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2042 and x_query_colors.
2043
2044 * frame.c: Include TERM_HEADER instead of listing all possible
2045 window-system headers.
2046
2047 * font.c: Include TERM_HEADER instead of listing all possible
2048 window-system headers.
2049
2050 * emacs.c: Include TERM_HEADER.
2051
2052 * dispnew.c: Include TERM_HEADER instead of listing all possible
2053 window-system headers.
2054
2055 * ccl.h: Include character.h.
2056
2057 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2058 the current window system; include in list of objects to link into
2059 Emacs.
2060
2061 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2062
2063 Remove mark_ttys function and fix tty_display_info initialization.
2064 * lisp.h (mark_ttys): Remove prototype.
2065 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2066 to mark_ttys because all possible values of 'top_frame' slot are
2067 the frames which are reachable from Vframe_list.
2068 * term.c (mark_ttys): Remove.
2069 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2070
2071 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2072
2073 Change struct frame bitfields from unsigned char to unsigned.
2074 * frame.h (struct frame): Change type of 'display_preempted',
2075 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2076 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2077 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2078 bitfields from unsigned char to unsigned.
2079
2080 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2081
2082 Remove unused member of struct x_output and struct w32_output.
2083 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2084 * w32term.h (struct w32_output): Likewise.
2085
2086 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2087
2088 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2089 does not become zero (Bug#12234).
2090
2091 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2092
2093 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2094 for GCC 4.7.1 x86-64.
2095
2096 2012-08-30 Glenn Morris <rgm@gnu.org>
2097
2098 * lread.c (init_lread): For out-of-tree builds, only add the
2099 source directory's site-lisp dir to the load-path if it exists,
2100 consistent with in-tree builds. (Bug#12302)
2101
2102 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2103
2104 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2105 button_values to NULL. Call setStykeMask so dialogs get a close button.
2106 (windowShouldClose:): Set window_closed.
2107 (dealloc): New member, free button_values.
2108 (process_dialog:): Make member function. Remove window argument,
2109 replace window with self. Count buttons and allocate and store values
2110 in button_values.
2111 (addButton:value:row:): value is int with the name tag. Call setTag
2112 with tag. Remove return self, declare return value as void.
2113 (addString:row:): Remove return self, declare return value as void.
2114 (addSplit): Remove return self, declare return value as void.
2115 (clicked:): Remove return self, declare return value as void.
2116 Set dialog_return to button_values[seltag]. Code formatting change.
2117 (initFromContents:isQuestion:): Adjust call to process_dialog.
2118 Code formatting change.
2119 (timeout_handler:): Set timer_fired to YES.
2120 (runDialogAt:): Set timer_fired to NO.
2121 Handle click on close button as quit.
2122
2123 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2124 Add window_closed and button_values. Add void as return value for
2125 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2126 Add process_dialog as new member.
2127
2128 2012-08-28 Eli Zaretskii <eliz@gnu.org>
2129
2130 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2131 is not one of the heaps we manage. (Bug#12242)
2132
2133 2012-08-28 Glenn Morris <rgm@gnu.org>
2134
2135 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2136
2137 2012-08-28 Martin Rudalics <rudalics@gmx.at>
2138
2139 * window.c (Fset_window_configuration): Remove handling of
2140 auto-buffer-name window parameter. Install revision of reverted
2141 fix.
2142
2143 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2144
2145 Do not allow to set major mode for a dead buffer.
2146 * buffer.c (Fset_buffer_major_mode): Signal an error
2147 if the buffer is dead.
2148 (Fother_buffer, other_buffer_safely): Remove redundant
2149 nested declaration.
2150
2151 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2152
2153 Always use set_buffer_if_live to restore original buffer at unwind.
2154 * buffer.h (record_unwind_current_buffer): New function.
2155 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2156 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2157 * undo.c, window.c: Adjust users.
2158 * buffer.c (set_buffer_if_live): Fix comment.
2159
2160 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2161
2162 Fix usage of set_buffer_internal.
2163 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2164 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2165 * coding.c (decode_coding): Omit redundant test.
2166 * fileio.c (decide_coding_unwind): Likewise.
2167 * fns.c (secure_hash): Likewise.
2168 * insdel.c (modify_region): Likewise.
2169 * keyboard.c (command_loop_1): Likewise.
2170 * print.c (PRINTFINISH): Likewise.
2171 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2172
2173 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2174
2175 * dispnew.c: Use bool for boolean.
2176 (frame_garbaged, display_completed, delayed_size_change)
2177 (fonts_changed_p, add_window_display_history)
2178 (add_frame_display_history, verify_row_hash)
2179 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2180 (row_equal_p, realloc_glyph_pool)
2181 (allocate_matrices_for_frame_redisplay)
2182 (showing_window_margins_p)
2183 (adjust_frame_glyphs_for_frame_redisplay)
2184 (build_frame_matrix_from_leaf_window, make_current)
2185 (mirrored_line_dance, mirror_line_dance, update_frame)
2186 (update_window_tree, update_single_window)
2187 (check_current_matrix_flags, update_window, update_text_area)
2188 (update_window_line, set_window_update_flags, scrolling_window)
2189 (update_frame_1, scrolling, buffer_posn_from_coords)
2190 (do_pending_window_change, change_frame_size)
2191 (change_frame_size_1, sit_for):
2192 Use bool for boolean.
2193 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2194 and remove last int (actually boolean) argument, which was always 0.
2195 All callers changed.
2196 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2197 * dispextern.h (struct composition_it): Use bool for boolean.
2198 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2199 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2200 * dired.c (file_name_completion):
2201 Use bool for boolean. (This was missed in an earlier change.)
2202
2203 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2204
2205 * window.c (Fset_window_configuration): Revert first part of
2206 last change.
2207
2208 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2209
2210 * nsterm.h (NSPanel): New class variable dialog_return.
2211
2212 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2213 Initialize dialog_return.
2214 (windowShouldClose:): Use stop instead of stopModalWithCode.
2215 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2216 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2217 event.
2218 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2219 modal loop returns.
2220
2221 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2222
2223 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2224 * composite.c (find_composition, composition_gstring_p)
2225 (composition_reseat_it, find_automatic_composition):
2226 * data.c (let_shadows_buffer_binding_p)
2227 (let_shadows_global_binding_p, set_internal, make_blv)
2228 (Fmake_variable_buffer_local, Fmake_local_variable)
2229 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2230 (cons_to_signed, arith_driver):
2231 * dbusbind.c (xd_in_read_queued_messages):
2232 * dired.c (directory_files_internal, file_name_completion):
2233 Use bool for booleans.
2234 * dired.c (file_name_completion):
2235 * process.h (fd_callback):
2236 Omit int (actually boolean) argument. It wasn't being used.
2237 All uses changed.
2238 * composite.h, lisp.h: Reflect above API changes.
2239
2240 * cmds.c, coding.c: Use bool for booleans.
2241 * cmds.c (move_point, Fself_insert_command):
2242 * coding.h (struct composition status, struct coding_system):
2243 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2244 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2245 (emacs_mule_char, decode_coding_emacs_mule)
2246 (encode_coding_emacs_mule, detect_coding_iso_2022)
2247 (decode_coding_iso_2022, encode_invocation_designation)
2248 (encode_designation_at_bol, encode_coding_iso_2022)
2249 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2250 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2251 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2252 (encode_coding_raw_text, detect_coding_charset)
2253 (decode_coding_charset, encode_coding_charset, detect_eol)
2254 (detect_coding, get_translation_table, produce_chars)
2255 (consume_chars, reused_workbuf_in_use)
2256 (make_conversion_work_buffer, code_conversion_save)
2257 (decode_coding_object, encode_coding_object)
2258 (detect_coding_system, char_encodable_p)
2259 (Funencodable_char_position, code_convert_region)
2260 (code_convert_string, code_convert_string_norecord)
2261 (Fset_coding_system_priority):
2262 * fileio.c (Finsert_file_contents):
2263 Use bool for booleans.
2264 * coding.h, lisp.h: Reflect above API changes.
2265 * coding.c: Remove unnecessary static function decls.
2266 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2267 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2268 not a boolean 'int', since callers never look at the return value.
2269 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2270 * coding.h (decoding_buffer_size, encoding_buffer_size)
2271 (emacs_mule_string_char): Remove unused extern decls.
2272 (struct iso_2022_spec, struct coding_system):
2273 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2274 (struct emacs_mule_spec): Remove unused field 'full_support'.
2275 All initializations removed.
2276 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2277
2278 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2279
2280 Fix spare memory change (Bug#12286).
2281 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2282 (valid_lisp_object_p): Likewise.
2283
2284 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2285
2286 * window.c (Fset_window_configuration): Record any window's old
2287 buffer if it's replaced (see Bug#8789). If the new current
2288 buffer doesn't appear in the selected window, go to its old
2289 point (Bug#12208).
2290
2291 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2292
2293 Special MEM_TYPE_SPARE to denote reserved memory.
2294 * alloc.c (enum mem_type): New memory type.
2295 (refill_memory_reserve): Use new type for spare memory.
2296 This prevents live_cons_p and live_string_p from incorrect
2297 detection of uninitialized objects from spare memory as live.
2298
2299 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2300
2301 Spelling fixes.
2302 * Makefile.in (.PHONY): versioclean -> versionclean.
2303
2304 Remove unused external symbols.
2305 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2306 * window.c (Qwindow_valid_p, decode_valid_window):
2307 Now static, not extern.
2308 * data.c (Qinterval): Remove; unused.
2309 (syms_of_data): Do not define 'interval'.
2310 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2311 * window.h (decode_valid_window):
2312 Remove decls.
2313
2314 * character.c, charset.c, chartab.c: Use bool for booleans.
2315 * character.c (lisp_string_width, string_count_byte8)
2316 (string_escape_byte8):
2317 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2318 (load_charset_map_from_file, map_charset_chars)
2319 (Fdefine_charset_internal, define_charset_internal)
2320 (Fdeclare_equiv_charset, find_charsets_in_text)
2321 (Ffind_charset_region, char_charset, Fiso_charset):
2322 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2323 (sub_char_table_set, sub_char_table_set_range)
2324 (char_table_set_range, optimize_sub_char_table)
2325 (map_sub_char_table):
2326 Use bool for boolean.
2327 * character.c (str_to_unibyte): Omit last boolean argument; it was
2328 always 0. All callers changed.
2329 * character.h, charset.h: Adjust to match previous changes.
2330 * character.h (char_printable_p): Remove decl of nonexistent function.
2331 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2332 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2333 are all boolean, so make them single-bit bitfields.
2334
2335 * lisp.h (ASET): Remove attempt to detect side effects.
2336 It was meant to be temporary and it often doesn't work,
2337 because when IDX has side effects the behavior of IDX==IDX
2338 is undefined. See Stefan Monnier in
2339 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2340
2341 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2342
2343 * lisp.h (functionp): New function (extracted from Ffunctionp).
2344 (FUNCTIONP): Use it.
2345 * eval.c (Ffunctionp): Use it.
2346
2347 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2348
2349 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2350 as that's faster and simpler than static storage. Don't bother
2351 with the g_main_context_query overhead if g_main_context_pending
2352 says no events are pending.
2353 (gfds, gfds_size): Remove these static vars.
2354 (xgselect_initialize): Remove; no longer needed.
2355 All uses and decls removed.
2356
2357 * emacs.c (fatal_error_signal_hook): Remove.
2358 All uses removed. This leftover from old code was always 0.
2359
2360 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2361 * casefiddle.c (casify_object, casify_region):
2362 * casetab.c (set_case_table):
2363 * category.c, category.h (word_boundary_p):
2364 * category.h (CHAR_HAS_CATEGORY):
2365 Use bool for booleans, instead of int.
2366
2367 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2368
2369 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2370
2371 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2372
2373 On assertion failure, print backtrace if available.
2374 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2375 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2376 * Makefile.in (LIB_EXECINFO): New macro.
2377 (LIBES): Use it.
2378
2379 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2380 * bytecode.c (exec_byte_code):
2381 * callint.c (check_mark, Fcall_interactively):
2382 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2383 (getenv_internal, sync_process_alive, call_process_exited):
2384 * lisp.h (USE_SAFE_ALLOCA):
2385 Use bool for booleans, instead of int.
2386 * lisp.h, process.h: Adjust prototypes to match above changes.
2387 * callint.c (Fcall_interactively): Don't assume the mark's
2388 offset fits in 'int'.
2389
2390 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2391
2392 * buffer.c, buffer.h: Use bool for boolean.
2393 * buffer.c (reset_buffer_local_variables)
2394 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2395 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2396 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2397 (overlay_touches_p, overlay_strings, Foverlay_put)
2398 (report_overlay_modification, call_overlay_mod_hooks):
2399 (mmap_enlarge, mmap_set_vars):
2400 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2401 Use bool for booleans, instead of int.
2402 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2403 since the 1-or-0 return value is always ignored anyway.
2404 (mmap_initialized_p):
2405 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2406 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2407
2408 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2409
2410 * bidi.c: Use bool for boolean.
2411 This is a bit more readable, and makes the text segment of bidi.o
2412 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2413 Presumably it's faster too.
2414 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2415 Now bool.
2416 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2417 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2418 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2419 (bidi_explicit_dir_char, bidi_level_of_next_char)
2420 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2421 Use bool for booleans, instead of int.
2422 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2423 (bidi_unshelve_cache): Adjust decls to match code.
2424
2425 2012-08-23 Martin Rudalics <rudalics@gmx.at>
2426
2427 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2428 argument.
2429
2430 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2431
2432 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2433 * atimer.h: Include <stdbool.h>.
2434
2435 2012-08-22 Dan Nicolaescu <dann@gnu.org>
2436
2437 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2438 compile time tests instead of run time tests on systems that do
2439 not use them.
2440 (FRAME_MAC_P): Remove leftover from deleted code.
2441 * frame.c (syms_of_frame): Remove leftover from deleted code.
2442
2443 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2444
2445 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2446
2447 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2448
2449 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2450 Otherwise, the compiler complains about (A?B:C) where B is void
2451 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2452 (fontset_add): Return void, for FONTSET_ADD.
2453
2454 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2455
2456 * alloc.c: Use bool for booleans.
2457 (gc_in_progress, abort_on_gc)
2458 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2459 (dont_register_blocks) [GC_MALLOC_CHECK]:
2460 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2461 (check_string_bytes, make_specified_string, memory_full)
2462 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2463 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2464 (mark_stack, valid_pointer_p, make_pure_string)
2465 (Fgarbage_collect, survives_gc_p, gc_sweep):
2466 Use bool for booleans, instead of int.
2467 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2468 Remove unused local.
2469 * alloc.c (PURE_POINTER_P):
2470 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2471 * editfns.c (Fformat):
2472 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2473 (Fdo_auto_save):
2474 * fns.c (sweep_weak_table):
2475 * lisp.h (suppress_checking, push_message, survives_gc_p)
2476 (make_pure_string, gc_in_progress, abort_on_gc):
2477 * lread.c (readchar, read1):
2478 * print.c (Fprin1_to_string):
2479 * xdisp.c (push_message):
2480 Use bool for booleans affected directly or indirectly by
2481 alloc.c's changes.
2482
2483 Make recently-introduced setters macros.
2484 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2485 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2486 (set_fontset_default, set_fontset_fallback): Rename from their
2487 upper-case counterparts, and make them functions rather than macros.
2488 This is more consistent with the other recently-introduced setters.
2489 These don't need to be inline, since they're local.
2490
2491 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2492
2493 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2494 the loop (Bug#12247).
2495
2496 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2497
2498 * lisp.h (vcopy): Use memcpy rather than our own loop.
2499 This fixes a performance regression introduced by the recent
2500 addition of vcopy. This means 'vcopy' will need to be modified
2501 for a copying collector, but that's OK. Also, tighten the
2502 checking in the assertion.
2503
2504 2012-08-21 Eli Zaretskii <eliz@gnu.org>
2505
2506 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2507 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2508 non-base glyph for the width of the base character, according to
2509 what x_draw_composite_glyph_string_foreground expects.
2510 Generate WADJUST value according to composition_gstring_width's
2511 expectations, to produce correct width of the composed character.
2512 Reverse the sign of the DU offset produced by ScriptPlace.
2513
2514 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2515
2516 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2517
2518 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2519
2520 Avoid direct writes to contents member of struct Lisp_Vector.
2521 * lisp.h (vcopy): New function to copy data into vector.
2522 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2523 * fns.c (Ffillarray): Use ASET.
2524 * keyboard.c (timer_check_2): Use AREF and ASET.
2525 (append_tool_bar_item, Frecent_keys): Use vcopy.
2526 * lread.c (read_vector): Use ASET.
2527 * msdos.c (Frecent_doskeys): Use vcopy.
2528 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2529 (Finternal_merge_in_global_face): Use ASET and vcopy.
2530 * xfont.c (xfont_list_pattern): Likewise.
2531
2532 2012-08-21 Martin Rudalics <rudalics@gmx.at>
2533
2534 * window.c (Fwindow_point): For the selected window always return
2535 the position of its buffer's point.
2536 (Fset_window_point): For the selected window always go in its
2537 buffer to the specified position.
2538
2539 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2540
2541 Setter macros for fontsets.
2542 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2543 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2544 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2545 Adjust users.
2546
2547 2012-08-20 Glenn Morris <rgm@gnu.org>
2548
2549 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2550 Don't assume that `ln -f' works.
2551
2552 2012-08-20 Eli Zaretskii <eliz@gnu.org>
2553
2554 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2555 and later about non-assignments with no effect. See discussion at
2556 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2557 details.
2558
2559 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2560
2561 Inline setter functions for Lisp_Objects slots of struct specbinding.
2562 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2563 Adjust users.
2564
2565 2012-08-20 Martin Rudalics <rudalics@gmx.at>
2566
2567 * window.c (select_window): Always make selected window's buffer
2568 current.
2569
2570 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2571
2572 Use AREF and ASET for docstrings of category tables.
2573 * category.h (CATEGORY_DOCSTRING): Use AREF.
2574 (SET_CATEGORY_DOCSTRING): Use ASET.
2575 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2576
2577 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2578
2579 Inline setter functions for hash table members.
2580 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2581 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2582 (set_hash_key_and_value, set_hash_index, set_hash_next)
2583 (set_hash_hash): New functions.
2584 * charset.c, fns.c: Adjust users.
2585
2586 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2587
2588 Inline getter and setter functions for per-buffer values.
2589 * buffer.h (per_buffer_default, set_per_buffer_default)
2590 (per_buffer_value, set_per_buffer_value): New functions.
2591 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2592 * buffer.c, data.c: Adjust users.
2593
2594 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
2595
2596 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2597
2598 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2599
2600 Rely on <config.h> + <unistd.h> to declare 'environ',
2601 as gnulib does this if the system doesn't.
2602 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2603 Remove declaration. MS-Windows declares it on stdlib.h which is
2604 included by conf_post.h.
2605 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2606 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2607 * vm-limit.c: Include <unistd.h>, for 'environ'.
2608
2609 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2610 (start_of_data): Remove decl; mem-limits.h provides it.
2611
2612 * xdisp.c (handle_invisible_prop): Make it a bit faster
2613 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2614
2615 2012-08-19 Chong Yidong <cyd@gnu.org>
2616
2617 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2618 ends (Bug#3874).
2619
2620 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2621
2622 * .gdbinit: Use call instead of set when calling a function in the
2623 inferior.
2624
2625 * data.c (set_internal): Don't use set_blv_found.
2626 (Fkill_local_variable): Likewise.
2627
2628 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2629
2630 * nsfont.m (ns_ascii_average_width): Ensure the string
2631 ascii_printable is initialized with a null-terminated character
2632 array. Otherwise, it can contain undesired extra characters.
2633
2634 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2635
2636 port new setting code to Sun C 5.8 2005/10/13
2637 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2638 Return void, not Lisp_Object. Otherwise, the compiler
2639 complains about (A?B:C) where B is void and C is Lisp_Object
2640 when compiling CHAR_TABLE_SET, due to the recent change to
2641 the API of sub_char_table_set_contents.
2642
2643 2012-08-18 Chong Yidong <cyd@gnu.org>
2644
2645 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2646 for the string case (Bug#3874).
2647
2648 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2649
2650 * buffer.h (BSET): Remove (Bug#12215).
2651 Replace all uses with calls to new setter functions.
2652 (bset_bidi_paragraph_direction, bset_case_canon_table)
2653 (bset_case_eqv_table, bset_directory, bset_display_count)
2654 (bset_display_time, bset_downcase_table)
2655 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2656 (bset_last_selected_window, bset_local_var_alist)
2657 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2658 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2659 (bset_width_table):
2660 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2661 (bset_auto_fill_function, bset_auto_save_file_format)
2662 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2663 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2664 (bset_cache_long_line_scans, bset_case_fold_search)
2665 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2666 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2667 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2668 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2669 (bset_header_line_format, bset_indicate_buffer_boundaries)
2670 (bset_indicate_empty_lines, bset_invisibility_spec)
2671 (bset_left_fringe_width, bset_major_mode, bset_mark)
2672 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2673 (bset_name, bset_overwrite_mode, bset_pt_marker)
2674 (bset_right_fringe_width, bset_save_length)
2675 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2676 (bset_scroll_up_aggressively, bset_selective_display)
2677 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2678 (bset_word_wrap, bset_zv_marker):
2679 * category.c (bset_category_table):
2680 * syntax.c (bset_syntax_table):
2681 New setter functions.
2682
2683 * process.h (PSET): Remove (Bug#12215).
2684 Replace all uses with calls to new setter functions.
2685 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2686 (PROCESS_INLINE): New macro.
2687 (pset_childp): New setter function.
2688 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2689 * process.c (PROCESS_INLINE):
2690 Define to EXTERN_INLINE, so that the corresponding functions
2691 are compiled into code.
2692 (pset_buffer, pset_command, pset_decode_coding_system)
2693 (pset_decoding_buf, pset_encode_coding_system)
2694 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2695 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2696 (pset_type, pset_write_queue): New setter functions.
2697
2698 * window.h (WSET): Remove (Bug#12215).
2699 Replace all uses with calls to new setter functions.
2700 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2701 (WINDOW_INLINE): New macro.
2702 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2703 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2704 (wset_total_lines, wset_vertical_scroll_bar)
2705 (wset_window_end_pos, wset_window_end_valid)
2706 (wset_window_end_vpos): New setter functions.
2707 * window.c (WINDOW_INLINE):
2708 Define to EXTERN_INLINE, so that the corresponding functions
2709 are compiled into code.
2710 (wset_combination_limit, wset_dedicated, wset_display_table)
2711 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2712 (wset_new_normal, wset_new_total, wset_next_buffers)
2713 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2714 (wset_prev_buffers, wset_right_fringe_width)
2715 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2716 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2717 (wset_window_parameters):
2718 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2719 (wset_column_number_displayed, wset_region_showing):
2720 New setter functions.
2721
2722 * termhooks.h (TSET): Remove (Bug#12215).
2723 Replace all uses with calls to new setter functions.
2724 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2725 (TERMHOOKS_INLINE): New macro.
2726 (tset_charset_list, tset_selection_alist): New setter functions.
2727 * terminal.c (TERMHOOKS_INLINE):
2728 Define to EXTERN_INLINE, so that the corresponding functions
2729 are compiled into code.
2730 (tset_param_alist): New setter function.
2731
2732 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2733
2734 * keyboard.h (KSET): Remove (Bug#12215).
2735 Replace all uses with calls to new setter functions.
2736 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2737 (KEYBOARD_INLINE): New macro.
2738 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2739 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2740 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2741 New setter functions.
2742 * keyboard.c (KEYBOARD_INLINE):
2743 Define to EXTERN_INLINE, so that the corresponding functions
2744 are compiled into code.
2745 (kset_echo_string, kset_kbd_queue)
2746 (kset_keyboard_translate_table, kset_last_prefix_arg)
2747 (kset_last_repeatable_command, kset_local_function_key_map)
2748 (kset_overriding_terminal_local_map, kset_real_last_command)
2749 (kset_system_key_syms): New setter functions.
2750
2751 * frame.h (FSET): Remove (Bug#12215).
2752 Replace all uses with calls to new setter functions.
2753 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2754 (FRAME_INLINE): New macro.
2755 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2756 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2757 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2758 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2759 (fset_param_alist, fset_root_window, fset_scroll_bars)
2760 (fset_selected_window, fset_title, fset_tool_bar_items)
2761 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2762 * frame.c (FRAME_INLINE):
2763 Define to EXTERN_INLINE, so that the corresponding functions
2764 are compiled into code.
2765 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2766
2767 A few more naming-convention fixes for getters and setters.
2768 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2769 and rename from buffer_overlays_set_before.
2770 (set_buffer_overlays_after): Move here from buffer.h, and rename
2771 from buffer_overlays_set_after.
2772 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2773 All uses changed.
2774 (set_buffer_intervals): Rename from buffer_set_intervals.
2775 * intervals.c (set_interval_object): Move here from intervals.h,
2776 and rename from interval_set_object.
2777 (set_interval_left): Move here from intervals.h, and rename from
2778 interval_set_left.
2779 (set_interval_right): Move here from intervals.h, and rename from
2780 interval_set_right.
2781 (copy_interval_parent): Move here from intervals.h, and rename from
2782 interval_copy_parent.
2783 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2784 (set_interval_plist): Rename from interval_set_plist.
2785 Return void, not Lisp_Object, since no caller uses the result.
2786 * lisp.h (string_intervals): Rename from string_get_intervals.
2787 (set_string_intervals): Rename from string_set_intervals.
2788
2789 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2790 (set_char_table_contents): Rename from char_table_set_contents.
2791 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2792 All uses changed. See the end of
2793 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2794
2795 * lisp.h (CSET): Remove (Bug#12215).
2796 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2797 (set_char_table_purpose): New functions,
2798 replacing CSET. All uses changed. For example, replace
2799 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2800 "set_char_table_parent (char_table, parent);".
2801 The old version was confusing because it used the same name
2802 'parent' for two different things.
2803
2804 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2805
2806 Functions to get and set Lisp_Object fields of buffer-local variables.
2807 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2808 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2809 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2810 * data.c, eval.c, frame.c: Adjust users.
2811
2812 2012-08-17 Chong Yidong <cyd@gnu.org>
2813
2814 * xfaces.c (merge_face_vectors): If the target font specfies a
2815 font spec, make the font's attributes take precedence over
2816 directly-specified attributes.
2817 (merge_face_ref): Recognize :font.
2818
2819 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2820
2821 Do not use memcpy for copying intervals.
2822 * intervals.c (reproduce_interval): New function.
2823 (reproduce_tree, reproduce_tree_obj): Use it.
2824 (reproduce_tree_obj): Remove prototype.
2825
2826 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2827
2828 * lisp.h (duration_to_sec_usec): Remove unused decl.
2829
2830 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2831
2832 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2833 to an allocated instance of NSString, not to the class itself.
2834
2835 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
2836
2837 * makefile.w32-in (C_CTYPE_H): New macro.
2838 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2839 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2840 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2841
2842 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2843
2844 Use ASCII tests for character types.
2845 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2846 * xfns.c, xterm.c:
2847 Don't include <ctype.h>; was not needed.
2848 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2849 * sysdep.c, xfaces.c:
2850 Include <c-ctype.h> instead of <ctype.h>.
2851 * nsterm.m: Include <c-ctype.h>.
2852 * charset.c (read_hex):
2853 * doc.c (Fsnarf_documentation):
2854 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2855 (DRIVE_LETTER) [DOS_NT]:
2856 (Ffile_name_directory, Fexpand_file_name)
2857 (Fsubstitute_in_file_name):
2858 * font.c (font_parse_xlfd, font_parse_fcname):
2859 * frame.c (x_set_font_backend):
2860 * gtkutil.c (xg_get_font):
2861 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2862 * nsimage.m (hexchar):
2863 * nsterm.m (ns_xlfd_to_fontname):
2864 * sysdep.c (system_process_attributes):
2865 * xfaces.c (hash_string_case_insensitive):
2866 Use C-locale tests instead of locale-specific tests for character
2867 types, since we want the ASCII interpretation here, not the
2868 interpretation suitable for whatever happens to be the current locale.
2869
2870 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2871
2872 Consistently check windows for validity/liveness
2873 (Bug#11984, Bug#12025, Bug#12026).
2874 * lisp.h (CHECK_VALID_WINDOW): New macro.
2875 * window.c (decode_window): Rename to decode_live_window.
2876 (decode_valid_window, Fwindow_valid_p): New functions.
2877 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2878 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2879 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2880 (Fwindow_prev_sibling, Fwindow_combination_limit)
2881 (Fset_window_combination_limit, Fwindow_use_time)
2882 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2883 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2884 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2885 (Fwindow_hscroll, Fset_window_hscroll)
2886 (Fwindow_redisplay_end_trigger)
2887 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2888 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2889 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2890 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2891 (Fwindow_end, Fset_window_point, Fset_window_start)
2892 (Fpos_visible_in_window_p, Fwindow_line_height)
2893 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2894 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2895 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2896 (Fset_window_parameter, Fwindow_display_table)
2897 (Fset_window_display_table, Fdelete_other_windows_internal)
2898 (Fset_window_buffer, Fset_window_new_total)
2899 (Fset_window_new_normal, Fdelete_window_internal)
2900 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2901 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2902 (Fwindow_scroll_bars): Check whether argument window is a valid or
2903 live window. Update doc-strings.
2904 (syms_of_window): New symbol Qwindow_valid_p.
2905 * keyboard.c (Fposn_at_x_y): Check whether argument
2906 frame_or_window denotes a valid window.
2907
2908 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2909
2910 Fix previous char table change.
2911 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2912 * chartab.c (optimize_sub_char_table): Likewise.
2913
2914 2012-08-16 Chong Yidong <cyd@gnu.org>
2915
2916 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2917
2918 * xfont.c (xfont_open):
2919 * xftfont.c (xftfont_open): Set the font's max_width field.
2920
2921 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2922 min_width to space_width and average_width to the average over
2923 printable ASCII characters.
2924 (ns_char_width): Code cleanup.
2925 (ns_ascii_average_width): New utility function.
2926
2927 * font.h (struct font): Update comments.
2928
2929 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2930
2931 Simple interface to set Lisp_Object fields of character tables.
2932 * lisp.h (CSET): New macro.
2933 (char_table_set_extras, char_table_set_contents)
2934 (sub_char_table_set_contents): New function.
2935 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2936 * syntax.c: Adjust users.
2937
2938 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2939
2940 * eval.c (eval_sub): Bind lexical-binding.
2941 * lread.c (Qlexical_binding): Make non-static.
2942
2943 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2944
2945 * nsmenu.m (popupSession): Remove.
2946 (pop_down_menu): Remove endModalSession.
2947 (timeout_handler:): New method.
2948 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2949 Call runModalForWindow. Check timer_fired when it returns.
2950 If not set, cancel timer and break out of loop.
2951 Otherwise loop again, with a new timeout.
2952
2953 * nsterm.m: Include fcntl.h if present.
2954 (fd_entry, t_readfds, inNsSelect): Remove.
2955 (select_writefds, select_valid, select_timeout, selfds)
2956 (select_mutex, apploopnr): Add.
2957 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2958 Otherwise call kbd_buffer_store_event.
2959 (ns_send_appdefined): Remove release of fd_entry.
2960 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2961 Increment and decrement apploopnr.
2962 (ns_select): If no file descriptors, just do a NSTimer.
2963 Otherwise copy read/write masks and start select thread (fd_handler).
2964 Start main loop and wait for application defined event.
2965 Inform select thread to stop selecting after main loop is exited.
2966 (ns_term_init): Create selfds pipe and set non-blocking.
2967 Initialize select_mutex. Start the select thread (fd_handler).
2968 (fd_handler:): Loop forever, wait for info from the main thread
2969 to either start or stop selecting. When select returns, send
2970 and appdefined event.
2971 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2972 If not call kbd_buffer_store_event.
2973
2974 * nsterm.h (EmacsApp): fd_handler takes id argument.
2975 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2976
2977 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2978
2979 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2980
2981 * region-cache.c (move_cache_gap): Update gap_len using the actual
2982 growth of the boundaries array. Do not change cache_len.
2983 (Bug#12196)
2984
2985 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2986
2987 Generalize and cleanup font subsystem checks.
2988 * font.h (FONT_DEBUG, font_assert): Remove.
2989 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2990 Change font_assert to eassert. Use eassert where appropriate.
2991
2992 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2993
2994 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2995
2996 2012-08-15 Chong Yidong <cyd@gnu.org>
2997
2998 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2999 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3000 extract the font descriptor instead of just the font name.
3001 In that case, return a font spec instead of a string.
3002 (x_last_font_name): Move to this file from xfns.c.
3003
3004 * xfns.c (Fx_select_font): The return value can also be a font
3005 spec. Move x_last_font_name management to gtkutil.c.
3006
3007 * xfaces.c: Make font weight and style symbols non-static.
3008
3009 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3010
3011 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3012 (bug#12117).
3013
3014 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3015
3016 * alloc.c (Fgarbage_collect): Use plural form consistently.
3017
3018 2012-08-14 Eli Zaretskii <eliz@gnu.org>
3019
3020 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3021 iteration through the command loop. Fixes a problem whereby mouse
3022 movements are ignored until the first mouse click.
3023
3024 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3025
3026 Use bool, not int, for Lisp booleans.
3027 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3028 makes Emacs a bit smaller and presumably a bit faster.
3029 * lisp.h: Include <stdbool.h>.
3030 (struct Lisp_Boolfwd, defvar_bool):
3031 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3032 * regex.c [!emacs]: Include <stdbool.h>.
3033 (false, true): Remove; <stdbool.h> does this for us now.
3034
3035 2012-08-14 Chong Yidong <cyd@gnu.org>
3036
3037 * character.c (Fcharacterp): Doc fix (Bug#12076).
3038
3039 * data.c (Findirect_variable): Doc fix (Bug#11040).
3040
3041 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3042
3043 * editfns.c (Fformat): Doc fix (Bug#12059).
3044 (Fsave_current_buffer): Doc fix (Bug#11542).
3045
3046 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3047
3048 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3049 (bug#12022).
3050
3051 2012-08-14 Martin Rudalics <rudalics@gmx.at>
3052
3053 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3054 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3055 * minibuf.c (choose_minibuf_frame, read_minibuf):
3056 * w32fns.c (x_create_tip_frame):
3057 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3058 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3059
3060 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3061
3062 * intervals.c (offset_intervals): Remove obsolete comment.
3063
3064 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3065
3066 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3067
3068 2012-08-14 Gergely Risko <gergely@risko.hu>
3069
3070 * coding.c (decode_coding): Record buffer modification before
3071 disabling undo_list (Bug#11773).
3072
3073 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3074
3075 Revert and cleanup some recent overlay changes.
3076 * buffer.h (enum overlay_type): Remove.
3077 (buffer_get_overlays, buffer_set_overlays): Likewise.
3078 (buffer_set_overlays_before, buffer_set_overlays_after):
3079 New function. Adjust users.
3080 (unchain_both): Add eassert.
3081
3082 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3083
3084 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3085
3086 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3087
3088 * gtkutil.c (xg_mark_data): Don't assume C99.
3089
3090 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3091
3092 * gtkutil.c (xg_frame_tb_info): New struct.
3093 (TB_INFO_KEY): New define.
3094 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3095 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3096 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3097 if not present.
3098 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3099 is up to date. Otherwise store new data.
3100 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3101
3102 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3103
3104 Use KSET for write access to Lisp_Object members of struct kboard.
3105 * keyboard.h (KSET): New macro.
3106 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3107 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3108 * xterm.c: Adjust users.
3109
3110 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3111
3112 Use BSET for write access to Lisp_Object members of struct buffer.
3113 * buffer.h (BSET): New macro.
3114 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3115 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3116 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3117 * window.c, xdisp.c, xfns.c: Adjust users.
3118
3119 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3120
3121 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3122
3123 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3124
3125 * nsterm.m (not_in_argv): New function.
3126 (application:openFile, application:openTempFile:):
3127 (application:openFileWithoutUI:, application:openFiles:): Open file
3128 if not_in_argv returns non-zero (bug#12171).
3129
3130 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3131 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3132 Define for Gtk+ versions less than 3.2.
3133 (xg_get_font_name): Use those functions/macros here.
3134 Reported by Frans Oilinki <moilinki@gmail.com>.
3135
3136 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3137
3138 * unexmacosx.c (copy_data_segment): Copy initialized data in
3139 statically linked libraries from input file rather than memory.
3140
3141 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3142 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3143 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3144
3145 2012-08-10 Glenn Morris <rgm@gnu.org>
3146
3147 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3148 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3149
3150 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3151
3152 Fix last change to allow compilation with low optimization levels.
3153 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3154 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3155
3156 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3157
3158 Use common inline syntax in intervals.h.
3159 * intervals.h (INTERVALS_INLINE): New macro.
3160 Change all users from LISP_INLINE.
3161
3162 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3163
3164 Define Qnone once for all platforms.
3165 * frame.c (Qnone): Define here.
3166 (syms_of_frame): DEFSYM it.
3167 * lisp.h (Qnone): New declaration.
3168 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3169 * xfns.c: Remove duplication. Adjust users.
3170
3171 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3172
3173 Remove unused macros from intervals.h.
3174 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3175 * intervals.c: Adjust comment.
3176
3177 2012-08-10 Eli Zaretskii <eliz@gnu.org>
3178
3179 * w32fns.c <w32_unicode_gui>: New static variable.
3180 (globals_of_w32fns): Initialize it according to os_subtype.
3181 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3182 testing os_subtype.
3183
3184 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
3185 Eli Zaretskii <eliz@gnu.org>
3186
3187 Fix bug #10299 with Unicode characters sent by customized
3188 keyboards created by MSKLC.
3189 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3190 (w32_init_class): Use it to initialize the Emacs class with either
3191 ANSI or Unicode API calls.
3192 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3193 later.
3194 (w32_wnd_proc): If the character code sent by WM_CHAR or
3195 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3196 original message. Call DefWindowProcW on NT and later.
3197
3198 2012-08-10 Glenn Morris <rgm@gnu.org>
3199
3200 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3201
3202 * lisp.h (DIRECTORY_SEP): Let configure set it.
3203
3204 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3205
3206 Use TSET for write access to Lisp_Object slots of struct terminal.
3207 * termhooks.h (TSET): New macro.
3208 * coding.c, terminal.c, xselect.c: Adjust users.
3209
3210 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3211
3212 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3213 the failing expression, include them in the error message.
3214 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3215 * lisp.h (internal_condition_case_n): Update declaration.
3216
3217 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3218
3219 Inline functions to examine and change buffer overlays.
3220 * buffer.c (unchain_both): New function.
3221 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3222 (buffer_has_overlays): New function.
3223 (enum overlay_type): New enum.
3224 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3225 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3226
3227 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3228
3229 Inline functions to examine and change buffer intervals.
3230 * alloc.c (mark_interval_tree): Remove.
3231 (MARK_INTERVAL_TREE): Simplify.
3232 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3233 * intervals.c (buffer_balance_intervals): New function.
3234 (graft_intervals_into_buffer): Adjust indentation.
3235 (set_intervals_multibyte): Simplify.
3236 * buffer.h (BUF_INTERVALS): Remove.
3237 (buffer_get_intervals, buffer_set_intervals): New function.
3238 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3239 * intervals.c, textprop.c: Adjust users.
3240
3241 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3242
3243 Inline functions to examine and change string intervals.
3244 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3245 (string_get_intervals, string_set_intervals): New function.
3246 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3247 * lread.c, print.c, textprop.c: Adjust users.
3248
3249 2012-08-08 Glenn Morris <rgm@gnu.org>
3250
3251 * lisp.mk (lisp): Remove language/persian.elc.
3252
3253 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3254
3255 Cleanup intervals.
3256 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3257 (NULL_INTERVAL_P): Likewise. Adjust users.
3258 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3259 Adjust comment. Move under #if 0.
3260 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3261 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3262
3263 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3264
3265 Check total length of intervals with eassert.
3266 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3267 * intervals.c: Change all users to eassert.
3268
3269 2012-08-07 Eli Zaretskii <eliz@gnu.org>
3270
3271 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3272 Rename fields to match removal of FGET and WGET and disuse of
3273 INTERNAL_FIELD in Lisp_Cons.
3274
3275 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3276
3277 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3278 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3279 name since all xname users are fixed long time ago. Do not
3280 use INTERNAL_FIELD.
3281 (set_symbol_name, set_symbol_function, set_symbol_plist):
3282 (set_symbol_next, set_overlay_plist): New function.
3283 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3284 (struct Lisp_Overlay): Likewise.
3285 (CVAR, MVAR, SVAR): Remove.
3286 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3287 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3288 * xterm.c: Adjust users.
3289 * .gdbinit: Change to use name field of struct Lisp_Symbol
3290 where appropriate.
3291
3292 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3293
3294 Basic functions to set Lisp_Object and pointer slots of intervals.
3295 * intervals.h (interval_set_parent, interval_set_object):
3296 (interval_set_left, interval_set_right, interval_set_plist):
3297 (interval_copy_parent): New function.
3298 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
3299 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3300 Adjust indentation.
3301 (INTERVAL_SIZE): Remove. Adjust users.
3302 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3303
3304 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3305
3306 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3307 * process.h (PGET): Remove.
3308 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3309 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3310
3311 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3312
3313 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3314 * window.h (WGET): Remove.
3315 (struct window): Do not use INTERNAL_FIELD.
3316 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3317 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3318 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3319 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3320 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3321 Adjust users.
3322
3323 2012-08-07 Chong Yidong <cyd@gnu.org>
3324
3325 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3326 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3327 (Fdelete_window_internal): Signal an error if the window is not on
3328 a live frame (Bug#12025).
3329
3330 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3331
3332 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3333 * frame.h (FGET): Remove.
3334 (struct frame): Do not use INTERNAL_FIELD.
3335 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3336 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3337 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3338 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3339
3340 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
3341
3342 * w32.c: Silence compiler warnings.
3343 (map_w32_filename): Remove unused variable `is_fat'.
3344 (chase_symlinks): Add parentheses around expression.
3345
3346 2012-08-06 Glenn Morris <rgm@gnu.org>
3347
3348 * sysdep.c: Respect BROKEN_GETWD.
3349
3350 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3351 Let configure handle it.
3352 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3353
3354 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3355
3356 Use GCALIGNMENT where appropriate.
3357 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3358 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3359 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3360
3361 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3362
3363 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3364 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3365
3366 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3367
3368 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3369 that should be sufficient for everyone.
3370
3371 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3372
3373 * keyboard.c (timer_check_2): Add break so timer_check returns next
3374 timeout.
3375
3376 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3377
3378 Fix Windows build errors introduced after converting to WGET and WSET.
3379 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3380 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3381
3382 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3383
3384 * nsterm.m (ns_frame_rehighlight): Use FSET.
3385
3386 * nsmenu.m (ns_update_menubar): Use FSET.
3387
3388 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3389
3390 Separate read and write access to Lisp_Object slots of Lisp_Process.
3391 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3392 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3393
3394 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3395
3396 Separate read and write access to Lisp_Object slots of struct window.
3397 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3398 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3399 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3400 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3401 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3402 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3403 Adjust users.
3404
3405 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3406
3407 Fix Windows build errors introduced after converting to FGET and FSET.
3408 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3409 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3410 (w32_judge_scroll_bars): Change to use FSET.
3411 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3412
3413 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3414
3415 Fix replacement typo.
3416 * window.c (replace_window): Set root_window instead of
3417 selected_window. This fixes a total window subsystem
3418 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3419
3420 2012-08-06 Glenn Morris <rgm@gnu.org>
3421
3422 * lisp.mk (lisp): Add language/persian.elc.
3423
3424 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3425
3426 Separate read and write access to Lisp_Object slots of struct frame.
3427 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3428 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3429 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3430 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3431 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3432
3433 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3434
3435 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3436
3437 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3438
3439 Generalize common compile-time constants.
3440 * lisp.h (header_size, bool_header_size, word_size): Now here.
3441 (struct Lisp_Vector): Add comment.
3442 (struct Lisp_Bool_Vector): Move up to define handy constants.
3443 (VECSIZE, PSEUDOVECSIZE): Simplify.
3444 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3445 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3446 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3447 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3448 * xfont.c, xmenu.c: Use word_size where appropriate.
3449
3450 2012-08-05 Lawrence Mitchell <wence@gmx.li>
3451
3452 * search.c (Freplace_match): Treat \? in the replacement text
3453 literally (Bug#8161).
3454
3455 2012-08-05 Chong Yidong <cyd@gnu.org>
3456
3457 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3458 * frame.c (Vdelete_frame_functions):
3459 * emacs.c (Vkill_emacs_hook): Doc fix.
3460
3461 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3462
3463 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3464 --with-x-toolkit=no builds.
3465 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3466
3467 2012-08-04 Chong Yidong <cyd@gnu.org>
3468
3469 * syntax.c (Fmodify_syntax_entry): Doc fix.
3470
3471 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3472
3473 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3474 * w32.c (init_environment): Change the default values of many
3475 environment variables in dflt_envvars[] to NULL, to avoid pushing
3476 them into environment when they were not already defined.
3477 Remove the code that deletes site-lisp subdirectories from the default
3478 value of EMACSLOADPATH, as it is no longer needed.
3479 (check_windows_init_file): Now external, not static.
3480 Use Vload_path as is, without adding anything, as this function is now
3481 called when Vload_path is already set up.
3482
3483 * w32.h (check_windows_init_file): Add prototype.
3484
3485 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3486 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3487 compatibility with Posix platforms.
3488 (main): Move the call to check_windows_init_file to here from
3489 w32.c.
3490 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3491 any, in the DEFALT argument into the root of the Emacs build or
3492 installation tree, as appropriate.
3493
3494 * callproc.c (init_callproc_1): Call decode_env_path instead of
3495 doing its equivalent by hand.
3496 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3497 the code that sets Vexec_path run on MS-Windows.
3498
3499 * lread.c (init_lread): Add comments to #ifdef's.
3500
3501 * msdos.c (dos_set_window_size, IT_update_begin)
3502 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3503 instead of direct references.
3504
3505 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3506
3507 Export DEFAULT_REHASH_* to GDB.
3508 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3509 Now constants, not macros.
3510
3511 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3512
3513 Remove unnecessary casts involving pointers.
3514 These casts are no longer needed now that we assume C89 or later,
3515 since they involve casting to or from void *.
3516 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3517 (make_pure_float, make_pure_vector):
3518 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3519 * macros.c (Fstart_kbd_macro):
3520 * menu.c (find_and_return_menu_selection):
3521 * minibuf.c (read_minibuf_noninteractive):
3522 * sysdep.c (closedir):
3523 * xdisp.c (x_produce_glyphs):
3524 * xfaces.c (compare_fonts_by_sort_order):
3525 * xfns.c (x_real_positions, select_visual):
3526 * xselect.c (x_stop_queuing_selection_requests)
3527 (x_get_window_property, x_get_window_property_as_lisp_data):
3528 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3529 Remove unnecessary pointer casts.
3530 * alloc.c (record_xmalloc): New function.
3531 * lisp.h (record_xmalloc): New decl.
3532 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3533 more like a function. This is because the pointer cast is not
3534 needed. All uses changed.
3535 * print.c (print_string, print_error_message): Avoid length recalc.
3536
3537 Improve fix for macroexp crash with debugging (Bug#12118).
3538 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3539 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3540 not supposed to be invoked from the garbage collector.
3541 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3542 (gc_aset): New function, which is like ASET but can be
3543 used in the garbage collector.
3544 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3545 (set_hash_index): Use it instead of ASET.
3546
3547 2012-08-03 Eli Zaretskii <eliz@gnu.org>
3548
3549 Support symlinks on latest versions of MS-Windows.
3550 * w32.c: Include winioctl.h and aclapi.h.
3551 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3552 (revert_to_self): Forward declarations of static functions.
3553 <static BOOL g_b_init_get_security_info>:
3554 <g_b_init_create_symbolic_link>: New static flags.
3555 (globals_of_w32): Initialize them to zero.
3556 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3557 (map_w32_filename): Improve commentary. Simplify switch.
3558 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3559 headers (most versions of MinGW w32api don't).
3560 (get_security_info, create_symbolic_link)
3561 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3562 New functions.
3563 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3564 in the argument file name.
3565 (sys_access): Call unc_volume_file_attributes only if
3566 GetFileAttributes fails with network-related error codes.
3567 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3568 have the required privileges.
3569 (get_file_security_desc_by_name): Rename from
3570 get_file_security_desc.
3571 (stat_worker): New function, with most of the guts of 'stat', and
3572 with addition of handling of symlinks and support for 'lstat'.
3573 If possible, get file's attributes and security information by
3574 handle, not by name. Produce S_IFLNK bit for symlinks, when
3575 called from 'lstat'.
3576 (stat, lstat): New functions, call 'stat_worker'.
3577 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3578 symlinks when the underlying filesystem supports them.
3579
3580 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3581
3582 Fix macroexp crash on Windows with debugging (Bug#12118).
3583 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3584 checking subscripts; problem introduced with the recent
3585 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3586 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3587 since it's used in non-static inline functions now.
3588
3589 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3590 Don't assume buffer size fits in 'int'. Remove unused local.
3591
3592 Use C99-style 'extern inline' if available.
3593 * buffer.h (BUFFER_INLINE):
3594 * category.h (CATEGORY_INLINE):
3595 * character.h (CHARACTER_INLINE):
3596 * charset.h (CHARSET_INLINE):
3597 * composite.h (COMPOSITE_INLINE):
3598 * dispextern.h (DISPEXTERN_INLINE):
3599 * lisp.h (LISP_INLINE):
3600 * systime.h (SYSTIME_INLINE):
3601 New macro, replacing 'static inline' in this header.
3602 * buffer.h, category.h, character.h, charset.h, composite.h:
3603 * dispextern.h, lisp.h, systime.h:
3604 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3605 * alloc.c (LISP_INLINE):
3606 * buffer.c (BUFFER_INLINE):
3607 * category.c (CATEGORY_INLINE):
3608 * character.c (CHARACTER_INLINE):
3609 * charset.c (CHARSET_INLINE):
3610 * composite.c (COMPOSITE_INLINE):
3611 * dispnew.c (DISPEXTERN_INLINE):
3612 * sysdep.c (SYSTIME_INLINE):
3613 Define to EXTERN_INLINE, so that the corresponding functions
3614 are compiled into code.
3615 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3616 (INLINE_HEADER_END): New macros.
3617 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3618 since it's used in non-static inline functions now.
3619 (VALMASK) [!USE_LSB_TAG]: Likewise.
3620
3621 2012-08-02 Glenn Morris <rgm@gnu.org>
3622
3623 * s/: Remove empty directory.
3624
3625 * s/ms-w32.h: Move to ../nt/inc.
3626 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3627 Update for new ms-w32.h location.
3628
3629 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3630
3631 Port to Solaris 8.
3632 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3633
3634 2012-08-02 Glenn Morris <rgm@gnu.org>
3635
3636 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3637 hard-coding the path separator.
3638
3639 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3640
3641 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3642 This how ASET and AREF are supposed to work, and makes
3643 it easier to think about future improvements. See
3644 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3645 * charset.h (set_charset_attr): New function.
3646 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3647 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3648 (aref_addr): New function. All uses of &AREF(...) changed.
3649 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3650 (set_hash_index): New functions. All lvalue-style uses of
3651 HASH_KEY etc. changed.
3652 * keyboard.c (set_prop): New function. All lvalue-style uses
3653 of PROP changed.
3654
3655 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3656
3657 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3658 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3659 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3660 * nsfns.m (ns_set_name_as_filename): Likewise.
3661 * nsmenu.m (ns_update_menubar): Likewise.
3662 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3663
3664 2012-08-01 Eli Zaretskii <eliz@gnu.org>
3665
3666 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3667 Adapt to latest changes in field names of the corresponding Lisp
3668 objects.
3669
3670 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3671
3672 2012-08-01 Glenn Morris <rgm@gnu.org>
3673
3674 * s/msdos.h: Remove file.
3675 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3676 * Makefile.in (S_FILE): Remove.
3677 (config_h): Remove S_FILE.
3678
3679 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3680
3681 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3682 Remove; moved to nt/config.nt.
3683
3684 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3685
3686 Use INTERNAL_FIELD for conses and overlays.
3687 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3688 Remove obsolete comment.
3689 (MVAR): New macro.
3690 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3691 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3692
3693 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3694
3695 Use INTERNAL_FIELD for symbols.
3696 * lisp.h (SVAR): New macro. Adjust users.
3697 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3698 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3699
3700 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3701
3702 Use INTERNAL_FIELD for processes.
3703 * process.h (PVAR): New macro. Adjust style.
3704 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3705 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3706
3707 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3708
3709 Use INTERNAL_FIELD for windows.
3710 * window.h (WVAR): New macro.
3711 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3712 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3713 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3714 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3715 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3716 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3717
3718 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3719
3720 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3721
3722 2012-08-01 Glenn Morris <rgm@gnu.org>
3723
3724 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3725 Move to configure.ac.
3726
3727 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3728
3729 * makefile.w32-in (CONFIG_H): Update dependencies.
3730 (CONF_POST_H): New macro.
3731
3732 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3733
3734 2012-07-31 Glenn Morris <rgm@gnu.org>
3735
3736 * Makefile.in (S_FILE): No longer set by configure.
3737
3738 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3739 is available.
3740 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3741
3742 * process.h (NULL_DEVICE):
3743 * emacs.c (SEPCHAR):
3744 * editfns.c (USER_FULL_NAME): Let configure set them.
3745
3746 * s/README, s/template.h: Remove files.
3747
3748 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3749
3750 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3751 Move to configure.ac.
3752
3753 2012-07-31 Eli Zaretskii <eliz@gnu.org>
3754
3755 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3756 resulting renaming of 'struct frame' members.
3757
3758 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3759
3760 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3761 after introduction of FVAR.
3762
3763 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3764
3765 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3766
3767 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3768 instead of compositeToPoint.
3769 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3770
3771 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3772
3773 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3774
3775 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3776 * lisp.h (INTERNAL_FIELD): New macro.
3777 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3778 (BVAR): Change to use INTERNAL_FIELD.
3779 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3780 (KVAR): Change to use INTERNAL_FIELD.
3781 * frame.h (FVAR): New macro.
3782 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3783 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3784 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3785 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3786 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3787
3788 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3789
3790 Miscellaneous fixes for non-default X toolkits.
3791 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3792 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3793 Move under #ifdef USE_LUCID.
3794 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3795 definition and usage to avoid warnings.
3796
3797 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3798
3799 * nsterm.m (openFiles): Fix previous checkin.
3800
3801 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3802
3803 * indent.c (compute_motion): Remove unused local.
3804
3805 2012-07-31 Glenn Morris <rgm@gnu.org>
3806
3807 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3808
3809 * conf_post.h [USG5_4]:
3810 Move remaining contents of s/usg5-4-common.h here.
3811 * s/usg5-4-common.h: Remove file.
3812
3813 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3814 * s/irix6-5.h: Remove file.
3815
3816 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3817 * s/darwin.h: Remove file.
3818
3819 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3820 * s/hpux10-20.h: Remove file, which is now empty.
3821
3822 2012-07-30 Glenn Morris <rgm@gnu.org>
3823
3824 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3825 * Makefile.in (config_h): Add conf_post.h.
3826 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3827
3828 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3829
3830 * nsterm.m (ns_do_open_file): New variable.
3831 (ns_term_init): Set ns_do_open_file to YES after run returns.
3832 (openFile, openTempFile, openFileWithoutUI, openFiles):
3833 Open files only if ns_do_open_file.
3834
3835 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3836
3837 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3838 This no-op macro hasn't been needed for many years.
3839 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3840
3841 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3842 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3843 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3844 gdb_make_enums_visible.
3845 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3846 (DIRECTORY_SEP): Now a constant, not a macro.
3847
3848 2012-07-30 Eli Zaretskii <eliz@gnu.org>
3849
3850 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3851 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3852
3853 * w32term.c <w32_keyboard_codepage>: Renamed from
3854 keyboard_codepage and now external. All users changed.
3855
3856 * w32term.h: Add declaration of w32_keyboard_codepage.
3857
3858 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3859 the codepage to translate keys to Unicode. If this argument is
3860 -1, use the value returned by GetConsoleCP. All callers changed.
3861
3862 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3863
3864 Update .PHONY listings in makefiles.
3865 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3866 bootstrap-clean, distclean, maintainer-clean, versioclean,
3867 extraclean, frc.
3868
3869 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3870 This is a bit clearer. Fix some commentary typos.
3871
3872 2012-07-30 Glenn Morris <rgm@gnu.org>
3873
3874 * s/netbsd.h: Let configure include signal.h if needed.
3875 Remove file, which is now empty.
3876
3877 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3878 Let configure set them.
3879 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3880 No more need to undefine.
3881
3882 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3883
3884 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3885 non-single-byte char when adding meta modifier. (Bug#12090)
3886
3887 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3888
3889 Convert safe_call to use variable number of arguments.
3890 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3891 (safe_call2): Fix comment.
3892 * lisp.h (safe_call): Adjust prototype.
3893 * coding.c (encode_coding_object): Change to use safe_call2.
3894 * xfaces.c (merge_face_heights): Change to use safe_call1.
3895
3896 2012-07-30 Glenn Morris <rgm@gnu.org>
3897
3898 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3899 does that unconditionally. Remove file, which is now empty.
3900
3901 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3902 Remove empty files.
3903
3904 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3905
3906 Export to GDB most of lisp.h's remaining object-like macros.
3907 * lisp.h (min, max): Move earlier, because they're used earlier now.
3908 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3909 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3910 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3911 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3912 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3913 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3914 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3915 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3916 Now constants, for GDB. They need not be macros.
3917 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3918 Now constants, for GDB, as well as macros, for static initializers.
3919 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3920 Move to after the definition of struct Lisp_Char_Table,
3921 since the former now needs that type defined.
3922 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3923 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3924 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3925 New enums, for gdb_make_enums_visible.
3926 (GLYPH_MODE_LINE_FACE): Remove; unused.
3927 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3928 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3929 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3930 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3931 enum maxargs, enum MAX_ALLOCA.
3932 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3933 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3934 no longer needed, now that they are done in lisp.h.
3935
3936 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3937
3938 Cleanup string bytes checking.
3939 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3940 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3941 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3942 (check_sblock, compact_small_strings): Simplify.
3943
3944 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3945
3946 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3947 These macros are confusing and no longer need to be defined, as
3948 the enum values now suffice. All uses replaced with definiens.
3949 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3950
3951 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3952
3953 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3954 ($(BLD)/w32console.$(O)): Update dependencies.
3955
3956 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3957
3958 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3959 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3960 time. Adjust users.
3961 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3962
3963 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3964
3965 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3966 setting sitelisp (Bug#12010).
3967
3968 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3969
3970 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3971
3972 * w32heap.c (cache_system_info):
3973 * w32.c (sys_rename):
3974 * w32proc.c (find_child_console, sys_kill): All users changed.
3975
3976 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3977
3978 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3979
3980 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3981
3982 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3983
3984 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3985
3986 Cleanup statistics calculation in Fgarbage_collect.
3987 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3988 Fix zombies percentage calculation. Simplify elapsed time calculation.
3989
3990 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3991
3992 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3993 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3994 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3995 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3996 (replace_range, replace_range_2, del_range_2): Change to eassert.
3997 * marker.c (byte_char_debug_check): Adjust style.
3998
3999 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4000
4001 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4002 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4003 long-ago-commented-out code that talks about "WIN32".
4004 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4005 All uses changed.
4006
4007 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4008
4009 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4010 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4011 Simplify by using alignof.
4012 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4013 * lisp.h: Include <stdalign.h>.
4014 (GCALIGNMENT): New macro and constant.
4015 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4016 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4017 (stdalign): New macro, if not already defined.
4018
4019 2012-07-28 Eli Zaretskii <eliz@gnu.org>
4020
4021 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4022 * w32inevt.c: Include w32inevt.h.
4023 (w32_read_console_input): New inline function, calls either
4024 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4025 w32_console_unicode_input.
4026 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4027 (w32_kbd_patch_key, key_event): Use the codepage returned by
4028 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4029 (key_event): use uChar.UnicodeChar only if
4030 w32_console_unicode_input is non-zero.
4031
4032 * w32console.c: Include w32heap.h.
4033 <w32_console_unicode_input>: New global variable.
4034 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4035 family of Windows, zero otherwise.
4036
4037 * w32inevt.h: Declare w32_console_unicode_input.
4038
4039 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4040 --without-x. (Bug#11742)
4041
4042 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4043
4044 Adjust GDB to reflect pvec_type changes (Bug#12036).
4045 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4046 2012-07-04 changes to pseudovector representation.
4047 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4048
4049 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
4050
4051 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4052 bus address.
4053 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4054
4055 2012-07-27 Eli Zaretskii <eliz@gnu.org>
4056
4057 * alloc.c (listn): Fix the order the arguments are consed onto the
4058 list.
4059
4060 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4061 enumeration constants, as PURE and HEAP are too general, and clash
4062 with other headers and sources, such as gmalloc.c and the
4063 MS-Windows system headers. All users changed.
4064
4065 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4066
4067 Revert last save_excursion_save and save_excursion_restore changes.
4068 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4069 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4070
4071 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4072
4073 Fix recently-introduced typos in Windows port.
4074 Reported by Martin Rudalics <rudalics@gmx.at>.
4075 * w32.c (init_environment): Replace comma with semicolon.
4076 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4077
4078 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4079
4080 Improve GDB symbol export (Bug#12036).
4081 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4082 arms of an 'if', not using conditional expressions; otherwise GDB
4083 complains about the types in the unevaluated arm when the argument
4084 is an integer literal.
4085 (xgetint): Simplify expression.
4086 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4087 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4088 Zaretskii in <http://bugs.gnu.org/12036#13>.
4089 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4090 needed now that we have gdb_make_enums_visible.
4091 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4092 (enum enum_USE_LSB_TAG):
4093 New enum types, packaging up enums that need to be exported to GDB.
4094
4095 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4096
4097 Utility function to make a list from specified amount of objects.
4098 * lisp.h (enum constype): New datatype.
4099 (listn): New prototype.
4100 * alloc.c (listn): New function.
4101 (Fmemory_use_count, syms_of_alloc): Use it.
4102 * buffer.c (syms_of_buffer): Likewise.
4103 * callint.c (syms_of_callint): Likewise.
4104 * charset.c (define_charset_internal): Likewise.
4105 * coding.c (syms_of_coding): Likewise.
4106 * keymap.c (syms_of_keymap): Likewise.
4107 * search.c (syms_of_search): Likewise.
4108 * syntax.c (syms_of_syntax): Likewise.
4109 * w32.c (init_environment): Likewise.
4110 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4111 * xdisp.c (syms_of_xdisp): Likewise.
4112 * xfns.c (syms_of_xfns): Likewise.
4113
4114 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4115
4116 Fast save_excursion_save and save_excursion_restore.
4117 * lisp.h (struct Lisp_Excursion): New data type.
4118 (PVEC_EXCURSION): New pseudovector type.
4119 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4120 to deal with it. Adjust comments.
4121 (init_marker, attach_marker): New prototype.
4122 (unchain_marker): Adjust prototype.
4123 * marker.c (attach_marker): Change to global.
4124 (init_marker): New function.
4125 * alloc.c (Fmake_marker, build_marker): Use it.
4126 (build_marker): More easserts.
4127 (mark_object): Handle struct Lisp_Excursion.
4128 * editfns.c (save_excursion_save, save_excursion_restore):
4129 Reimplement to use struct Lisp_Excursion. Add comments.
4130
4131 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4132
4133 Fix export of symbols to GDB (Bug#12036).
4134 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4135 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4136 emacs.c, as this is a more-suitable home. Had this been done earlier
4137 the fix for 12036 would have avoided some of the problems noted in
4138 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4139 would have been more obvious.
4140 * emacs.c: Do not include <verify.h>; no longer needed.
4141 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4142 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4143 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4144 Remove; now done in lisp.h.
4145 * lisp.h (PUBLISH_TO_GDB): New macro.
4146 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4147 (DATA_SEG_BITS): Use it.
4148 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4149 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4150 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4151 not be usable in #if. This simplifies things.
4152
4153 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
4154
4155 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4156
4157 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4158
4159 Simplify export of symbols to GDB (Bug#12036).
4160 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4161 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4162 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4163 Adjust to changes in lisp.h and emacs.c, by using
4164 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4165 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4166 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4167 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4168 instead of gdb_valbits.
4169 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4170 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4171 instead of gdb_array_mark_flag.
4172 (xboolvector): Get size from $->size, not $->header.size.
4173 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4174 (xreload, hook-run, hookpost-run): Remove.
4175 * emacs.c: Include <verify.h>.
4176 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4177 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4178 Remove.
4179 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4180 (gdb_USE_LSB_TAG): New enum constants.
4181 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4182 Also define these as enum constants, so they're visible to GDB.
4183 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4184 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4185 as constants, so they're visible to GDB.
4186 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4187 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4188 Now enum constants, not macros, so they're visible to GDB.
4189 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4190 more convenient now. All uses changed.
4191 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4192 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4193
4194 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4195
4196 Explicitly free restriction data that are not needed anymore.
4197 * editfns.c (save_restriction_restore): Free restriction data.
4198
4199 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4200
4201 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4202 add argument, tune behavior, and adjust all callers.
4203
4204 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4205
4206 Use typedef for EMACS_INT, EMACS_UINT.
4207 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4208 than macros. This simplifies debugging in the usual case, since
4209 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4210 and it allows expressions involving EMACS_INT casts.
4211 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4212
4213 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4214
4215 * nsterm.m (ns_read_socket): Return early if there is a modal
4216 window (Bug#12043).
4217
4218 2012-07-25 Martin Rudalics <rudalics@gmx.at>
4219
4220 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4221 that FOCUS-FRAME can be omitted.
4222
4223 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4224
4225 Adjust buffer text indirection counters at the end of Fkill_buffer.
4226 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4227 buffer is definitely dead. This should really fix an issue reported
4228 by Christoph Scholtes again. (Bug#12007).
4229 (init_buffer_once): Initialize indirection counters of
4230 buffer_defaults and buffer_local_symbols (for sanity and safety).
4231
4232 2012-07-24 Eli Zaretskii <eliz@gnu.org>
4233
4234 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4235 and continuation glyphs on tooltip frames, leave them at zero.
4236 Avoids continued lines in tooltips. (Bug#11832)
4237
4238 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4239
4240 Simplify copy_overlay.
4241 * buffer.c (copy_overlay): Simplify. Use build_marker.
4242 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4243
4244 2012-07-23 Eli Zaretskii <eliz@gnu.org>
4245
4246 * print.c (print_object): Don't crash when a frame's name is nil
4247 or invalid. (Bug#12025)
4248
4249 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4250 it signals an error when a tooltip frame is being created.
4251
4252 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4253
4254 Cleanup miscellaneous objects allocation and initialization.
4255 * alloc.c (allocate_misc): Change to static. Add argument to
4256 specify the subtype. Adjust comment and users.
4257 (build_overlay): New function.
4258 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4259 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4260 (allocate_misc): Remove prototype.
4261 (build_overlay): Add prototype.
4262
4263 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4264
4265 Swap buffer text indirection counters in Fbuffer_swap_text.
4266 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4267 This avoids crash reported by Christoph Scholtes at
4268 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4269
4270 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4271
4272 * nsmenu.m (Popdown_data): New struct.
4273 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4274 free Popdown_data.
4275 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4276 (initWithContentRect): Make imgView and contentView non-static
4277 and autorelease them. Also autorelease img and matrix (Bug#12005).
4278 (dealloc): Remove (Bug#12005).
4279
4280 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4281
4282 Adjust consing_since_gc when objects are explicitly freed.
4283 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4284 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4285 (free_cons, free_misc): Subtract object size from consing_since_gc.
4286
4287 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4288
4289 Simplify and cleanup markers positioning code.
4290 * marker.c (attach_marker): More useful eassert.
4291 (live_buffer, set_marker_internal): New function.
4292 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4293 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4294
4295 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4296
4297 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4298 as it's limited by the amount of memory, not by INT_MAX.
4299
4300 2012-07-21 Eli Zaretskii <eliz@gnu.org>
4301
4302 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4303 in special-event-map. See the discussion at
4304 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4305 for the reasons.
4306
4307 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4308 info.dwItemData. Fixes crashes on 64-bit Windows.
4309 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4310
4311 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4312
4313 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4314 (conversationIdentifier): Return value is NSInteger.
4315 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4316
4317 2012-07-21 Chong Yidong <cyd@gnu.org>
4318
4319 * window.c (decode_any_window): Signal an error if the window is
4320 on a dead frame (Bug#11984).
4321
4322 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4323
4324 Add indirection counting to speed up Fkill_buffer.
4325 * buffer.h (struct buffer): New member.
4326 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4327 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4328 base buffer indirection counter.
4329 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4330 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4331 through buffer list if indirection counter is 0.
4332
4333 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4334
4335 Extend the value returned by Fgarbage_collect with heap statistics.
4336 * alloc.c (Qheap): New symbol.
4337 (syms_of_alloc): DEFSYM it.
4338 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4339 (Fmemory_free): Remove.
4340 (syms_of_alloc): Don't defsubr it.
4341 * buffer.c (Fcompact_buffer): Remove.
4342 (syms_of_buffer): Don't defsubr it.
4343
4344 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4345
4346 Make maybe_gc inline.
4347 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4348 * lisp.h (consing_since_gc, gc_relative_threshold)
4349 (memory_full_cons_threshold): Revert declaration.
4350 (maybe_gc): Remove prototype, define as inline.
4351 * alloc.c: Remove old commented-out code.
4352 (consing_since_gc, gc_relative_threshold)
4353 (memory_full_cons_threshold): Revert to global.
4354 (maybe_gc): Remove.
4355
4356 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4357
4358 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4359 * lisp.h (build_unibyte_string): New function.
4360 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4361 * sysdep.c, w32fns.c, xfns.c: Use it.
4362 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4363 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4364 Adjust users accordingly.
4365 * font.h (font_open_by_name): Adjust prototype.
4366
4367 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4368
4369 Cleanup calls to Fgarbage_collect.
4370 * lisp.h (maybe_gc): New prototype.
4371 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4372 Remove declarations.
4373 * alloc.c (maybe_gc): New function.
4374 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4375 Make them static.
4376 * bytecode.c (MAYBE_GC): Use maybe_gc.
4377 * eval.c (eval_sub, Ffuncall): Likewise.
4378 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4379 to avoid dependency from auto-save feature.
4380
4381 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4382
4383 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4384 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4385 'for_each_per_buffer_object_at'.
4386 All uses changed. It's better to use upper-case for macros that
4387 cannot be implemented as functions, to give the reader a clue
4388 that they're special.
4389
4390 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4391
4392 * alloc.c (Fgarbage_collect): Tweak docstring.
4393
4394 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4395
4396 Tweak the value returned from Fgarbage_collect again.
4397 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4398 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4399 Adjust documentation.
4400 (total_vector_bytes): Rename to total_vector_slots, adjust
4401 accounting.
4402 (total_free_vector_bytes): Rename to total_free_vector_slots,
4403 adjust accounting.
4404 (Qstring_bytes, Qvector_slots): New symbols.
4405 (syms_of_alloc): DEFSYM them.
4406
4407 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4408
4409 Buffer compaction primitive which may be used from Lisp.
4410 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4411 (syms_of_buffer): Register Fcompact_buffer.
4412 * alloc.c (Fgarbage_collect): Use compact_buffer.
4413 * buffer.h (compact_buffer): New prototype.
4414 (struct buffer_text): New member.
4415
4416 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4417
4418 New macro to iterate over all buffers, miscellaneous cleanups.
4419 * lisp.h (all_buffers): Remove declaration.
4420 * buffer.h (all_buffers): Add declaration, with comment.
4421 (for_each_buffer): New macro.
4422 * alloc.c (Fgarbage_collect, mark_object): Use it.
4423 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4424 (init_buffer): Likewise.
4425 * data.c (Fset_default): Likewise.
4426 * coding.c (code_conversion_restore): Remove redundant check
4427 for dead buffer.
4428 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4429
4430 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4431
4432 Fix bug that created negative-length intervals.
4433 * intervals.c (merge_interval_right, merge_interval_left):
4434 Do not zero out this interval if it is absorbed by its children,
4435 as this interval's total length doesn't change in that case. See
4436 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4437
4438 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4439
4440 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4441 when invoking (make-bool-vector N t) and N is a positive
4442 multiple of 8 -- the last 8 bits were mistakenly cleared.
4443
4444 Remove some struct layout assumptions in bool vectors.
4445 * alloc.c (bool_header_size): New constant.
4446 (header_size, word_size): Move earlier, as they're now used earlier.
4447 Use 'word_size' in a few more places, where it's appropriate.
4448 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4449 padding before the data member of a bool vector.
4450 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4451 than doing the check by hand with an abort ().
4452
4453 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4454
4455 * eval.c (Fdefvar): Don't check constants since we only set the var if
4456 it's not yet defined anyway (bug#11904).
4457
4458 * lisp.h (last_undo_boundary): Declare new var.
4459 * keyboard.c (command_loop_1): Set it.
4460 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4461 were auto-added by the command loop (bug#11774).
4462
4463 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4464
4465 * w32font.c (Qsymbol): Remove local definition.
4466 (syms_of_w32font): Don't DEFSYM it.
4467
4468 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4469
4470 Fix sweep_vectors to handle large bool vectors correctly.
4471 * alloc.c (sweep_vectors): Account total_vector_bytes for
4472 bool vectors larger than VBLOCK_BYTES_MAX.
4473
4474 2012-07-18 Chong Yidong <cyd@gnu.org>
4475
4476 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4477 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4478
4479 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4480
4481 Return more descriptive data from Fgarbage_collect.
4482 Suggested by Stefan Monnier in
4483 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4484 * alloc.c (bounded_number): New function.
4485 (total_buffers, total_vectors): New variable.
4486 (total_string_size): Rename to total_string_bytes, adjust users.
4487 (total_vector_size): Rename to total_vector_bytes, adjust users.
4488 (sweep_vectors): Account total_vectors and total_vector_bytes.
4489 (Fgarbage_collect): New return value. Adjust documentation.
4490 (gc_sweep): Account total_buffers.
4491 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4492 (VECTOR_SIZE): Remove.
4493 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4494 (Qinterval, Qmisc): New symbols.
4495 (syms_of_data): Initialize them.
4496 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4497 (Qcons, Qbuffer): New declarations.
4498
4499 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4500
4501 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4502 Round up, not down. Improve doc.
4503
4504 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4505
4506 Restore old code in allocate_string_data to avoid Faset breakage.
4507 Reported by Julien Danjou <julien@danjou.info> in
4508 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4509 * alloc.c (allocate_string_data): Restore old code with minor
4510 adjustments, fix comment to explain this subtle issue.
4511
4512 2012-07-17 Eli Zaretskii <eliz@gnu.org>
4513
4514 Remove FILE_SYSTEM_CASE.
4515 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4516
4517 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4518 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4519 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4520 call-process-region passes it through expand-file-name.
4521
4522 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4523
4524 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4525
4526 Fix crash when creating indirect buffer (Bug#11917)
4527 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4528 Don't handle unbound variables specially if non-zero.
4529 (Fbuffer_local_variables): Pass zero.
4530 (clone_per_buffer_values): Pass non-zero.
4531
4532 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4533
4534 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4535 to make the loop interruptible.
4536
4537 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4538
4539 * gnutls.c (emacs_gnutls_handshake): Only retry if
4540 GNUTLS_E_INTERRUPTED.
4541
4542 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4543
4544 Cleanup and convert miscellaneous checks to eassert.
4545 * alloc.c (mark_interval): Fix comment, partially rephrase
4546 old comment from intervals.h (see below).
4547 * intervals.c (find_interval, adjust_intervals_for_insertion)
4548 (delete_interval, adjust_intervals_for_deletion)
4549 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4550 Convert to eassert.
4551 (adjust_intervals_for_insertion, make_new_interval):
4552 Remove obsolete and unused code.
4553 * intervals.h (struct interval): Remove obsolete comment.
4554 * textprotp.c (erase_properties): Remove unused code.
4555 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4556 (Fremove_list_of_text_properties): Convert to eassert.
4557
4558 2012-07-17 Chong Yidong <cyd@gnu.org>
4559
4560 * editfns.c (Finsert_char): Doc fix.
4561
4562 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4563
4564 Fix previous change to make Fmemory_free always accurate.
4565 * alloc.c (make_interval): Update total_free_intervals.
4566 (make_float): Likewise for total_free_floats.
4567 (free_cons, Fcons): Likewise for total_free_conses.
4568 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4569 Likewise for total_free_vector_bytes.
4570 (Fmake_symbol): Likewise for total_free_symbols.
4571 (bytes_free): Remove.
4572
4573 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4574
4575 Simple free memory accounting feature.
4576 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4577 (sweep_vectors): Accumulate size of free vectors.
4578 (Fgarbage_collect): Setup bytes_free.
4579 (Fmemory_free): New function.
4580 (syms_of_alloc): Register it.
4581
4582 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4583
4584 Cleanup overlays checking.
4585 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4586 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4587 eassert and OVERLAYP.
4588 (sort_overlays): Change to use OVERLAYP.
4589
4590 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4591
4592 * editfns.c (Finsert_char): Make it interactive, and make the
4593 second arg optional. Copy interactive spec and docstring from
4594 ucs-insert.
4595
4596 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4597
4598 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4599 Unlike the other wrapped functions, fabs has an unspecified
4600 effect on errno.
4601
4602 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4603
4604 * nsterm.m (keyDown): Interpret flags without left/right bits
4605 as the left key (Bug#11670).
4606
4607 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4608
4609 Remove empty and useless init functions.
4610 * lisp.h (init_character_once, init_fns, init_image)
4611 (init_filelock, init_sound): Remove prototype.
4612 * character.c (init_character_once): Remove.
4613 * filelock.c (init_filelock): Likewise.
4614 * fns.c (init_fns): Likewise.
4615 * image.c (init_image): Likewise.
4616 * sound.c (init_sound): Likewise.
4617 * emacs.c (main): Adjust accordingly.
4618
4619 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4620
4621 * gtkutil.h: Tiny cleanups.
4622 (use_old_gtk_file_dialog): Remove useless declaration.
4623 (xg_uses_old_file_dialog): Add suggested const attribute.
4624
4625 2012-07-15 Eli Zaretskii <eliz@gnu.org>
4626
4627 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4628 (bidi_paragraph_init): Use it to limit search forward for a strong
4629 directional character in abnormally large paragraphs full of
4630 neutral or weak characters. (Bug#11943)
4631
4632 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4633
4634 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4635 the toolbar (Bug#9451).
4636 (xg_make_tool_item): Give the widget event box a transparent
4637 background.
4638
4639 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4640
4641 Cleanup basic allocation variables and functions.
4642 * alloc.c (ignore_warnings, init_intervals, init_float)
4643 (init_cons, init_symbol, init_marker): Remove.
4644 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4645 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4646 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4647 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4648 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4649 (staticidx, init_alloc_once, init_strings, free_ablock):
4650 Remove redundant initialization.
4651 * fns.c (init_weak_hash_tables): Remove.
4652 * lisp.h (init_weak_hash_tables): Remove prototype.
4653
4654 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4655
4656 Use zero_vector where appropriate.
4657 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4658 accordingly.
4659 * lisp.h (zero_vector): New declaration.
4660 * font.c (null_vector): Remove.
4661 (syms_of_font): Remove initialization and staticpro.
4662 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4663 * keymap.c (Faccessible_keymaps): Likewise.
4664
4665 2012-07-15 Leo Liu <sdl.web@gmail.com>
4666
4667 * fringe.c: Fix typo in comments.
4668
4669 2012-07-14 Leo Liu <sdl.web@gmail.com>
4670
4671 * fringe.c: Add a new bitmap exclamation-mark.
4672
4673 2012-07-14 Eli Zaretskii <eliz@gnu.org>
4674
4675 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4676
4677 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4678 (HAVE_MENUS): Don't define, defined by editing config.in with
4679 msdos/sed2v2.inp.
4680 (GMALLOC_INHIBIT_VALLOC): Don't define.
4681 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4682
4683 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
4684
4685 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4686
4687 2012-07-14 Glenn Morris <rgm@gnu.org>
4688
4689 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4690 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4691 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4692
4693 2012-07-13 Glenn Morris <rgm@gnu.org>
4694
4695 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4696
4697 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4698 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4699
4700 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4701
4702 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4703 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4704 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4705 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4706 where appropriate.
4707 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4708 as boolean expression.
4709 (x_set_window_size): Remove unused variable toolbar.
4710 (ns_get_color_default, ns_mod_to_lisp): Remove.
4711 (ns_mouse_position): Remove unused variables xchar and ychar.
4712 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4713 (ns_set_vertical_scroll_bar): Remove unused variable count.
4714 (ns_delete_terminal): Remove unused variable i.
4715 (ns_term_init): Remove unused variables r, g and b.
4716 (mouseDown): Remove unused variable window.
4717 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4718 (initFrameFromEmacs): Remove unused variable vbextra.
4719 (mouseEntered): Remove unused variables p and dpyinfo.
4720 (mouseExited): Remove unused variables p and r.
4721 (ns_define_frame_cursor, ns_clear_frame_area)
4722 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4723 (menuDown): Assign [sender tag] to variable and cast the variable.
4724
4725 * nsterm.h (menuDown): Add id as type to argument sender.
4726 (ns_display_info_for_name): Add Lisp_Object argument.
4727 (ns_term_init): Add Lisp_Object argument.
4728 (ns_map_event_to_object): Add void argument.
4729 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4730 prototype with arguments and only declare if __OBJC__.
4731 (nxatoms_of_nsselect): Add void argument.
4732 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4733 (ns_alloc_autorelease_pool): Add void argument.
4734 (ns_release_autorelease_pool): Add void* argument.
4735 (ns_get_defaults_value): Add const char* argument.
4736
4737 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4738 (initFromContents): Use SSDATA where appropriate.
4739 (ns_update_menubar): Add braces to ambigous if-else.
4740 (initWithTitle): Put () around assignment in if statement.
4741 (ns_menu_show): Remove unused variables window and keymap.
4742 (update_frame_tool_bar): Remove unused variable selected_p.
4743 (initWithContentRect): Remove unused variable this_cmd_name.
4744
4745 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4746 appropriate.
4747 (setXBMColor): Remove unused variable len.
4748 (setPixmapData): Put () around assignment in loop statement.
4749
4750 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4751 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4752 where appropriate.
4753 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4754 around assignment in loop statement.
4755 (nsfont_open): Remove unused variable i.
4756 (nsfont_open): Remove unused variable len.
4757 (nsfont_draw): Remove unused variable cs.
4758
4759 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4760 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4761 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4762 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4763 (Fns_font_name, Fns_perform_service)
4764 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4765 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4766 (ns_set_name): Remove unused variable view.
4767 (x_set_menu_bar_lines): Remove unused variable olines.
4768 (x_set_tool_bar_lines): Remove unused variable root_window.
4769 (Fns_list_colors): Put () around assignment in while statement.
4770 (Fns_perform_service): Remove unused variable len.
4771 (Fns_display_usable_bounds): Remove unused variable top.
4772 (syms_of_nsfns): Remove unused variable i.
4773
4774 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4775 memcpy (Bug#11907).
4776
4777 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4778
4779 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4780 and free it with DestroyExceptionInfo (Bug#11558).
4781
4782 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
4783
4784 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4785 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4786 Set here, not in nt/config.nt.
4787
4788 2012-07-13 Eli Zaretskii <eliz@gnu.org>
4789
4790 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4791 cursor overflow into the last glyph on display line when the right
4792 fringe is off. (Bug#11832)
4793
4794 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4795
4796 * xdisp.c (produce_special_glyphs): Now static.
4797 * dispextern.h (produce_special_glyphs): Remove decl.
4798
4799 2012-07-13 Glenn Morris <rgm@gnu.org>
4800
4801 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4802 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4803
4804 * s/usg5-4-common.h (USG, USG5):
4805 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4806 * s/sol2-6.h (SOLARIS2):
4807 * s/irix6-5.h (IRIX6_5):
4808 * s/hpux10-20.h (USG, USG5, HPUX):
4809 * s/gnu-linux.h (USG, GNU_LINUX):
4810 * s/freebsd.h (BSD_SYSTEM):
4811 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4812 * s/cygwin.h (CYGWIN):
4813 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4814 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4815
4816 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4817
4818 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4819
4820 2012-07-13 Glenn Morris <rgm@gnu.org>
4821
4822 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4823
4824 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4825
4826 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4827 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4828
4829 2012-07-12 Glenn Morris <rgm@gnu.org>
4830
4831 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4832
4833 * process.c (init_process_emacs): Rename from init_process.
4834 The old name is also the name of a Mach system call.
4835 * lisp.h, emacs.c: Update for this name change.
4836 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4837 longer needed.
4838
4839 2012-07-12 Eli Zaretskii <eliz@gnu.org>
4840
4841 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4842 memmove call that removes glyphs covered by the left truncation
4843 glyph. Improve commentary.
4844 (display_line): Fix display of continuation glyphs on GUI frames
4845 when the right fringe is turned off and variable-size fonts are
4846 used in the window. Move the code that appends a stretch glyph to
4847 produce_special_glyphs, so that it could be used for truncation
4848 and continuation glyphs alike.
4849 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4850 glyph of a suitably computed width, to align the special glyphs at
4851 the window margin. Code moved from display_line. (Bug#11832)
4852
4853 2012-07-12 Glenn Morris <rgm@gnu.org>
4854
4855 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4856
4857 * s/gnu-linux.h, s/hpux10-20.h:
4858 Do not unconditionally define HAVE_XRMSETDATABASE.
4859
4860 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4861
4862 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4863
4864 Fix typos that broke OS X build.
4865 Reported by Randal L. Schwartz in
4866 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4867 * nsterm.m (ns_timeout): Add missing local decl.
4868 (ns_get_color): snprintf -> sprintf, to fix typo.
4869
4870 2012-07-12 Glenn Morris <rgm@gnu.org>
4871
4872 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4873 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4874 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4875 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4876
4877 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4878 Move PTY_OPEN to configure.
4879
4880 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4881 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4882 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4883
4884 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4885
4886 Use empty_unibyte_string where applicable.
4887 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4888 * lread.c (read1): Likewise.
4889 * xsettings.c (syms_of_xsettings): Likewise.
4890
4891 2012-07-12 Glenn Morris <rgm@gnu.org>
4892
4893 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4894 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4895 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4896 * s/hpux10-20.h (RUN_TIME_REMAP):
4897 * s/bsd-common.h (TABDLY): Move to configure.
4898
4899 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4900
4901 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4902
4903 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4904 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4905
4906 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4907
4908 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4909 * s/template.h: Move NARROWPROTO to configure.
4910
4911 2012-07-11 Glenn Morris <rgm@gnu.org>
4912
4913 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4914 unused since 2011-01-17 change to systty.h.
4915
4916 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4917 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4918 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4919
4920 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4921
4922 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4923
4924 2012-07-11 Glenn Morris <rgm@gnu.org>
4925
4926 * s/darwin.h, s/gnu-linux.h, s/template.h:
4927 Move INTERRUPT_INPUT to configure.
4928
4929 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4930
4931 Minor adjustments to interning code.
4932 * lisp.h (intern, intern_c_string): Redefine as static inline
4933 wrappers for intern_1 and intern_c_string_1, respectively.
4934 (intern_1, intern_c_string_1): Rename prototypes.
4935 * lread.c (intern_1, intern_c_string_1, oblookup):
4936 Simplify Vobarray checking.
4937 * font.c (font_intern_prop): Likewise. Adjust comment.
4938 * w32font.c (intern_font_name): Likewise.
4939
4940 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4941
4942 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4943
4944 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4945 of Fcar/Fcdr if possible.
4946 * font.c (check_otf_features): Likewise.
4947 * fontset.c (Fnew_fontset): Likewise.
4948 * gnutls.c (Fgnutls_boot): Likewise.
4949 * minibuf.c (read_minibuf): Likewise.
4950 * msdos.c (IT_set_frame_parameters): Likewise.
4951 * xmenu.c (Fx_popup_dialog): Likewise.
4952 * w32menu.c (Fx_popup_dialog): Likewise.
4953
4954 2012-07-11 Glenn Morris <rgm@gnu.org>
4955
4956 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4957 since nothing has defined it on these platforms.
4958
4959 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4960 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4961
4962 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4963 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4964 Move CLASH_DETECTION to configure.
4965
4966 * s/gnu.h: Remove file, which is now empty.
4967
4968 * s/gnu.h, s/gnu-linux.h:
4969 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4970
4971 2012-07-11 John Wiegley <johnw@newartisans.com>
4972
4973 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4974 function attribute, so we only use it if it exists in the
4975 compiler.
4976
4977 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4978
4979 Avoid call to strlen in fast_c_string_match_ignore_case.
4980 * search.c (fast_c_string_match_ignore_case): Change to use
4981 length argument. Adjust users accordingly.
4982 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4983
4984 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4985
4986 Assume mkdir, rmdir.
4987 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4988 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4989
4990 Assume rename.
4991 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4992
4993 Assume perror.
4994 * s/hpux10-20.h (HAVE_PERROR): Remove.
4995 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4996 Remove dummy definition, as this problem was obsolete long ago.
4997
4998 Assume strerror.
4999 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5000
5001 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5002
5003 Avoid calls to strlen in font processing functions.
5004 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5005 (font_open_by_name): Change to use length argument.
5006 Adjust users accordingly.
5007 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5008 Adjust prototypes.
5009 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5010 Change to return ptrdiff_t.
5011 (xfont_list_pattern, xfont_match): Use length returned by
5012 xfont_decode_coding_xlfd.
5013 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5014
5015 2012-07-11 Glenn Morris <rgm@gnu.org>
5016
5017 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5018 Move DONT_REOPEN_PTY to configure.
5019
5020 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5021 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5022
5023 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5024
5025 Remove "#define unix" that is no longer needed (Bug#11905).
5026 * s/aix4-2.h (unix): Remove; no longer needed.
5027
5028 EMACS_TIME simplification (Bug#11875).
5029 This replaces macros (which typically do not work in GDB)
5030 with functions, typedefs and enums, making the code easier to debug.
5031 The functional style also makes code easier to read and maintain.
5032 * systime.h: Include <sys/time.h> on all hosts, not just if
5033 WINDOWSNT, since 'struct timeval' is needed in general.
5034 (EMACS_TIME): Now a typedef, not a macro.
5035 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5036 not macros.
5037 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5038 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5039 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5040 (EMACS_TIME_LE): Now functions, not macros.
5041 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5042 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5043 which are not functions. All uses rewritten to use:
5044 (make_emacs_time): New function.
5045 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5046 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5047 not functions. All uses rewritten to use the following, respectively:
5048 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5049 (add_emacs_time, sub_emacs_time): New functions.
5050 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5051 * fileio.c (Fcopy_file):
5052 * xterm.c (XTflash): Get the current time closer to when it's used.
5053 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5054
5055 * bytecode.c (targets): Suppress -Woverride-init warnings.
5056
5057 Simplify by avoiding confusing use of strncpy etc.
5058 * doc.c (Fsnarf_documentation):
5059 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5060 * frame.c (Fmake_terminal_frame):
5061 * gtkutil.c (get_utf8_string):
5062 * lread.c (openp):
5063 * nsmenu.m (ns_update_menubar):
5064 * regex.c (regerror):
5065 Prefer memcpy to strncpy and strncat when either will do.
5066 * fileio.c (Fsubstitute_in_file_name):
5067 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5068 (menu_separator_name_p):
5069 * nsmenu.m (ns_update_menubar):
5070 Prefer memcmp to strncmp when either will do.
5071 * nsterm.m: Include <ftoastr.h>.
5072 (ns_get_color):
5073 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5074 Prefer snprintf to strncpy.
5075 * nsterm.m (ns_term_init):
5076 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5077 * nsterm.m (ns_term_init):
5078 Avoid the need for strncpy, by using build_string or
5079 make_unibyte_string directly. Use dtoastr, not snprintf.
5080 * process.c (Fmake_network_process): Diagnose service names that
5081 are too long, rather than silently truncating them or creating
5082 non-null-terminated names.
5083 (Fnetwork_interface_info): Likewise, for interface names.
5084 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5085 Prefer sprintf to strncat.
5086 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5087 Prefer vsnprintf to vsprintf + strncpy.
5088
5089 2012-07-10 Glenn Morris <rgm@gnu.org>
5090
5091 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5092 Clarify fallback case.
5093
5094 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5095
5096 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5097 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5098 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5099 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5100 where argument type is known to be a Lisp_Cons.
5101
5102 2012-07-10 Tom Tromey <tromey@redhat.com>
5103
5104 * bytecode.c (BYTE_CODE_THREADED): New macro.
5105 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5106 (enum byte_code_op): New type.
5107 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5108 (exec_byte_code): Use them. Use token threading when applicable.
5109
5110 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5111
5112 Optimize pure C strings initialization.
5113 * lisp.h (make_pure_string): Fix prototype.
5114 (build_pure_c_string): New function, defined as static inline. This
5115 provides a better opportunity to optimize away calls to strlen when
5116 the function is called with compile-time constant argument.
5117 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5118 argument, adjust users accordingly. Use build_pure_c_string where
5119 appropriate.
5120 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5121 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5122 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5123
5124 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5125
5126 Avoid calls to strlen in miscellaneous functions.
5127 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5128 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5129 * lread.c (openp): Likewise.
5130
5131 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5132
5133 Avoid calls to strlen in path processing functions.
5134 * fileio.c (file_name_as_directory): Add comment. Change to add
5135 srclen argument and return the length of result. Adjust users
5136 accordingly.
5137 (directory_file_name): Fix comment. Change to add srclen argument,
5138 swap 1st and 2nd arguments to obey the common convention.
5139 Adjust users accordingly.
5140 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5141
5142 2012-07-10 Glenn Morris <rgm@gnu.org>
5143
5144 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5145 Move PENDING_OUTPUT_COUNT definition to configure.
5146
5147 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5148 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5149 * s/gnu.h (DATA_START): Move definitions to configure.
5150
5151 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5152 We include usg5-4-common.h, which defines them both.
5153
5154 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5155 O_RDONLY already includes it).
5156
5157 Stop ns builds setting the EMACSLOADPATH environment variable.
5158 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5159 Now it does not set EMACSLOADPATH, just returns the load-path string.
5160 * nsterm.h: Update accordingly.
5161 * lread.c [HAVE_NS]: Include nsterm.h.
5162 (init_lread) [HAVE_NS]: Use ns_load_path.
5163 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5164
5165 2012-07-09 Glenn Morris <rgm@gnu.org>
5166
5167 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5168 since the included bsd-common.h does so.
5169
5170 Stop ns builds setting the EMACSPATH environment variable.
5171 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5172 (ns_init_paths): Do not set EMACSPATH.
5173 * nsterm.h (ns_exec_path): Add it.
5174 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5175 Use ns_exec_path.
5176
5177 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5178
5179 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5180
5181 * process.c (wait_reading_process_output): 'waitchannels' was unset
5182 when read_kbd || !NILP (wait_for_cell); fix this.
5183
5184 Add GCC-style 'const' attribute to functions that can use it.
5185 * character.h (char_resolve_modifier_mask):
5186 * keyboard.h (make_ctrl_char):
5187 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5188 (init_character_once, next_almost_prime, init_fns, init_image)
5189 (flush_pending_output, init_sound):
5190 * mem-limits.h (start_of_data):
5191 * menu.h (finish_menu_items):
5192 Add ATTRIBUTE_CONST.
5193 * emacs.c (DEFINE_DUMMY_FUNCTION):
5194 Declare the dummy function with ATTRIBUTE_CONST.
5195 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5196 Add decls with ATTRIBUTE_CONST.
5197
5198 Minor improvements to make_formatted_string.
5199 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5200 where int is good enough, as vsprintf returns an int.
5201 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5202
5203 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5204
5205 Use make_formatted_string to avoid double length calculation.
5206 * lisp.h (make_formatted_string): New prototype.
5207 * alloc.c (make_formatted_string): New function.
5208 * buffer.c (Fgenerate_new_buffer_name): Use it.
5209 * dbus.c (syms_of_dbusbind): Likewise.
5210 * editfns.c (Fcurrent_time_zone): Likewise.
5211 * filelock.c (get_boot_time): Likewise.
5212 * frame.c (make_terminal_frame, set_term_frame_name)
5213 (x_report_frame_params): Likewise.
5214 * image.c (gs_load): Likewise.
5215 * minibuf.c (get_minibuffer): Likewise.
5216 * msdos.c (dos_set_window_size): Likewise.
5217 * process.c (make_process): Likewise.
5218 * xdisp.c (ensure_echo_area_buffers): Likewise.
5219 * xsettings.c (apply_xft_settings): Likewise.
5220
5221 2012-07-09 Glenn Morris <rgm@gnu.org>
5222
5223 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5224 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5225 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5226 * nsterm.h (ns_etc_directory): Add it.
5227 * callproc.c [HAVE_NS]: Include nsterm.h.
5228 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5229
5230 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5231
5232 Move marker debugging code under MARKER_DEBUG.
5233 * marker.c (MARKER_DEBUG): Move marker debugging code under
5234 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5235 for bootstrap with --enable-checking (~3x slowdown reported
5236 by Juanma Barranquero <lekktu@gmail.com>).
5237 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5238
5239 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5240
5241 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5242 See <http://bugs.gnu.org/11825#29>.
5243
5244 2012-07-08 Eli Zaretskii <eliz@gnu.org>
5245
5246 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5247 has no font, use the frame's font. (Bug#11813)
5248 (display_line): Add commentary about displaying truncation glyphs
5249 on GUI frames.
5250 (produce_special_glyphs): Move here from term.c.
5251
5252 * term.c (produce_special_glyphs): Move to xdisp.c.
5253
5254 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5255 section.
5256
5257 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5258
5259 * xdisp.c (display_line): Avoid warning about implicit declaration
5260 of FRAME_FONT.
5261
5262 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5263
5264 * lisp.h: Remove empty conditional.
5265
5266 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5267
5268 * lread.c (load_path_check): Now static.
5269
5270 Fix some minor --with-ns problems found by static checking.
5271 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5272 (x_set_font) [!HAVE_X_WINDOWS]:
5273 * image.c (xpm_load_image) [HAVE_NS]:
5274 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5275 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5276 Remove unused local.
5277 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5278 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5279 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5280 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5281 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5282 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5283 Fix pointer signedness problem.
5284 * xfaces.c (FRAME_X_FONT_TABLE):
5285 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5286
5287 2012-07-07 Glenn Morris <rgm@gnu.org>
5288
5289 * lread.c (load_path_check): New function, split from init_lread.
5290 (init_lread): Reorganize. Motivation:
5291 If EMACSLOADPATH is set, check/warn about that rather than the
5292 defaults, which we are not going to use. Hence we can remove
5293 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5294 Don't warn if site-lisp directories are missing.
5295 If not installed, start from a blank load-path, since
5296 PATH_LOADSEARCH refers to the eventual installation directories.
5297
5298 2012-07-07 Eli Zaretskii <eliz@gnu.org>
5299
5300 Support truncation and continuation glyphs on GUI frames, when
5301 fringes are disabled. (Bug#11832)
5302 * xdisp.c (init_iterator): Get dimensions of truncation and
5303 continuation glyphs even if on GUI frames.
5304 Adjust it->last_visible_x on GUI frames when the left or right fringes,
5305 or both, are absent.
5306 (start_display, move_it_in_display_line_to): Handle the case of a
5307 GUI frame without a fringe to display continuation or truncation
5308 glyphs.
5309 (insert_left_trunc_glyphs): Support GUI frames: make sure
5310 truncation glyphs overwrite enough glyphs from the current line to
5311 have sufficient space in pixels.
5312 (display_line): Support truncation and continuation glyphs on GUI
5313 frames. If some spare pixels are left on the line after inserting
5314 the truncation glyphs, fill that space with a stretch glyph of a
5315 suitably computed width.
5316
5317 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5318 produce_glyphs, to support GUI sessions.
5319
5320 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5321
5322 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5323
5324 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5325
5326 Do not require float-time's arg to fit in time_t (Bug#11825).
5327 This works better on hosts where time_t is unsigned, and where
5328 float-time is applied to the (negative) difference between two times.
5329 * editfns.c (decode_time_components): Last arg is now double *,
5330 not int *, and means to store all the result as a double, without
5331 worrying about whether the seconds part fits in time_t.
5332 All callers changed.
5333 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5334 All callers changed.
5335 (Ffloat_time): Do not fail merely because the specified time falls
5336 outside of time_t range.
5337
5338 2012-07-07 Glenn Morris <rgm@gnu.org>
5339
5340 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5341 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5342 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5343
5344 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
5345
5346 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5347 Update dependencies.
5348
5349 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5350
5351 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5352
5353 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5354 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5355 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5356 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5357 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5358 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5359
5360 * xfont.c (compare_font_names): Redo to omit the need for casts.
5361
5362 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5363
5364 * xfns.c (Fx_change_window_property): Doc fix.
5365 * w32fns.c (Fx_change_window_property): Doc fix.
5366
5367 * w32fns.c (Fx_window_property): Accept the same arguments as the
5368 X Windows version. Doc fix.
5369 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5370
5371 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5372 Eli Zaretskii <eliz@gnu.org>
5373
5374 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5375 Windows-specific code from nt/config.nt moved here.
5376 Obsolete settings removed.
5377
5378 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5379
5380 * process.c: Avoid unnecessary calls to gettime.
5381 (wait_reading_process_output): Don't get the time of day
5382 when gobbling data immediately and not waiting, as there's no need
5383 for it in that case. This removes a FIXME.
5384
5385 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5386
5387 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5388 is defined (Bug#11768).
5389
5390 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5391
5392 Fix marker debugging code.
5393 * marker.c (byte_char_debug_check): Do not perform the check
5394 if buffer is not multibyte.
5395 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5396 Call byte_char_debug_check with correct arguments.
5397
5398 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5399
5400 Compile marker debugging code only if ENABLE_CHECKING is defined.
5401 * marker.c (byte_char_debug_check, count_markers):
5402 Use only if ENABLE_CHECKING is defined.
5403 (byte_debug_flag): Remove.
5404 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5405 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5406
5407 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5408
5409 Avoid code repetition in marker-related functions.
5410 * marker.c (attach_marker): New function.
5411 (Fset_marker, set_marker_restricted, set_marker_both)
5412 (set_marker_restricted_both): Use it.
5413 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5414 Consistently rename charno to charpos.
5415 (marker_position): Add eassert.
5416 (marker_byte_position): Convert to eassert.
5417
5418 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5419
5420 Simplify list operations in unchain_overlay and unchain_marker.
5421 * buffer.c (unchain_overlay): Simplify. Add comment.
5422 * marker.c (unchain_marker): Simplify. Fix comments.
5423
5424 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5425
5426 Introduce fast path for the widely used marker operation.
5427 * alloc.c (build_marker): New function.
5428 * lisp.h (build_marker): New prototype.
5429 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5430 * composite.c (autocmp_chars): Likewise.
5431 * editfns.c (buildmark): Remove.
5432 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5433 (save_restriction_save): Use build_marker.
5434 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5435 * window.c (save_window_save): Likewise.
5436
5437 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5438
5439 Do not use Fdelete_overlay in delete_all_overlays
5440 to avoid redundant calls to unchain_overlay.
5441 * buffer.c (drop_overlay): New function.
5442 (delete_all_overlays, Fdelete_overlay): Use it.
5443 * minibuf.c (get_minibuffer): Fix comment.
5444
5445 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5446
5447 Port to OpenBSD 5.1 amd64.
5448 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5449 This is needed for OpenBSD, and should be harmless on all BSD systems.
5450 Also, include <sys/sysctl.h>, as it should be available on all
5451 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5452 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5453 use p_pid member, not kp_proc.pid.
5454
5455 2012-07-06 Glenn Morris <rgm@gnu.org>
5456
5457 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5458
5459 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5460
5461 More xmalloc and related cleanup.
5462 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5463 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5464 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5465 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5466 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5467 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5468 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5469 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5470 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5471 * xterm.c:
5472 Omit needless casts involving void * pointers and allocation.
5473 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5474 as the former is more robust if P's type is changed.
5475 Prefer xzalloc to xmalloc + memset 0.
5476 Simplify malloc-or-realloc to realloc.
5477 Don't worry about xmalloc returning a null pointer.
5478 Prefer xstrdup to xmalloc + strcpy.
5479 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5480 growing it.
5481 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5482 alloca of a constant.
5483
5484 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5485
5486 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5487 hscroll is larger than the line width. Fixes long and futile
5488 looping inside extend_face_to_end_of_line (on a TTY) producing
5489 glyphs that are not needed and thrown away.
5490
5491 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5492
5493 * marker.c (set_marker_restricted_both): Simplify by using
5494 clip_to_bounds.
5495
5496 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5497
5498 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5499
5500 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5501
5502 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5503 not defined (Bug#11768).
5504 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5505 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5506 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5507 followed by gtk_box_set_homogeneous (Bug#11768).
5508 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5509 (update_theme_scrollbar_width, xg_create_scroll_bar):
5510 Use gtk_scrollbar_new (Bug#11768).
5511 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5512 (is_box_type): New function (Bug#11768).
5513 (xg_tool_item_stale_p): Call is_box_type.
5514 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5515 with default display (Bug#11768).
5516
5517 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5518
5519 * xdisp.c (window_hscroll_limited): New function.
5520 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5521 coordinates when window's hscroll is set to insanely large
5522 values. (Bug#11857)
5523
5524 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
5525
5526 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5527 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5528
5529 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5530
5531 Cleanup xmalloc.
5532 * lisp.h (xzalloc): New prototype. Omit needless casts.
5533 * alloc.c (xzalloc): New function. Omit needless casts.
5534 * charset.c: Omit needless casts. Convert all calls to
5535 xmalloc with following memset to xzalloc.
5536 * dispnew.c: Likewise.
5537 * fringe.c: Likewise.
5538 * image.c: Likewise.
5539 * sound.c: Likewise.
5540 * term.c: Likewise.
5541 * w32fns.c: Likewise.
5542 * w32font.c: Likewise.
5543 * w32term.c: Likewise.
5544 * xfaces.c: Likewise.
5545 * xfns.c: Likewise.
5546 * xterm.c: Likewise.
5547 * atimer.c: Omit needless casts.
5548 * buffer.c: Likewise.
5549 * callproc.c: Likewise.
5550 * ccl.c: Likewise.
5551 * coding.c: Likewise.
5552 * composite.c: Likewise.
5553 * doc.c: Likewise.
5554 * doprnt.c: Likewise.
5555 * editfns.c: Likewise.
5556 * emacs.c: Likewise.
5557 * eval.c: Likewise.
5558 * filelock.c: Likewise.
5559 * fns.c: Likewise.
5560 * gtkutil.c: Likewise.
5561 * keyboard.c: Likewise.
5562 * lisp.h: Likewise.
5563 * lread.c: Likewise.
5564 * minibuf.c: Likewise.
5565 * msdos.c: Likewise.
5566 * print.c: Likewise.
5567 * process.c: Likewise.
5568 * region-cache.c: Likewise.
5569 * search.c: Likewise.
5570 * sysdep.c: Likewise.
5571 * termcap.c: Likewise.
5572 * terminal.c: Likewise.
5573 * tparam.c: Likewise.
5574 * w16select.c: Likewise.
5575 * w32.c: Likewise.
5576 * w32reg.c: Likewise.
5577 * w32select.c: Likewise.
5578 * w32uniscribe.c: Likewise.
5579 * widget.c: Likewise.
5580 * xdisp.c: Likewise.
5581 * xmenu.c: Likewise.
5582 * xrdb.c: Likewise.
5583 * xselect.c: Likewise.
5584
5585 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5586
5587 * fileio.c (time_error_value): Check the right error number.
5588 Problem reported by Troels Nielsen in
5589 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5590
5591 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5592
5593 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5594 This should be fixed in a better way; see Eli Zaretskii in
5595 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5596 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5597
5598 * fileio.c (time_error_value): Rename from special_mtime.
5599 The old name's problems were noted by Eli Zaretskii in
5600 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5601
5602 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5603 This variable's comment says Emacs needs at least one GDB-visible
5604 symbol of type enum pvec_type, to work around GDB problems.
5605 The symbol's value doesn't matter.
5606
5607 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5608 that causes compilation to fail on pre-C99 compilers.
5609
5610 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
5611
5612 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5613 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5614
5615 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5616
5617 * buffer.c (init_buffer_once): Fix initialization of
5618 headers for buffer_defaults and buffer_local_symbols.
5619 Reported by Juanma Barranquero <lekktu@gmail.com>.
5620
5621 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5622
5623 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5624 * lisp.h (enum pvec_type): Use fewer bits.
5625 (PSEUDOVECTOR_SIZE_BITS): New constant.
5626 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5627 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5628 change in pvec_type.
5629 (PSEUDOVECTOR_TYPEP): New macro.
5630 (TYPED_PSEUDOVECTORP): Use it.
5631 * fns.c (internal_equal): Adapt code to extract pvectype.
5632 * emacs.c (gdb_pvec_type): Update type.
5633 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5634 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5635 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5636 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5637 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5638 abusing vector->header.next.nbytes.
5639 (live_vector_p): Use PVEC_TYPE.
5640 (mark_object): Adapt code to extract pvectype. Use switch.
5641
5642 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5643
5644 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5645 Tighten new eassert a bit.
5646
5647 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5648
5649 Fix compilation with --enable-gcc-warnings and -O1
5650 optimization level.
5651 * doprnt.c (doprnt): Change type of tem to int, initialize
5652 to avoid compiler warning. Add eassert.
5653 * search.c (simple_search): Initialize match_byte to avoid
5654 compiler warning. Add eassert.
5655
5656 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5657
5658 Avoid weird behavior with large horizontal scrolls.
5659 Without this change, for example, large hscroll values would
5660 mess up Emacs's display on Fedora 15 x86, presumably due to
5661 overflows in int calculations in the display code.
5662 Also, if buffers had long lines, Emacs would freeze.
5663 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5664 (set_window_hscroll): New function, containing the old guts of
5665 Fset_window_hscroll. Return the clipped value.
5666 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5667 This avoids the need to check against PTRDIFF_MAX.
5668
5669 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5670
5671 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5672
5673 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5674
5675 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5676
5677 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5678 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5679 since GCC 4.4.6 issues a bogus warning for them.
5680
5681 Fix bugs in file timestamp newness comparisons.
5682 * fileio.c (Ffile_newer_than_file_p):
5683 * lread.c (Fload): Use full timestamp resolution of files,
5684 not just the 1-second resolution, so that files that are only
5685 slightly newer still count as newer.
5686 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5687 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5688
5689 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5690
5691 * fileio.c: Improve handling of file time marker. (Bug#11852)
5692 (special_mtime): New function.
5693 (Finsert_file_contents, Fverify_visited_file_modtime):
5694 Use it to set special mtime values consistently.
5695
5696 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5697
5698 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5699 marker for non-existing file. (Bug#11852)
5700
5701 2012-07-03 Glenn Morris <rgm@gnu.org>
5702
5703 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5704 and did not make it into globals.h).
5705
5706 2012-07-03 Tom Tromey <tromey@redhat.com>
5707
5708 * window.c (Fset_window_margins, Fset_window_fringes)
5709 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5710 * textprop.c (Fprevious_property_change): No longer static.
5711 * syntax.c (Fsyntax_table_p): No longer static.
5712 * process.c (Fget_process, Fprocess_datagram_address): No longer
5713 static.
5714 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5715 * keyboard.c (Fcommand_execute): No longer static.
5716 Remove EXFUN.
5717 * insdel.c (Fcombine_after_change_execute): No longer static.
5718 * image.c (Finit_image_library): No longer static.
5719 * fileio.c (Fmake_symbolic_link): No longer static.
5720 * eval.c (Ffetch_bytecode): No longer static.
5721 * editfns.c (Fuser_full_name): No longer static.
5722 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5723 No longer static.
5724 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5725 static.
5726 * dired.c (Ffile_attributes): No longer static.
5727 * composite.c (Fcomposition_get_gstring): No longer static.
5728 * callproc.c (Fgetenv_internal): No longer static.
5729
5730 * ccl.h: Remove EXFUNs.
5731 * buffer.h: Remove EXFUNs.
5732 * dispextern.h: Remove EXFUNs.
5733 * intervals.h: Remove EXFUNs.
5734 * fontset.h: Remove EXFUN.
5735 * font.h: Remove EXFUNs.
5736 * dosfns.c (system_process_attributes): Remove EXFUN.
5737 * keymap.h: Remove EXFUNs.
5738 * lisp.h: Remove EXFUNs.
5739 * w32term.h: Remove EXFUNs.
5740 * window.h: Remove EXFUNs.
5741 * xsettings.h: Remove EXFUN.
5742 * xterm.h: Remove EXFUN.
5743
5744 2012-07-03 Glenn Morris <rgm@gnu.org>
5745
5746 * lisp.h (Frandom): Make it visible to C.
5747 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5748 buffer for invisible buffers. (Bug#1229)
5749
5750 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5751
5752 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5753 values which aren't power of 2.
5754 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5755 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5756 accordingly.
5757
5758 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5759
5760 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5761
5762 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5763
5764 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5765
5766 * alloc.c (allocate_vector_block): Remove redundant
5767 calls to mallopt if DOUG_LEA_MALLOC is defined.
5768 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5769 avoid calls to mallopt if zero_vector is returned.
5770
5771 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5772
5773 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5774 is enabled, avoid dereferencing NULL current_sblock if
5775 running undumped.
5776
5777 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5778
5779 Cleanup basic buffer management.
5780 * buffer.h (struct buffer): Change layout to use generic vector
5781 marking code. Fix some comments. Change type of 'clip_changed'
5782 to bitfield. Remove unused #ifndef old.
5783 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5784 (GET_OVERLAYS_AT): Fix indentation.
5785 (for_each_per_buffer_object_at): New macro.
5786 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5787 (Fbuffer_local_variables): Use it.
5788 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5789 * alloc.c (allocate_buffer): Adjust to match new layout of
5790 struct buffer. Fix comment.
5791 (mark_overlay): New function.
5792 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5793 Lisp area of struct buffer.
5794 (mark_object): Use it. Adjust marking of misc objects
5795 and related comments.
5796
5797 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5798
5799 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5800 wrapper that is not needed because the wrapped code is a no-op (zero
5801 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5802 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5803
5804 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5805
5806 * alloc.c (mark_buffer): Simplify. Remove prototype.
5807 (mark_object): Add comment. Reorganize marking of vector-like
5808 objects. Use CHECK_LIVE for all vector-like objects except buffers
5809 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5810 Avoid redundant calls to mark_vectorlike for bool vectors.
5811
5812 2012-06-30 Glenn Morris <rgm@gnu.org>
5813
5814 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5815
5816 * epaths.in (PATH_SITELOADSEARCH): New.
5817 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5818 This is rather than relying on --enable-locallisppath elements
5819 having "site-lisp" in their names. (Bug#10208#25, 11658)
5820
5821 2012-06-30 Eli Zaretskii <eliz@gnu.org>
5822
5823 * w32proc.c (sys_select): Accept and ignore one more argument.
5824
5825 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5826
5827 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5828 (pselect) [!MS_DOS]: Redirect to sys_select.
5829
5830 * sysdep.c: Don't include dos.h and dosfns.h.
5831
5832 * process.c (sys_select):
5833 * msdos.c (sys_select): Accept one more argument and ignore it.
5834
5835 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5836 adapt data types and code to that.
5837
5838 * dosfns.c:
5839 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5840 which clashes with the gnulib function of the same name.
5841
5842 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5843
5844 * font.c (font_style_to_value, font_style_symbolic)
5845 (font_prop_validate_style): Add type checks for values in
5846 font_style_table.
5847
5848 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5849 argument.
5850 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5851 uses.
5852
5853 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5854
5855 * xdisp.c (try_window_id): Undo last change.
5856
5857 * w32.c (getwd): Adjust commentary about startup_dir.
5858 (init_environment): Always call sys_access, even in non-MSVC
5859 builds. Don't chdir to the directory of the Emacs executable.
5860 This undoes code from 1997 which was justified by the need to
5861 "avoid conflicts when removing and renaming directories". But its
5862 downside was that every relative file name was being interpreted
5863 relative to the directory of the Emacs executable, which can never
5864 be TRT. In particular, it broke sys_access when called with
5865 relative file names.
5866 (sys_access): Map GetLastError to errno.
5867
5868 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5869
5870 * window.h (struct window): Change type of 'fringes_outside_margins'
5871 to bitfield. Fix comment. Adjust users accordingly.
5872 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5873 Adjust comment.
5874 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5875 to ptrdiff_t.
5876
5877 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5878
5879 * gnutls.c (emacs_gnutls_handshake):
5880 Add QUIT to make the loop interruptible.
5881
5882 2012-06-29 Glenn Morris <rgm@gnu.org>
5883
5884 * charset.c (init_charset): Make lack of etc/charsets fatal.
5885
5886 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5887
5888 * editfns.c (region_limit): Fix type mismatch.
5889
5890 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5891
5892 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5893 undefined. Convert from xassert to eassert.
5894 * nsmenu.m: Convert from xassert to eassert.
5895 * nsterm.m: Likewise.
5896
5897 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5898
5899 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5900
5901 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5902
5903 Avoid integer overflow on scroll-left and scroll-right.
5904 * window.c (HSCROLL_MAX): New macro.
5905 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5906 overflow when requested scroll falls outside ptrdiff_t range.
5907
5908 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5909
5910 * window.h (struct window): Change type of 'hscroll',
5911 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5912 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5913 Adjust users accordingly.
5914 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5915 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5916 from EMACS_INT to ptrdiff_t.
5917 (make_window): Omit redundant initialization.
5918
5919 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5920
5921 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5922
5923 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5924
5925 * window.h (struct window): Change type of 'use_time' and
5926 'sequence_number' from Lisp_Object to int.
5927 * frame.c (make_frame): Adjust users accordingly.
5928 * print.c (print_object): Likewise.
5929 * window.c (select_window, Fwindow_use_time, make_parent_window)
5930 (make_window): Likewise.
5931
5932 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5933
5934 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5935 enabled with --enable-checking=[all,glyphs] configure option.
5936 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5937 adjust comments accordingly.
5938 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5939 undefined, adjust comments accordingly.
5940 * image.c: Likewise.
5941 * scroll.c: Likewise.
5942 * w32fns.c: Likewise.
5943 * w32term.c: Likewise.
5944 * xdisp.c: Likewise.
5945 * xfaces.c: Likewise.
5946 * xfns.c: Likewise.
5947 * xterm.c: Likewise.
5948
5949 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5950
5951 Generalize run-time debugging checks.
5952 * dispextern.h (XASSERTS): Remove.
5953 * fontset.c (xassert): Remove.
5954 Convert from xassert to eassert.
5955 * alloc.c: Convert from xassert to eassert.
5956 * bidi.c: Likewise.
5957 * dispnew.c: Likewise.
5958 * fns.c: Likewise.
5959 * fringe.c: Likewise.
5960 * ftfont.c: Likewise.
5961 * gtkutil.c: Likewise.
5962 * image.c: Likewise.
5963 * keyboard.c: Likewise.
5964 * menu.c: Likewise.
5965 * process.c: Likewise.
5966 * scroll.c: Likewise.
5967 * sound.c: Likewise.
5968 * term.c: Likewise.
5969 * w32console.c: Likewise.
5970 * w32fns.c: Likewise.
5971 * w32term.c: Likewise.
5972 * window.c: Likewise.
5973 * xdisp.c: Likewise.
5974 * xfaces.c: Likewise.
5975 * xfns.c: Likewise.
5976 * xselect.c: Likewise.
5977 * xterm.c: Likewise.
5978
5979 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5980
5981 * fns.c (maybe_resize_hash_table): Output message when growing the
5982 purify-hashtable.
5983
5984 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5985
5986 * alloc.c (allocate_string_data): Remove dead code.
5987 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5988 avoid GCC warning about unused macro.
5989
5990 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5991
5992 * alloc.c (allocate_string): Omit intervals initialization.
5993 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5994 as in make_pure_string and make_pure_c_string.
5995
5996 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5997
5998 * alloc.c (allocate_string): Fix last change.
5999
6000 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6001
6002 * alloc.c (allocate_string): Remove two redundant calls
6003 to memset, add explicit initialization where appropriate.
6004
6005 2012-06-27 Glenn Morris <rgm@gnu.org>
6006
6007 * lisp.mk (lisp): Remove paths.elc.
6008
6009 2012-06-27 Chong Yidong <cyd@gnu.org>
6010
6011 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6012
6013 2012-06-26 John Wiegley <johnw@newartisans.com>
6014
6015 * unexmacosx.c (copy_data_segment): Add two section names used
6016 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6017
6018 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6019 when building with Clang.
6020
6021 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6022
6023 * eval.c (Fapply): Allow calling it with a single argument.
6024
6025 2012-06-26 Eli Zaretskii <eliz@gnu.org>
6026
6027 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6028 _stricmp and _strnicmp.
6029 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6030
6031 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6032
6033 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6034 allocated window.
6035 (allocate_process): Likewise for new process.
6036 (allocate_terminal): Change to use offsetof.
6037 (allocate_frame): Likewise.
6038 * frame.c (make_frame): Omit redundant initialization.
6039 * window.c (make_parent_window): Use memset.
6040 (make_window): Omit redundant initialization.
6041 * process.c (make_process): Omit redundant initialization.
6042 * terminal.c (create_terminal): Likewise.
6043
6044 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6045
6046 * term.c (delete_tty): Remove redundant call to memset.
6047
6048 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6049
6050 * alloc.c: Remove build_string.
6051 * lisp.h: Define build_string as static inline. This provides
6052 a better opportunity to optimize away calls to strlen when the
6053 function is called with compile-time constant argument.
6054 * image.c (imagemagick_error): Convert to build_string.
6055 * w32proc.c (sys_spawnve): Likewise.
6056 * xterm.c (x_term_init): Likewise.
6057
6058 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6059
6060 Use sprintf return value instead of invoking strlen on result.
6061 In the old days this wasn't portable, since some sprintf
6062 implementations returned char *. But they died out years ago and
6063 Emacs already assumes sprintf returns int.
6064 Similarly for float_to_string.
6065 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6066 * ccl.c (ccl_driver):
6067 * character.c (string_escape_byte8):
6068 * data.c (Fnumber_to_string):
6069 * doprnt.c (doprnt):
6070 * print.c (print_object):
6071 * xdisp.c (message_dolog):
6072 * xfns.c (syms_of_xfns):
6073 Use sprintf or float_to_string result to avoid need to call strlen.
6074 * data.c (Fnumber_to_string):
6075 Use make_unibyte_string, since the string must be ASCII.
6076 * lisp.h, print.c (float_to_string): Now returns int length.
6077 * term.c (produce_glyphless_glyph):
6078 Use sprintf result rather than recomputing it.
6079
6080 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6081 * Makefile.in (ALL_CFLAGS):
6082 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6083 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6084
6085 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6086
6087 * dispextern.h (xstrcasecmp): Define to library function
6088 strcasecmp if available.
6089 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6090
6091 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6092
6093 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6094 Avoid comma operator.
6095 * menu.c (push_submenu_start, push_submenu_end)
6096 (push_left_right_boundary, push_menu_pane): Likewise.
6097 * msdos.c (dos_rawgetc): Likewise.
6098
6099 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6100
6101 * xfns.c (xic_create_fontsetname): Remove redundant calls
6102 to memset.
6103
6104 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6105
6106 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6107 sprintf already null-terminates its output.
6108
6109 * xfns.c (x_window): Remove redundant cast.
6110
6111 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6112
6113 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6114 `const char *' to `char *' to avoid compiler warning.
6115
6116 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6117
6118 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6119 instead of truncating it to 63 (admittedly a generous limit).
6120
6121 * process.c: Fix spelling and caps in comments.
6122
6123 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6124
6125 * emacs.c (setpgrp): Remove definition, unused.
6126 * sysdep.c (setpgrp): Remove definition, not used in this file.
6127
6128 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
6129
6130 * makefile.w32-in: Update dependencies.
6131
6132 2012-06-24 Eli Zaretskii <eliz@gnu.org>
6133
6134 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6135 (SYSTIME_H): Add nt/inc/sys/time.h.
6136
6137 * systime.h [WINDOWSNT]: Include sys/time.h.
6138
6139 * s/ms-w32.h (struct timespec): Definition moved from
6140 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6141
6142 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6143
6144 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6145 * buffer.h (buffer_slot_type_mismatch):
6146 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6147 * eval.c (unwind_to_catch):
6148 * image.c (my_png_error, my_error_exit):
6149 * keyboard.c (quit_throw_to_read_char, user_error)
6150 (Fexit_recursive_edit, Fabort_recursive_edit):
6151 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6152 (wrong_type_argument, buffer_overflow, __executable_start)
6153 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6154 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6155 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6156 (fatal):
6157 (child_setup) [!DOS_NT]:
6158 * lread.c (end_of_file_error, invalid_syntax):
6159 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6160 * puresize.h (pure_write_error):
6161 * search.c (matcher_overflow):
6162 * sound.c (sound_perror, alsa_sound_perror):
6163 * sysdep.c, syssignal.h (croak):
6164 * term.c (maybe_fatal, vfatal):
6165 * textprop.c (text_read_only):
6166 * undo.c (user_error):
6167 * unexmacosx.c (unexec_error):
6168 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6169 Use _Noreturn rather than NO_RETURN.
6170 No need for separate decl merely because of _Noreturn.
6171 * sound.c (sound_warning, parse_sound):
6172 Remove unnecessary forward decls.
6173
6174 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6175
6176 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6177 * lisp.h (WAIT_READING_MAX): New macro.
6178 * dispnew.c (Fsleep_for, sit_for):
6179 * keyboard.c (kbd_buffer_get_event):
6180 * process.c (Faccept_process_output):
6181 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6182 This improves on the previous patch, which introduced a bug
6183 when time_t is unsigned and as wide as intmax_t.
6184 See <http://bugs.gnu.org/9000#51>.
6185
6186 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6187
6188 * dispnew.c (sit_for, Fsleep_for):
6189 * keyboard.c (kbd_buffer_get_event):
6190 * process.c (Faccept_process_output): Avoid compiler warnings when
6191 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6192
6193 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
6194
6195 * makefile.w32-in: Update dependencies.
6196
6197 * w32.c (ltime): Add return type and declare static.
6198 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6199
6200 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6201
6202 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6203 Privately reported by Herbert J. Skuhra.
6204 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6205 All uses changed.
6206 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6207 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6208
6209 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6210
6211 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6212 last argument of make_unibyte_string.
6213
6214 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6215 language ID in the event parameters.
6216
6217 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6218 event.code, not the obscure "character set ID".
6219
6220 2012-06-23 Chong Yidong <cyd@gnu.org>
6221
6222 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6223
6224 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6225
6226 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6227 * w32.c (fdutimens): New function.
6228
6229 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6230
6231 * s/ms-w32.h (pselect): Redirect to sys_select.
6232
6233 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6234
6235 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6236 in the logic of incrementing and decrementing the value of
6237 use_relocatable_buffers.
6238
6239 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6240
6241 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6242 Privately reported by Herbert J. Skuhra.
6243 [__FreeBSD__]: Remove "*/" typo after "#include".
6244 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6245 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6246 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6247 Don't assume EMACS_TIME and struct timeval are the same type.
6248
6249 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6250
6251 Support higher-resolution time stamps (Bug#9000).
6252 The time stamps are only nanosecond-resolution at the C level,
6253 since that's the best that any real-world system supports now.
6254 But they are picosecond-resolution at the Lisp level, as that's
6255 easy, and leaves room for future OS improvements.
6256
6257 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6258 (LIBES): Use it.
6259
6260 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6261 Don't get current time unless it's needed.
6262
6263 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6264 now provides it if it's absent.
6265 (start_atimer): Port to higher-res time stamps.
6266 Check for time stamp overflow. Don't get current time more
6267 often than is needed.
6268
6269 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6270 Include systime.h, not time.h.
6271 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6272
6273 * dired.c: Include stat-time.h.
6274 (Ffile-attributes): File times now have higher resolution.
6275
6276 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6277 (struct image): Timestamp now has higher resolution.
6278
6279 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6280 has at least microseconds now. All uses removed.
6281 (update_frame, update_single_window, update_window, update_frame_1)
6282 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
6283 (duration_to_sec_usec): Remove; no longer needed.
6284
6285 * editfns.c (time_overflow): Now extern.
6286 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6287 (float-time, Fformat_time_string, Fcurrent_time_string)
6288 (Fcurrent_time_zone): Accept and generate higher-resolution
6289 time stamps.
6290 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6291 (decode_time_components, lisp_seconds_argument): New functions.
6292 (make_time): Now static.
6293 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6294 Report an error if the time is invalid, rather than having the caller
6295 do that.
6296
6297 * fileio.c: Include <stat-time.h>
6298 (Fcopy_file): Copy higher-resolution time stamps.
6299 Prefer to set the time stamp via a file descriptor if that works.
6300 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6301 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6302 (Fvisited_file_modtime, Fset_visited_file_modtime):
6303 Support higher-resolution time stamps.
6304
6305 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6306
6307 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6308
6309 * image.c (prepare_image_for_display, clear_image_cache)
6310 (lookup_image): Port to higer-resolution time stamps.
6311
6312 * keyboard.c (start_polling, bind_polling_period):
6313 Check for time stamp overflow.
6314 (read_char, kbd_buffer_get_event, timer_start_idle)
6315 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6316 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6317 Port to higher-resolution time stamps. Do not assume time_t is signed.
6318 (decode_timer): New function. Timers are now vectors of length 9,
6319 not 8, to accommodate the picosecond component.
6320 (timer_check_2): Use it.
6321
6322 * nsterm.m (select_timeout, timeval_subtract): Remove.
6323 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6324 as they're a bit more accurate and handle overflow better.
6325 (ns_select): Change prototype to be compatible with pselect.
6326 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6327 * nsterm.h (ns_select): Adjust prototype.
6328
6329 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6330 us-resolution time stamps.
6331 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6332
6333 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6334
6335 * lisp.h (time_overflow): New decl.
6336 (wait_reading_process_output): First arg is now intmax_t, not int,
6337 to accommodate larger waits.
6338
6339 * process.h (struct Lisp_Process.read_output_delay):
6340 Now counts nanoseconds, not microseconds.
6341 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6342 EMACS_HAS_USECS.
6343 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6344 (wait_reading_process_output):
6345 Port to ns-resolution time stamps.
6346 (Faccept_process_output, wait_reading_process_output):
6347 Check for time stamp overflow. Do not assume time_t is signed.
6348 (select_wrapper): Remove; we now use pselect.
6349 (Fprocess_attributes): Now generates ns-resolution time stamps.
6350
6351 * sysdep.c: Include utimens.h. Don't include utime.h
6352 or worry about struct utimbuf; gnulib does that for us now.
6353 (gettimeofday): Remove; gnulib provides a substitute.
6354 (make_timeval): New function.
6355 (set_file_times): Now sets ns-resolution time stamps.
6356 New arg FD; all uses changed.
6357 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6358 (system_process_attributes):
6359 Now returns ns-resolution time stamp. All uses changed.
6360 Check for time stamp overflow.
6361
6362 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6363 provides a substitute now.
6364
6365 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6366 since it guarantees struct timespec.
6367 (EMACS_TIME): Now struct timespec, so that we can support
6368 ns-resolution time stamps.
6369 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6370 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6371 (EMACS_USECS): Remove.
6372 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6373 so multiply the arg by 1000 before storing it.
6374 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6375 New macros.
6376 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6377 Port to ns-resolution time stamps.
6378 (EMACS_TIME_NEG_P): Remove; replaced by....
6379 (EMACS_TIME_SIGN): New macro.
6380 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6381 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6382 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6383 (make_timeval, make_lisp_time, decode_time_components): New decls.
6384 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6385 that it mishandled time_t overflow. You can't compare by subtracting!
6386 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6387 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6388
6389 * term.c: Include <sys/time.h>.
6390 (timeval_to_Time): New function, for proper overflow wraparound.
6391 (term_mouse_position, term_mouse_click): Use it.
6392
6393 * undo.c (record_first_change): Support higher-resolution time stamps
6394 in the undo buffer.
6395 (Fprimitive_undo): Use them when restoring time stamps.
6396
6397 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6398 (w32_get_internal_run_time):
6399 Port to higher-resolution Emacs time stamps.
6400 (ltime): Now accepts single 64-bit integer, as that's more convenient
6401 for callers.
6402
6403 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6404
6405 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6406 for compatibility with pselect. Support ns-resolution time stamps.
6407
6408 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6409
6410 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6411 Check for time stamp overflow, and support ns-resolution time stamps.
6412
6413 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6414 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6415 (timeval_subtract): Remove; no longer needed.
6416 (XTflash, XTring_bell, x_wait_for_event):
6417 Port to ns-resolution time stamps. Don't assume time_t is signed.
6418
6419 2012-06-22 Chong Yidong <cyd@gnu.org>
6420
6421 * xdisp.c (x_consider_frame_title): Revert last change.
6422
6423 2012-06-22 Eli Zaretskii <eliz@gnu.org>
6424
6425 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6426 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6427 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6428 staticidx goes up to 1597 out of 1600 = 0x640.)
6429
6430 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6431
6432 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6433 Otherwise, the umask might be mistakenly 0 while handling input signals.
6434
6435 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6436
6437 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6438
6439 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6440
6441 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6442 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6443 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6444 access to `contents' member of Lisp_Vector objects with AREF and ASET
6445 where appropriate.
6446
6447 2012-06-19 Chong Yidong <cyd@gnu.org>
6448
6449 * frame.c (delete_frame): When selecting a frame on a different
6450 text terminal, do not alter the terminal's top-frame.
6451
6452 * xdisp.c (format_mode_line_unwind_data): Record the target
6453 frame's selected window and its terminal's top-frame.
6454 (unwind_format_mode_line): Restore them.
6455 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6456 Callers changed.
6457 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6458 since tty frames can be explicitly named.
6459 (prepare_menu_bars): Likewise.
6460
6461 * term.c (Ftty_top_frame): New function.
6462
6463 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6464
6465 Port byte-code-meter to modern targets.
6466 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6467 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6468 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6469 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6470 (METER_1, METER_2): Simplify.
6471
6472 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6473
6474 * data.c (Fdefalias): Return `symbol' (bug#11686).
6475
6476 2012-06-18 Martin Rudalics <rudalics@gmx.at>
6477
6478 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6479 gets killed during executing of this function (Bug#11665).
6480 Try to always return Qt when the buffer has been actually killed.
6481 (Vkill_buffer_query_functions): In doc-string say that functions
6482 run by this hook should not change the current buffer.
6483
6484 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6485
6486 Fix recently-introduced process.c problems found by static checking.
6487 * process.c (write_queue_push, write_queue_pop, send_process):
6488 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6489 (write_queue_pop): Fix pointer signedness problem.
6490 (send_process): Remove unused local.
6491
6492 2012-06-17 Chong Yidong <cyd@gnu.org>
6493
6494 * xdisp.c (redisplay_internal): No need to redisplay terminal
6495 frames that are not on top.
6496
6497 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
6498
6499 * process.c (make_process): Initialize write_queue.
6500 (write_queue_push, write_queue_pop): New functions.
6501 (send_process): Use them to maintain correct ordering of process
6502 writes (Bug#10815).
6503
6504 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6505
6506 * lisp.h (eassert): Assume C89 or later.
6507 This removes the need for CHECK.
6508 (CHECK): Remove. Its comments about always evaluating its
6509 argument were confusing, as 'eassert' typically does not evaluate
6510 its argument.
6511
6512 * coding.c (produce_chars): Use ptrdiff_t, not int.
6513
6514 * xterm.c (x_draw_underwave): Check for integer overflow.
6515 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6516
6517 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
6518
6519 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6520 referenced (Bug#11583).
6521
6522 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6523
6524 Implement wave-style variant of underlining.
6525 * dispextern.h (face_underline_type): New enum.
6526 (face): Add field for underline type.
6527 * nsterm.m (ns_draw_underwave): New function.
6528 (ns_draw_text_decoration): Use it.
6529 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6530 New functions.
6531 (x_draw_glyph_string): Use them.
6532 * xfaces.c (Qline, Qwave): New Lisp objects.
6533 (check_lface_attrs, merge_face_ref)
6534 (Finternal_set_lisp_face_attribute, realize_x_face):
6535 Handle wave-style underline face attributes.
6536 * xterm.c (x_draw_underwave): New function.
6537 (x_draw_glyph_string): Use it.
6538
6539 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
6540
6541 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6542 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6543 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6544 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6545 ($(BLD)/w32select.$(O)): Update dependencies.
6546
6547 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6548
6549 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6550 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6551 * character.c (_fetch_multibyte_char_p): Remove.
6552 * alloc.c: Include "character.h" before "buffer.h".
6553 * bidi.c: Likewise.
6554 * buffer.c: Likewise.
6555 * bytecode.c: Likewise.
6556 * callint.c: Likewise.
6557 * callproc.c: Likewise.
6558 * casefiddle.c: Likewise.
6559 * casetab.c: Likewise.
6560 * category.c: Likewise.
6561 * cmds.c: Likewise.
6562 * coding.c: Likewise.
6563 * composite.c: Likewise.
6564 * dired.c: Likewise.
6565 * dispnew.c: Likewise.
6566 * doc.c: Likewise.
6567 * dosfns.c: Likewise.
6568 * editfns.c: Likewise.
6569 * emacs.c: Likewise.
6570 * fileio.c: Likewise.
6571 * filelock.c: Likewise.
6572 * font.c: Likewise.
6573 * fontset.c: Likewise.
6574 * fringe.c: Likewise.
6575 * indent.c: Likewise.
6576 * insdel.c: Likewise.
6577 * intervals.c: Likewise.
6578 * keyboard.c: Likewise.
6579 * keymap.c: Likewise.
6580 * lread.c: Likewise.
6581 * macros.c: Likewise.
6582 * marker.c: Likewise.
6583 * minibuf.c: Likewise.
6584 * nsfns.m: Likewise.
6585 * nsmenu.m: Likewise.
6586 * print.c: Likewise.
6587 * process.c: Likewise.
6588 * regex.c: Likewise.
6589 * region-cache.c: Likewise.
6590 * search.c: Likewise.
6591 * syntax.c: Likewise.
6592 * term.c: Likewise.
6593 * textprop.c: Likewise.
6594 * undo.c: Likewise.
6595 * unexsol.c: Likewise.
6596 * w16select.c: Likewise.
6597 * w32fns.c: Likewise.
6598 * w32menu.c: Likewise.
6599 * window.c: Likewise.
6600 * xdisp.c: Likewise.
6601 * xfns.c: Likewise.
6602 * xmenu.c: Likewise.
6603 * xml.c: Likewise.
6604 * xselect.c: Likewise.
6605
6606 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6607
6608 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6609 If all the glyphs of the glyph row came from strings, and we have no
6610 cursor positioning clues, put the cursor on the first glyph of the
6611 row.
6612 (handle_face_prop): Use chunk-relative overlay string index when
6613 indexing into it->string_overlays array. (Bug#11653)
6614 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6615 the rightmost. (Bug#11720)
6616
6617 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6618
6619 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6620 (CATEGORY_MEMBER): Enforce 1/0 value.
6621 * category.c (_temp_category_set): Remove.
6622
6623 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6624
6625 * window.c (Fdelete_other_windows_internal)
6626 (Fdelete_window_internal): Don't access frame's mouse highlight
6627 info of the initial frame. (Bug#11677)
6628
6629 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6630
6631 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6632 Assume USE_2_TAGS_FOR_INTS.
6633 (xreload): Adjust $tagmask width to match recent lisp.h change.
6634
6635 Simplify lisp.h in minor ways that should not affect code.
6636 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6637 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6638 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6639 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6640 (INTTYPEBITS): New macro, for clarity.
6641 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6642 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6643 Simplify now that USE_LSB_TAG is always defined.
6644 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6645 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6646
6647 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
6648
6649 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6650
6651 2012-06-13 Glenn Morris <rgm@gnu.org>
6652
6653 * s/bsd-common.h (BSD4_3):
6654 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6655
6656 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6657
6658 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6659 instead of union.
6660 (XLI, XIL): Define.
6661 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6662 Use them.
6663 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6664 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6665 * alloc.c (widen_to_Lisp_Object): Remove.
6666 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6667 * frame.c (delete_frame): Remove outdated comment.
6668 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6669 USE_LISP_UNION_TYPE.
6670 (Fw32_unregister_hot_key): Likewise.
6671 (Fw32_toggle_lock_key): Likewise.
6672 * w32menu.c (add_menu_item): Likewise.
6673 (w32_menu_display_help): Use XIL instead of checking
6674 USE_LISP_UNION_TYPE.
6675 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6676 (init_heap): Likewise.
6677 * w32term.c (w32_read_socket): Update comment.
6678
6679 2012-06-13 Glenn Morris <rgm@gnu.org>
6680
6681 * s/usg5-4-common.h, src/s/unixware.h:
6682 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6683
6684 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6685
6686 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6687
6688 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6689 * alloc.c (make_number) [!defined make_number]:
6690 Remove, as lisp.h always defines this now.
6691 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6692 (roundup_size): Verify that it is a power of 2.
6693 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6694 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6695 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6696 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6697 USE_LSB_TAG now is always defined to be either 0 or 1.
6698 All uses changed.
6699 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6700 code works fine either way, and efficiency is not a concern here,
6701 as the union type is for debugging, not for production.
6702 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6703 Use an inline function on all platforms when using the union type,
6704 since this is simpler and 'static inline' can be used portably
6705 within Emacs now.
6706 (LISP_INITIALLY_ZERO): New macro.
6707 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6708 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6709
6710 2012-06-12 Glenn Morris <rgm@gnu.org>
6711
6712 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6713
6714 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6715
6716 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6717 Move BROKEN_SIGIO to configure.
6718
6719 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6720 Move NO_TERMIO to configure.
6721
6722 2012-06-12 Chong Yidong <cyd@gnu.org>
6723
6724 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6725 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6726 MagickExportImagePixels is undefined.
6727
6728 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6729
6730 * image.c (imagemagick_load_image): Remove unused label.
6731
6732 2012-06-11 Glenn Morris <rgm@gnu.org>
6733
6734 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6735 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6736 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6737 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6738
6739 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6740
6741 * alloc.c (make_byte_code): New function.
6742 (Fmake_byte_code): Use it. Don't purify here.
6743 * lread.c (read1): Use it as well to avoid extra allocation.
6744
6745 2012-06-11 Chong Yidong <cyd@gnu.org>
6746
6747 * image.c (imagemagick_load_image): Implement transparency.
6748
6749 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6750
6751 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6752 account for preceding backslashes. (Bug#11663)
6753
6754 2012-06-09 Chong Yidong <cyd@gnu.org>
6755
6756 * term.c: Support italics in capable terminals (Bug#9652).
6757 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6758 (turn_on_face): Output using TS_enter_italic_mode if available.
6759 Don't handle unused blinking and alt-charset cases.
6760 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6761 and tty_alt_charset_p cases.
6762 (tty_capable_p, init_tty): Support italics.
6763
6764 * termchar.h (struct tty_display_info): Add field for italics.
6765 Remove unused blink field.
6766
6767 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6768 Handle slant.
6769
6770 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6771 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6772 tty_alt_charset_p. Add tty_italic_p.
6773
6774 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
6775
6776 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6777 dbus_type_is_basic if available.
6778 (xd_extract_signed, xd_extract_unsigned): Rename from
6779 extract_signed and extract_unsigned, respectively. Adapt callers.
6780
6781 2012-06-09 Chong Yidong <cyd@gnu.org>
6782
6783 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6784
6785 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6786 case (Bug#9752).
6787
6788 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6789
6790 * xdisp.c (vmessage): Treat frame message as multibyte.
6791 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6792 would generate the diagnostic "Making \302\247 buffer-local while
6793 let-bound!".
6794
6795 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6796
6797 * dispnew.c (showing_window_margins_p): Undo last change, which
6798 was done due to an inadvertent commit.
6799 (adjust_frame_glyphs_for_frame_redisplay): Do call
6800 showing_window_margins_p.
6801
6802 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6803
6804 * eval.c (Fmake_var_non_special): New primitive.
6805 (syms_of_eval): Defsubr it.
6806 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6807
6808 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
6809
6810 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6811 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6812
6813 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6814
6815 * alloc.c (allocate_vectorlike): Fix last change.
6816
6817 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6818
6819 Block-based vector allocation of small vectors.
6820 * lisp.h (struct vectorlike_header): New field `nbytes',
6821 adjust comment accordingly.
6822 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6823 to denote vector blocks. Adjust users (live_vector_p,
6824 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6825 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6826 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6827 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6828 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6829 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6830 (roundup_size): New constant.
6831 (struct vector_block): New data type.
6832 (vector_blocks, vector_free_lists, zero_vector): New variables.
6833 (all_vectors): Rename to `large_vectors'.
6834 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6835 (sweep_vectors): New functions.
6836 (allocate_vectorlike): Return `zero_vector' as the only vector of
6837 0 items. Allocate new vector from block if vector size is less than
6838 or equal to VBLOCK_BYTES_MAX.
6839 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6840 (init_alloc_once): Add call to init_vectors.
6841
6842 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6843
6844 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6845
6846 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6847
6848 * doprnt.c (doprnt): Truncate multibyte char correctly.
6849 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6850 would mishandle a string argument "Xc" if X was a multibyte
6851 character of length 2: it would truncate after X's first byte
6852 rather than including all of X.
6853
6854 2012-06-06 Chong Yidong <cyd@gnu.org>
6855
6856 * buffer.c (word_wrap): Doc fix.
6857
6858 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6859
6860 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6861
6862 2012-06-03 Glenn Morris <rgm@gnu.org>
6863
6864 * xdisp.c (tool-bar-style): Doc fix.
6865
6866 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6867
6868 * Makefile.in (PAXCTL): Define.
6869 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6870 binary via PaX flags if the paxctl utility is available.
6871 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6872 Restore PaX flags to their default. (Bug#11398)
6873
6874 2012-06-03 Chong Yidong <cyd@gnu.org>
6875
6876 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6877 buffer (Bug#11226).
6878
6879 2012-06-03 Chong Yidong <cyd@gnu.org>
6880
6881 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6882 (note_mode_line_or_margin_highlight): If there is no help echo,
6883 use mode-line-default-help-echo. Handle the case where the mouse
6884 position is past the end of the mode line string.
6885
6886 * buffer.c (buffer_local_value_1): New function, split from
6887 Fbuffer_local_value; can return Qunbound.
6888 (Fbuffer_local_value): Use it.
6889 (Vmode_line_format): Docstring tweaks.
6890
6891 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6892
6893 * sysdep.c (system_process_attributes): Improve comment.
6894
6895 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6896
6897 * keyboard.c: Export real-this-command to Elisp.
6898 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6899 and DEFVAR it. Update all users.
6900
6901 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6902
6903 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6904
6905 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6906 Convert pctcpu and pctmem to Lisp float properly.
6907 Let the compiler fold better, as 100.0/0x8000 is exact.
6908
6909 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6910
6911 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6912 cons_block.
6913
6914 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6915
6916 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6917
6918 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6919
6920 For a 'struct window', replace some Lisp_Object fields to
6921 bitfields where appropriate, remove unused fields.
6922 * window.h (struct window): Remove unused 'last_mark_x' and
6923 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6924 change it's type from Lisp_Object to bitfield.
6925 Change type of 'force_start', 'optional_new_start',
6926 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6927 fields from Lisp_Object to bitfield. Adjust users accordingly.
6928
6929 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6930
6931 Pacify gcc -Wdouble-precision when using Xaw.
6932 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6933 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6934 Use 'float' consistently, rather than 'float' in most places
6935 and 'double' in a couple of places.
6936
6937 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6938
6939 * xdisp.c (handle_stop): Detect whether we have overlay strings
6940 loaded by testing it->current.overlay_string_index to be
6941 non-negative, instead of checking whether n_overlay_strings is
6942 positive. (Bug#11587)
6943
6944 2012-05-31 Chong Yidong <cyd@gnu.org>
6945
6946 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6947
6948 * doc.c (Fsubstitute_command_keys): Doc fix.
6949
6950 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6951
6952 * search.c (search_buffer): Remove calls to
6953 r_alloc_inhibit_buffer_relocation, as it is now called by
6954 maybe_unify_char, which was the cause of relocation of buffer text
6955 in bug#11519.
6956
6957 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6958
6959 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6960 for the duration of call to load_charset, to avoid problems with
6961 callers of maybe_unify_char that access buffer text through C
6962 pointers.
6963
6964 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6965 decrement the inhibition flag, instead of just setting or
6966 resetting it.
6967
6968 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6969
6970 Remove obsolete '#define static' cruft.
6971 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6972 This #undef was "temporary" in 2000; it is no longer needed
6973 now that '#define static' has gone away.
6974 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6975 (gray_bitmap_bits): Remove; no longer needed.
6976 All uses replaced with definiens.
6977 * xterm.c: Include "bitmaps/gray.xbm".
6978
6979 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6980
6981 Clean up __executable_start, monstartup when --enable-profiling.
6982 The following changes affect the code only when profiling.
6983 * dispnew.c (__executable_start): Rename from safe_bcopy.
6984 Define only on platforms that need it.
6985 * emacs.c: Include <sys/gmon.h> when profiling.
6986 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6987 (__executable_start): Remove decl, since lisp.h does it now.
6988 (safe_bcopy): Remove decl; no longer has that name.
6989 (main): Coalesce #if into single bit of code, for simplicity.
6990 Cast pointers to uintptr_t, since standard libraries want integers
6991 and not pointers.
6992 * lisp.h (__executable_start): New decl.
6993
6994 2012-05-31 Glenn Morris <rgm@gnu.org>
6995
6996 * image.c (Fimagemagick_types): Doc fix.
6997
6998 2012-05-30 Jim Meyering <meyering@redhat.com>
6999
7000 * callproc.c (Fcall_process_region): Include directory component
7001 in mkstemp error message (Bug#11586).
7002
7003 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7004
7005 * alloc.c, lisp.h (make_pure_vector): Now static.
7006
7007 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7008
7009 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7010 Move to byte-run.el.
7011 (Fautoload): Do the hash-doc more carefully.
7012 * data.c (Fdefalias): Purify definition, except for keymaps.
7013 (Qdefun): Move from eval.c.
7014 * lisp.h (Qdefun): Remove.
7015 * lread.c (read1): Tiny simplification.
7016
7017 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
7018
7019 Do not create empty overlays with the evaporate property (Bug#9642).
7020 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7021 Bug#9642, but explicitly check that the buffer the overlay would
7022 be moved to is live and rearrange lines to make sure that errors
7023 will not put the overlay in an inconsistent state.
7024 (Fdelete_overlay): Cosmetics.
7025
7026 2012-05-28 Eli Zaretskii <eliz@gnu.org>
7027
7028 * w32term.c (my_bring_window_to_top): New function.
7029 (x_raise_frame): Use handle returned by DeferWindowPos, which
7030 could be different from the original one.
7031 Call my_bring_window_to_top instead of my_set_foreground_window.
7032 (Bug#11513)
7033
7034 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7035 by calling BringWindowToTop.
7036
7037 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7038 (WM_EMACS_END): Increase by one.
7039
7040 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7041
7042 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7043 This avoids undefined behavior that might cause the eassert
7044 to not catch an out-of-range value.
7045
7046 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
7047
7048 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7049 Update dependencies.
7050
7051 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7052
7053 * bidi.c (bidi_mirror_char): Fix last change.
7054
7055 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7056
7057 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7058 when referring to sectname field in printf format.
7059
7060 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7061
7062 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7063 Only r_alloc_inhibit_buffer_relocation needed to be added;
7064 the others were already declared.
7065
7066 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7067 before checking whether it's out of range. Put the check inside
7068 eassert. See
7069 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7070
7071 2012-05-27 Ken Brown <kbrown@cornell.edu>
7072
7073 * callproc.c (Fcall_process): Restore a line that was accidentally
7074 commented out in the 2011-02-13 change (bug#11547).
7075
7076 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7077
7078 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7079 defined on ralloc.c.
7080
7081 * buffer.c [REL_ALLOC]: Remove prototypes of
7082 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7083 they are now on lisp.h.
7084
7085 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7086
7087 * search.c (search_buffer): Use it to inhibit relocation of buffer
7088 text while re_search_2 is doing its job, because re_search_2 is
7089 passed C pointers to buffer text. (Bug#11519)
7090
7091 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7092 Update value to 24.
7093
7094 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7095 state after an additional call to move_it_in_display_line_to, keep
7096 the values of it->max_ascent and it->max_descent found for the
7097 entire line.
7098 (pos_visible_p): Revert the comparison against bottom_y to what it
7099 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7100 (Bug#11464)
7101
7102 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7103
7104 Fix coding-related core dumps with gcc -ftrapv.
7105 The code was computing A - B, where A and B are pointers, and B is
7106 random garbage. This can lead to core dumps on platforms that
7107 have special pointer registers, and it also leads to core dumps on
7108 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7109 A - B only when B is initialized properly.
7110 * coding.c (coding_set_source, coding_set_destination): Return void.
7111 (coding_change_source, coding_change_destinations): New functions,
7112 with the old behaviors of coding_set_source and coding_set_destination.
7113 All callers that need an offset changed to use these new functions.
7114
7115 2012-05-26 Glenn Morris <rgm@gnu.org>
7116
7117 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7118
7119 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7120
7121 Extend mouse support on W32 text-mode console.
7122 * xdisp.c (draw_row_with_mouse_face):
7123 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7124
7125 * w32console.c: Include window.h.
7126 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7127 New functions.
7128 (initialize_w32_display): Initialize mouse-highlight data.
7129
7130 * w32inevt.c: Include termchar.h and window.h.
7131 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7132 moves, call note_mouse_highlight. If help_echo changed, call
7133 gen_help_event to produce help-echo message in the echo area.
7134 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7135 highlight info.
7136
7137 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7138
7139 * lread.c (read1): Simplify slightly to avoid an overflow warning
7140 with GCC 4.7.0 on x86-64.
7141
7142 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7143
7144 * bidi.c (bidi_mirror_char): Revert last change: an int is
7145 definitely wide enough here.
7146
7147 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
7148
7149 Fix integer width and related bugs (Bug#9874).
7150 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7151 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7152 (string_bytes, check_sblock, allocate_string_data):
7153 (compact_small_strings, Fmake_bool_vector, make_string)
7154 (make_unibyte_string, make_multibyte_string)
7155 (make_string_from_bytes, make_specified_string)
7156 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7157 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7158 (mark_vectorlike):
7159 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7160 (allocate_pseudovector):
7161 Use int, not EMACS_INT, where int is wide enough.
7162 (inhibit_garbage_collection, Fgarbage_collect):
7163 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7164 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7165 int might not be wide enough.
7166 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7167 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7168 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7169 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7170 (bidi_level_of_next_char, bidi_move_to_visually_next):
7171 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7172 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7173 (Fkill_buffer, Fset_buffer_major_mode)
7174 (advance_to_char_boundary, Fbuffer_swap_text)
7175 (Fset_buffer_multibyte, overlays_at, overlays_in)
7176 (overlay_touches_p, struct sortvec, record_overlay_string)
7177 (overlay_strings, recenter_overlay_lists)
7178 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7179 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7180 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7181 (Foverlay_recenter, last_overlay_modification_hooks_used)
7182 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7183 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7184 (validate_region): Omit unnecessary test for b <= e,
7185 since that's guaranteed by the previous test.
7186 (adjust_overlays_for_delete): Avoid pos + length overflow.
7187 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7188 (report_overlay_modification):
7189 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7190 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7191 Omit pointer cast, which isn't needed anyway, and doesn't work
7192 after the EMACS_INT -> ptrdiff_t change.
7193 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7194 * buffer.h: Adjust decls to match defn changes elsewhere.
7195 (struct buffer_text, struct buffer):
7196 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7197 Use EMACS_INT, not int, where int might not be wide enough.
7198 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7199 not int, to avoid needless 32-bit limit on 64-bit hosts.
7200 (exec_byte_code): Use tighter memory-full test, one that checks
7201 for alloca overflow. Don't compute the address of the object just
7202 before an array, as that's not portable. Use EMACS_INT, not
7203 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7204 * callint.c (Fcall_interactively):
7205 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7206 * callproc.c (call_process_kill, Fcall_process):
7207 Don't assume pid_t fits into an Emacs fixnum.
7208 (call_process_cleanup, Fcall_process, child_setup):
7209 Don't assume pid_t fits into int.
7210 (call_process_cleanup, Fcall_process, delete_temp_file)
7211 (Fcall_process_region):
7212 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7213 (Fcall_process): Simplify handling of volatile integers.
7214 Use int, not EMACS_INT, where int will do.
7215 * casefiddle.c (casify_object, casify_region, operate_on_word)
7216 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7217 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7218 (casify_object): Avoid integer overflow when overallocating buffer.
7219 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7220 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
7221 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7222 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7223 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7224 integers are now checked earlier. All uses replaced with XINT.
7225 (ccl_driver):
7226 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7227 For CCL_MapSingle, check that content and value are in int range.
7228 (ccl_driver, Fregister_code_conversion_map):
7229 Check that Vcode_version_map_vector is a vector.
7230 (resolve_symbol_ccl_program): Check that vector header is in range.
7231 Always copy the vector, so that we can check its contents reliably
7232 now rather than having to recheck each instruction as it's being
7233 executed. Check that vector words fit in 'int'.
7234 (ccl_get_compiled_code, Fregister_ccl_program)
7235 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7236 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7237 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7238 contents are in range.
7239 (Fccl_execute_on_string): Check that status is in range.
7240 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7241 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7242 Accept and return EMACS_INT, not int, because callers can pass values
7243 out of 'int' range.
7244 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7245 (multibyte_chars_in_text, parse_str_as_multibyte)
7246 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7247 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7248 (string_escape_byte8, Fget_byte):
7249 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7250 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7251 avoid mishandling large integers.
7252 * character.h: Adjust decls to match defn changes elsewhere.
7253 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7254 (Ffind_charset_region):
7255 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7256 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7257 (load_charset_map_from_vector, Fdefine_charset_internal):
7258 Don't assume fixnum fits in int.
7259 (load_charset_map_from_vector, Fmap_charset_chars):
7260 Remove now-unnecessary CHECK_NATNUMs.
7261 (Fdefine_charset_internal): Check ranges here, more carefully.
7262 Don't rely on undefined behavior with signed left shift overflow.
7263 Don't assume unsigned int fits into fixnum, or that fixnum fits
7264 into unsigned int. Don't require max_code to be a valid fixnum;
7265 that's not true for gb10830 4-byte on a 32-bit host. Allow
7266 invalid_code to be a cons, for the same reason. Require code_offset
7267 to be a character. Avoid int overflow if max_char is close
7268 to INT_MAX.
7269 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7270 this is intended anyway and avoids some undefined behavior.
7271 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7272 INDEX_TO_CODE_POINT, as that's what it expects.
7273 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
7274 * charset.h (DECODE_CHAR): Return int, not unsigned;
7275 this is what was intended anyway, and it avoids undefined behavior.
7276 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7277 integer-overflow issues.
7278 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7279 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7280 where the argument is EMACS_INT, and this behavior is not intended.
7281 * chartab.c (Fmake_char_table, Fset_char_table_range)
7282 (uniprop_get_decoder, uniprop_get_encoder):
7283 Don't assume fixnum fits in int.
7284 * cmds.c (move_point): New function, that does the gist of
7285 Fforward_char and Fbackward_char, but does so while checking
7286 for integer overflow more accurately.
7287 (Fforward_char, Fbackward_char): Use it.
7288 (Fforward_line, Fend_of_line, internal_self_insert)
7289 (internal_self_insert):
7290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7291 Fix a FIXME, by checking for integer overflow when calculating
7292 target_clm and actual_clm.
7293 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
7294 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
7295 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7296 (coding_alloc_by_making_gap, alloc_destination)
7297 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7298 (encode_coding_utf_16, detect_coding_emacs_mule)
7299 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7300 (detect_coding_iso_2022, decode_coding_iso_2022)
7301 (encode_invocation_designation, encode_designation_at_bol)
7302 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7303 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7304 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7305 (encode_coding_ccl, encode_coding_raw_text)
7306 (detect_coding_charset, decode_coding_charset)
7307 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7308 (produce_composition, produce_charset, produce_annotation)
7309 (decode_coding, handle_composition_annotation)
7310 (handle_charset_annotation, consume_chars, decode_coding_gap)
7311 (decode_coding_object, encode_coding_object, detect_coding_system)
7312 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7313 (code_convert_region, code_convert_string)
7314 (Fdefine_coding_system_internal)
7315 (coding_set_source, coding_set_destination):
7316 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7317 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7318 (Fdefine_coding_system_internal):
7319 Don't assume fixnums fit in int.
7320 (decode_coding_gap, decode_coding_object, encode_coding_object)
7321 (Fread_coding_system, Fdetect_coding_region)
7322 (Funencodable_char_position, Fcheck_coding_systems_region)
7323 (get_translation, handle_composition_annotation, consume_chars):
7324 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7325 (consume_chars): Rewrite to not calculate an address outside buffer.
7326 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7327 Don't access memory outside of the args array.
7328 (Fdefine_coding_system_internal): Check for charset-id overflow.
7329 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7330 result of ENCODE_CHAR.
7331 * coding.h: Adjust decls to match defn changes elsewhere.
7332 (struct coding_system):
7333 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7334 * composite.c (get_composition_id, find_composition)
7335 (run_composition_function, update_compositions)
7336 (compose_text, composition_gstring_put_cache)
7337 (composition_gstring_p, composition_gstring_width)
7338 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7339 (composition_compute_stop_pos, composition_reseat_it)
7340 (composition_update_it, struct position_record)
7341 (find_automatic_composition, composition_adjust_point)
7342 (Fcomposition_get_gstring, Ffind_composition_internal):
7343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7344 (update_compositions):
7345 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7346 * composite.h: Adjust decls to match defn changes elsewhere.
7347 (struct composition):
7348 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7349 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7350 Do not attempt to compute the address of the object just before a
7351 buffer; this is not portable.
7352 (Faref, Faset):
7353 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7354 (Faset): Use int, not EMACS_INT, where int is wide enough.
7355 (Fstring_to_number): Don't assume fixnums fit in int.
7356 (Frem): Don't assume arg is nonnegative.
7357 * dbusbind.c (xd_append_arg): Check for integers out of range.
7358 (Fdbus_call_method): Don't overflow the timeout int.
7359 (extract_signed, extract_unsigned): New functions.
7360 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7361 (xd_get_connection_references): Return ptrdiff_t, not int.
7362 All uses changed.
7363 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7364 (xd_read_message_1):
7365 Use int, not unsigned, where the dbus API uses int.
7366 (Fdbus_message_internal): Don't overflow mtype.
7367 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7368 * dired.c (directory_files_internal, file_name_completion, scmp)
7369 (file_name_completion_stat):
7370 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7371 (file_name_completion): Don't overflow matchcount.
7372 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7373 * dispextern.h: Adjust decls to match defn changes elsewhere.
7374 (struct text_pos, struct glyph, struct bidi_saved_info)
7375 (struct bidi_string_data, struct bidi_it, struct composition_it)
7376 (struct it):
7377 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7378 (struct display_pos, struct composition_it, struct it):
7379 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7380 * dispnew.c (increment_matrix_positions)
7381 (increment_row_positions, mode_line_string)
7382 (marginal_area_string):
7383 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7384 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7385 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7386 (duration_to_sec_usec): New function, to check for overflow better.
7387 (Fsleep_for, sit_for): Use it.
7388 * doc.c (get_doc_string, store_function_docstring):
7389 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7390 (get_doc_string, Fsnarf_documentation):
7391 Use int, not EMACS_INT, where int is wide enough.
7392 (get_doc_string):
7393 Use SAFE_ALLOCA, not alloca.
7394 Check for overflow when converting EMACS_INT to off_t.
7395 * doprnt.c (doprnt):
7396 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7397 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7398 Don't assume uid_t fits into fixnum.
7399 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7400 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7401 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7402 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7403 (general_insert_function)
7404 (Finsert_char, make_buffer_string, make_buffer_string_both)
7405 (update_buffer_properties, Fbuffer_substring)
7406 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7407 (Fsubst_char_in_region, check_translation)
7408 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7409 (transpose_markers, Ftranspose_regions):
7410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7411 (clip_to_bounds): Move to lisp.h as an inline function).
7412 (Fconstrain_to_field): Don't assume integers are nonnegative.
7413 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7414 (Fsubst_char_in_region, Fsave_restriction):
7415 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7416 (Femacs_pid): Don't assume pid_t fits into fixnum.
7417 (lo_time): Use int, not EMACS_INT, when int suffices.
7418 (lisp_time_argument): Check for usec out of range.
7419 (Fencode_time): Don't assume fixnum fits in int.
7420 (Fuser_login_name, Fuser_full_name): Signal an error
7421 if a uid argument is out of range, rather than relying on
7422 undefined behavior.
7423 (Fformat_time_string): Remove now-unnecessary check.
7424 lisp_time_argument checks for out-of-range usec now.
7425 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7426 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7427 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7428 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7429 (init_cmdargs, Fdump_emacs):
7430 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7431 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7432 the bottom (typically) 32 bits of the fixnum.
7433 * eval.c (specpdl_size, call_debugger):
7434 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7435 (when_entered_debugger, Fbacktrace_debug):
7436 Don't assume fixnum can fit in int.
7437 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7438 the object just before a buffer; this is not portable.
7439 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7440 (grow_specpdl, unbind_to):
7441 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7442 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7443 (grow_specpdl): Simplify allocation by using xpalloc.
7444 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7445 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7446 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7447 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7448 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7449 (a_write, e_write):
7450 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7451 (Fcopy_file, non_regular_nbytes, read_non_regular)
7452 (Finsert_file_contents):
7453 Use int, not EMACS_INT, where int is wide enough.
7454 (READ_BUF_SIZE): Verify that it fits in int.
7455 (Finsert_file_contents): Check that counts are in proper range,
7456 rather than assuming fixnums fit into ptrdiff_t etc.
7457 Don't assume fixnums fit into int.
7458 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7459 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7460 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7461 (string_char_to_byte, string_byte_to_char)
7462 (string_make_multibyte, string_to_multibyte)
7463 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7464 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7465 (substring_both, Fdelete, internal_equal, Ffillarray)
7466 (Fclear_string, mapcar1)
7467 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7468 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7469 (larger_vector, make_hash_table, maybe_resize_hash_table)
7470 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7471 (Fmaphash, secure_hash):
7472 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7473 (concat): Check for string index and length overflow.
7474 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7475 (Frequire):
7476 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7477 (larger_vector): New API (vec, incr_min, size_max) replaces old
7478 one (vec, new_size, init). This catches size overflow.
7479 INIT was removed because it was always Qnil.
7480 All callers changed.
7481 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7482 the upper bound on a hash table index size.
7483 (make_hash_table, maybe_resize_hash_table): Use it.
7484 (secure_hash): Computer start_byte and end_byte only after
7485 they're known to be in ptrdiff_t range.
7486 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7487 (Ffont_get_glyphs, Ffont_at):
7488 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7489 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7490 (Flist_fonts, Fopen_font):
7491 Don't assume fixnum can fit in int.
7492 (check_gstring): Don't assume index can fit in int.
7493 (font_match_p): Check that fixnum is a character, not a nonnegative
7494 fixnum, since the later code needs to stuff it into an int.
7495 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7496 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7497 conversion overflow issues.
7498 (Fopen_font): Check for integer out of range.
7499 (Ffont_get_glyphs): Don't assume index can fit in int.
7500 * font.h: Adjust decls to match defn changes elsewhere.
7501 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7502 integer overflow.
7503 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7504 printmax_t, where ptrdiff_t is wide enough.
7505 (Finternal_char_font):
7506 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7507 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7508 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7509 (Fset_frame_position, x_set_frame_parameters)
7510 (x_set_line_spacing, x_set_border_width)
7511 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7512 Check that fixnums are in proper range for system types.
7513 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7514 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7515 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7516 Use SAFE_ALLOCA_LISP, not alloca.
7517 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7518 intptr_t is wide enough.
7519 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7520 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7521 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7522 Check for fixnum out of range.
7523 * ftfont.c (ftfont_list): Don't assume index fits in int.
7524 Check that fixnums are in proper range for system types.
7525 (ftfont_shape_by_flt):
7526 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7527 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7528 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7529 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7530 Check that fixnums are in proper range for system types.
7531 * gnutls.h: Adjust decls to match defn changes elsewhere.
7532 * gtkutil.c (xg_dialog_run):
7533 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7534 (update_frame_tool_bar):
7535 Check that fixnums are in proper range for system types.
7536 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7537 (lookup_image): Check that fixnums are in range for system types.
7538 * indent.c (last_known_column, last_known_column_point):
7539 (current_column_bol_cache):
7540 (skip_invisible, current_column, check_display_width):
7541 (check_display_width, scan_for_column, current_column_1)
7542 (Findent_to, Fcurrent_indentation, position_indentation)
7543 (indented_beyond_p, Fmove_to_column, compute_motion):
7544 (Fcompute_motion, Fvertical_motion):
7545 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7546 (last_known_column_modified): Use EMACS_INT, not int.
7547 (check_display_width):
7548 (Fcompute_motion):
7549 Check that fixnums and floats are in proper range for system types.
7550 (compute_motion): Don't assume index or fixnum fits in int.
7551 (compute_motion, Fcompute_motion):
7552 Use int, not EMACS_INT, when it is wide enough.
7553 (vmotion): Omit local var start_hpos that is always 0; that way
7554 we don't need to worry about overflow in expressions involving it.
7555 * indent.h: Adjust decls to match defn changes elsewhere.
7556 (struct position):
7557 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7558 Use int, not EMACS_INT, where int is wide enough.
7559 Remove unused members ovstring_chars_done and tab_offset;
7560 all uses removed.
7561 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7562 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7563 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7564 (make_gap, copy_text, insert, insert_and_inherit)
7565 (insert_before_markers, insert_before_markers_and_inherit)
7566 (insert_1, count_combining_before, count_combining_after)
7567 (insert_1_both, insert_from_string)
7568 (insert_from_string_before_markers, insert_from_string_1)
7569 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7570 (adjust_after_replace, adjust_after_insert, replace_range)
7571 (replace_range_2, del_range, del_range_1, del_range_byte)
7572 (del_range_both, del_range_2, modify_region)
7573 (prepare_to_modify_buffer, signal_before_change)
7574 (signal_after_change, Fcombine_after_change_execute):
7575 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7576 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7577 (balance_an_interval, split_interval_right, split_interval_left)
7578 (find_interval, next_interval, update_interval)
7579 (adjust_intervals_for_insertion, delete_node, delete_interval)
7580 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7581 (static_offset_intervals, offset_intervals)
7582 (merge_interval_right, merge_interval_left, make_new_interval)
7583 (graft_intervals_into_buffer, temp_set_point_both)
7584 (temp_set_point, set_point, adjust_for_invis_intang)
7585 (set_point_both, move_if_not_intangible, get_property_and_range)
7586 (get_local_map, copy_intervals, copy_intervals_to_string)
7587 (compare_string_intervals, set_intervals_multibyte_1):
7588 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7589 * intervals.h: Adjust decls to match defn changes elsewhere.
7590 (struct interval):
7591 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7592 * keyboard.c (this_command_key_count, this_single_command_key_start)
7593 (before_command_key_count, before_command_echo_length, echo_now)
7594 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7595 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7596 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7597 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7598 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7599 (last_non_minibuf_size, last_point_position, echo_truncate)
7600 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7601 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7602 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7603 (stuff_buffered_input):
7604 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7605 (last_auto_save, command_loop_1, read_char):
7606 Use EMACS_INT, not int, to avoid integer overflow.
7607 (record_char): Avoid overflow in total_keys computation.
7608 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7609 * keyboard.h: Adjust decls to match defn changes elsewhere.
7610 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7611 (Fkey_description, Fdescribe_vector, Flookup_key):
7612 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7613 (click_position): New function, to check that positions are in range.
7614 (Fcurrent_active_maps):
7615 (describe_command):
7616 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7617 (Faccessible_keymaps, Fkey_description):
7618 (preferred_sequence_p):
7619 Don't assume fixnum can fit into int.
7620 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7621 Check for integer overflow in size calculations.
7622 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7623 avoid mishandling large integers.
7624 * lisp.h: Adjust decls to match defn changes elsewhere.
7625 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7626 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7627 (struct Lisp_Marker):
7628 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7629 (clip_to_bounds): Now an inline function, moved here from editfns.c.
7630 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7631 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7632 All callers changed.
7633 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7634 Assume the arg has valid form, since it always does.
7635 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7636 unsigned integer system type.
7637 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7638 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7639 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7640 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7641 (duration_to_sec_usec): New decl.
7642 * lread.c (read_from_string_index, read_from_string_index_byte)
7643 (read_from_string_limit, readchar, unreadchar, openp)
7644 (read_internal_start, read1, oblookup):
7645 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7646 (Fload, readevalloop, Feval_buffer, Feval_region):
7647 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7648 (openp): Check for out-of-range argument to 'access'.
7649 (read1): Use int, not EMACS_INT, where int is wide enough.
7650 Don't assume fixnum fits into int.
7651 Fix off-by-one error that can read outside a buffer.
7652 (read_filtered_event): Use duration_to_sec_usec
7653 to do proper overflow checking on durations.
7654 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7655 in size calculation.
7656 (Fexecute_kbd_macro):
7657 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7658 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7659 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7660 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7661 (set_marker_both, set_marker_restricted_both, marker_position)
7662 (marker_byte_position, Fbuffer_has_markers_at):
7663 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7664 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7665 * menu.c (ensure_menu_items): Rename from grow_menu_items.
7666 It now merely ensures that the menu is large enough, without
7667 necessarily growing it, as this avoids some integer overflow issues.
7668 All callers changed.
7669 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7670 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7671 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7672 Use SAFE_ALLOCA_LISP, not alloca.
7673 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7674 to EMACS_INT. Check that fixnums are in proper range for system types.
7675 * minibuf.c (minibuf_prompt_width, string_to_object)
7676 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7677 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7678 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7679 (get_minibuffer, read_minibuf_unwind):
7680 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7681 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7682 this simplifies overflow checking. All callers changed.
7683 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7684 (Ftest_completion):
7685 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7686 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7687 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7688 Check that fixnums are in proper range for system types.
7689 (Fx_create_frame, Fx_show_tip):
7690 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7691 * nsfont.m (ns_findfonts, nsfont_list_family):
7692 Don't assume fixnum fits in long.
7693 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7694 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7695 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7696 wide enough.
7697 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7698 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7699 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7700 (PRINTDECLARE, PRINTPREPARE):
7701 (strout, print_string):
7702 (print, print_preprocess, print_check_string_charset_prop)
7703 (print_object):
7704 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7705 (PRINTDECLARE):
7706 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7707 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7708 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7709 (printchar, strout): Use xpalloc to catch size calculation overflow.
7710 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7711 (print_error_message): Use SAFE_ALLOCA, not alloca.
7712 (print_object): Use int, not EMACS_INT, where int is wide enough.
7713 (print_depth, new_backquote_output, print_number_index):
7714 Use ptrdiff_t, not int, where int might not be wide enough.
7715 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7716 (Fset_process_window_size, Fformat_network_address)
7717 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7718 (sigchld_handler):
7719 Check that fixnums are in proper range for system types.
7720 (Fsignal_process): Simplify by avoiding a goto.
7721 Check for process-ids out of pid_t range rather than relying on
7722 undefined behavior.
7723 (process_tick, update_tick): Use EMACS_INT, not int.
7724 (Fformat_network_address, read_process_output, send_process)
7725 (Fprocess_send_region, status_notify):
7726 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7727 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7728 (wait_reading_process_output, read_process_output, exec_sentinel):
7729 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7730 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7731 (Faccept_process_output): Use duration_to_sec_usec to do proper
7732 overflow checking on durations.
7733 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7734 Don't assume pid_t fits in int.
7735 * process.h (struct Lisp_Process): Members tick and update_tick
7736 are now of type EMACS_INT, not int.
7737 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7738 configured --with-wide-int.
7739 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7740 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7741 * search.c (looking_at_1, string_match_1):
7742 (fast_string_match, fast_c_string_match_ignore_case)
7743 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7744 (scan_newline, find_before_next_newline, search_command)
7745 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7746 (set_search_regs, wordify):
7747 (Freplace_match):
7748 (Fmatch_data):
7749 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7750 (string_match_1, search_buffer, set_search_regs):
7751 (Fmatch_data):
7752 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7753 (wordify): Check for overflow in size calculation.
7754 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7755 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7756 Check that fixnums are in proper range for system types.
7757 * sound.c (struct sound_device)
7758 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7760 (Fplay_sound_internal):
7761 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7762 * syntax.c (struct lisp_parse_state, find_start_modiff)
7763 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7764 (Fparse_partial_sexp):
7765 Don't assume fixnums can fit in int.
7766 (struct lisp_parse_state, find_start_pos, find_start_value)
7767 (find_start_value_byte, find_start_begv)
7768 (update_syntax_table, char_quoted, dec_bytepos)
7769 (find_defun_start, prev_char_comend_first, back_comment):
7770 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7771 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7772 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7773 (Finternal_describe_syntax_value): Check that match_lisp is a
7774 character, not an integer, since the code stuffs it into int.
7775 (scan_words, scan_sexps_forward):
7776 Check that fixnums are in proper range for system types.
7777 (Fforward_word):
7778 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7779 (scan_sexps_forward):
7780 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7781 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7782 * syntax.h: Adjust decls to match defn changes elsewhere.
7783 (struct gl_state_s):
7784 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7785 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7786 MOST_POSITIVE_FIXNUM.
7787 * sysdep.c (wait_for_termination_1, wait_for_termination)
7788 (interruptible_wait_for_termination, mkdir):
7789 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7790 (emacs_read, emacs_write):
7791 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7792 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7793 and double all fit in int.
7794 * term.c (set_tty_color_mode):
7795 Check that fixnums are in proper range for system types.
7796 * termhooks.h (struct input_event):
7797 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7798 * textprop.c (validate_interval_range, interval_of)
7799 (Fadd_text_properties, set_text_properties_1)
7800 (Fremove_text_properties, Fremove_list_of_text_properties)
7801 (Ftext_property_any, Ftext_property_not_all)
7802 (copy_text_properties, text_property_list, extend_property_ranges)
7803 (verify_interval_modification):
7804 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7805 (Fnext_single_char_property_change)
7806 (Fprevious_single_char_property_change):
7807 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7808 (copy_text_properties):
7809 Check for integer overflow in index calculation.
7810 * undo.c (last_boundary_position, record_point, record_insert)
7811 (record_delete, record_marker_adjustment, record_change)
7812 (record_property_change):
7813 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7814 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7815 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7816 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7817 (Fx_hide_tip, Fx_file_dialog):
7818 * w32menu.c (set_frame_menubar):
7819 Use ptrdiff_t, not int, for consistency with rest of code.
7820 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7821 (select_window, Fdelete_other_windows_internal)
7822 (window_scroll_pixel_based, window_scroll_line_based)
7823 (Frecenter, Fset_window_configuration):
7824 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7825 (Fset_window_hscroll, run_window_configuration_change_hook)
7826 (set_window_buffer, temp_output_buffer_show, scroll_command)
7827 (Fscroll_other_window, Frecenter):
7828 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7829 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7830 Don't assume fixnum fits in int.
7831 (Fset_window_scroll_bars):
7832 Check that fixnums are in proper range for system types.
7833 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7834 (string_pos, c_string_pos, number_of_chars, init_iterator)
7835 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7836 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7837 (compute_display_string_end, handle_face_prop)
7838 (face_before_or_after_it_pos, handle_invisible_prop)
7839 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7840 (display_prop_intangible_p, string_buffer_position_lim)
7841 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7842 (get_overlay_strings_1, get_overlay_strings)
7843 (iterate_out_of_display_property, forward_to_next_line_start)
7844 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7845 (get_next_display_element, set_iterator_to_next)
7846 (get_visually_first_element, compute_stop_pos_backwards)
7847 (handle_stop_backwards, next_element_from_buffer)
7848 (move_it_in_display_line_to, move_it_in_display_line)
7849 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7850 (add_to_log, message_dolog, message_log_check_duplicate)
7851 (message2, message2_nolog, message3, message3_nolog
7852 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7853 (current_message_1, truncate_echo_area, truncate_message_1)
7854 (set_message, set_message_1, store_mode_line_noprop)
7855 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7856 (text_outside_line_unchanged_p, check_point_in_composition)
7857 (reconsider_clip_changes)
7858 (redisplay_internal, set_cursor_from_row, try_scrolling)
7859 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7860 (redisplay_window, find_last_unchanged_at_beg_row)
7861 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7862 (trailing_whitespace_p, find_row_edges, display_line)
7863 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7864 (display_mode_element, store_mode_line_string)
7865 (pint2str, pint2hrstr, decode_mode_spec)
7866 (display_count_lines, display_string, draw_glyphs)
7867 (x_produce_glyphs, x_insert_glyphs)
7868 (rows_from_pos_range, mouse_face_from_buffer_pos)
7869 (fast_find_string_pos, mouse_face_from_string_pos)
7870 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7871 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7872 (safe_call, init_from_display_pos, handle_fontified_prop)
7873 (handle_single_display_spec, load_overlay_strings)
7874 (with_echo_area_buffer, setup_echo_area_for_printing)
7875 (display_echo_area, echo_area_display)
7876 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7877 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7878 (redisplay_window, dump_glyph_row, display_mode_line)
7879 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7880 (handle_display_spec, display_prop_string_p):
7881 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7882 (handle_single_display_spec, build_desired_tool_bar_string)
7883 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7884 (get_specified_cursor_type):
7885 Check that fixnums are in proper range for system types.
7886 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7887 (Flookup_image_map):
7888 Don't assume fixnums fit in int.
7889 (compare_overlay_entries):
7890 Avoid mishandling comparisons due to subtraction overflow.
7891 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7892 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7893 (handle_tool_bar_click):
7894 Use int, not unsigned, since we prefer signed and the signedness
7895 doesn't matter here.
7896 (get_next_display_element, next_element_from_display_vector):
7897 Use int, not EMACS_INT, when int is wide enough.
7898 (start_hourglass): Use duration_to_sec_usec to do proper
7899 overflow checking on durations.
7900 * xfaces.c (Fbitmap_spec_p):
7901 Check that fixnums are in proper range for system types.
7902 (compare_fonts_by_sort_order):
7903 Avoid mishandling comparisons due to subtraction overflow.
7904 (Fx_family_fonts, realize_basic_faces):
7905 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7906 (Fx_family_fonts):
7907 Don't assume fixnum fits in int.
7908 Use SAFE_ALLOCA_LISP, not alloca.
7909 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7910 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7911 (face_at_buffer_position, face_for_overlay_string)
7912 (face_at_string_position):
7913 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7914 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7915 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7916 (Fx_show_tip):
7917 Check that fixnums are in proper range for system types.
7918 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7919 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7920 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7921 (Fx_change_window_property): Don't assume fixnums fit in int.
7922 * xfont.c (xfont_chars_supported):
7923 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7924 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7925 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7926 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7927 * xml.c (parse_region):
7928 * xrdb.c (magic_file_p):
7929 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7930 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7931 (x_get_local_selection, x_reply_selection_request)
7932 (x_handle_selection_request, wait_for_property_change):
7933 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7934 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7935 short is wide enough.
7936 (x_send_client_event): Don't assume fixnum fits in int.
7937 * xterm.c (x_x_to_emacs_modifiers):
7938 Don't assume EMACS_INT overflows nicely into int.
7939 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7940 may come from Lisp.
7941 (handle_one_xevent): NATNUMP can eval its arg twice.
7942 (x_connection_closed):
7943 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7944 * xterm.h: Adjust decls to match defn changes elsewhere.
7945 (struct scroll_bar): Use struct vectorlike_header
7946 rather than rolling our own approximation.
7947 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7948
7949 2012-05-25 Glenn Morris <rgm@gnu.org>
7950
7951 * lisp.mk (lisp): Update for more files being compiled now.
7952
7953 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7954
7955 * lread.c: Remove `read_pure' which makes no difference.
7956 (read_pure): Remove var.
7957 (unreadpure): Remove function.
7958 (readevalloop): Don't call read_list with -1 flag.
7959 (read1, read_vector): Don't test read_pure any more.
7960 (read_list): Simplify.
7961
7962 * fileio.c, character.h: Minor style tweaks.
7963
7964 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7965
7966 * window.h (clip_changed): Remove useless declaration.
7967
7968 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7969
7970 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7971 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7972
7973 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7974
7975 Remove src/m/*.
7976 This directory predates autoconf and is no longer needed nowadays.
7977 Move its few remaining bits of functionality to where they're needed.
7978 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7979 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7980 * m/template.h: Remove.
7981 * Makefile.in (M_FILE): Remove. All uses removed.
7982 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7983 * lisp.h (USE_LSB_TAG):
7984 * mem-limits.h (EXCEEDS_LISP_PTR):
7985 Use VAL_MAX, not VALBITS, in #if.
7986 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7987 (EMACS_UINT): Define unconditionally now.
7988 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7989 (BITS_PER_EMACS_INT): New constants, replacing
7990 what used to be in config.h, but not useful in #if.
7991 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7992 define them any more.
7993 (VAL_MAX): New macro.
7994 (VALMASK): Use it.
7995 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7996 BITS_PER_EMACS_INT, in #if.
7997 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7998 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7999 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8000 * s/ms-w32.h (DATA_START):
8001 Move here from removed file m/intel386.h.
8002 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8003 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8004
8005 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8006
8007 Assume C89 or later.
8008 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8009 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8010 (xrealloc):
8011 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8012 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8013 * textprop.c, tparam.c (NULL): Remove.
8014 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8015 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8016 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8017 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8018 * xterm.c (input_signal_count): Assume volatile works.
8019
8020 2012-05-21 Ken Brown <kbrown@cornell.edu>
8021
8022 * xgselect.c (xg_select): Fix first argument in call to 'select'
8023 (bug#11508).
8024
8025 2012-05-20 Ken Brown <kbrown@cornell.edu>
8026
8027 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8028 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8029
8030 2012-05-19 Ken Brown <kbrown@cornell.edu>
8031
8032 * xfns.c (x_in_use): Remove `static' qualifier.
8033 * xterm.h (x_in_use): Declare.
8034 * xgselect.c: Include xterm.h.
8035 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8036 and `display_arg' (bug#9754).
8037
8038 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8039
8040 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8041
8042 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8043 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8044
8045 2012-05-18 Eli Zaretskii <eliz@gnu.org>
8046
8047 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8048
8049 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8050 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8051
8052 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8053 reference to image_cache->refcount.
8054 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8055
8056 2012-05-17 Juri Linkov <juri@jurta.org>
8057
8058 * search.c (Fword_search_regexp, Fword_search_backward)
8059 (Fword_search_forward, Fword_search_backward_lax)
8060 (Fword_search_forward_lax): Move functions to isearch.el
8061 (bug#10145, bug#11381).
8062
8063 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8064
8065 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8066
8067 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8068
8069 * lread.c (init_obarray): Declare Qt and Qnil as special.
8070
8071 2012-05-14 Glenn Morris <rgm@gnu.org>
8072
8073 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8074 Put "libexec" before "bin", for the sake of init_callproc_1.
8075
8076 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8077
8078 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8079
8080 * unexaix.c: Port to more-recent AIX compilers.
8081 (report_error, report_error_1, make_hdr, copy_sym)
8082 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8083 Make arguments const char *, not char *, to avoid violations of C
8084 standard and to fix some AIX warnings reported by Gilles Pion.
8085
8086 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8087
8088 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8089 already have overlays loaded.
8090 (handle_single_display_spec): Before returning without displaying
8091 fringe bitmap, synchronize the bidi iterator with the main display
8092 iterator, by calling iterate_out_of_display_property.
8093 (iterate_out_of_display_property): Detect buffer iteration by
8094 testing that it->string is a Lisp string.
8095 (get_next_display_element): When the current object is exhausted,
8096 and there's something on it->stack, call set_iterator_to_next to
8097 proceed with what's on the stack, instead of returning zero.
8098 (set_iterator_to_next): If called at the end of a Lisp string,
8099 proceed to consider_string_end without incrementing string
8100 position. Don't increment display vector index past the end of
8101 the display vector. (Bug#11417)
8102 (pos_visible_p): Don't report a position visible when move_it_to
8103 stopped at the last line of window, which happens to be scanned
8104 backwards by the bidi iteration. (Bug#11464)
8105
8106 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8107
8108 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8109 and right-margin display specs even if the spec is invalid or we
8110 are on a TTY, and thus unable to display on the fringes.
8111 That's because the text with the property will not be displayed anyway,
8112 so we need to signal to the caller that this is a "replacing"
8113 display spec. This fixes display when the spec is invalid or we
8114 are on a TTY.
8115
8116 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8117
8118 * unexaix.c (make_hdr): Fix typo in prototype.
8119 This bug broke the build on AIX. Problem reported by Gilles Pion.
8120
8121 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
8122
8123 * keyboard.c (kbd_buffer_get_event): Read special events also in
8124 batch mode. (Bug#11415)
8125
8126 2012-05-12 Glenn Morris <rgm@gnu.org>
8127
8128 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8129
8130 2012-05-12 Eli Zaretskii <eliz@gnu.org>
8131
8132 * lisp.mk (lisp): Add newcomment.elc.
8133
8134 2012-05-12 Glenn Morris <rgm@gnu.org>
8135
8136 * Makefile.in (MKDIR_P): New, set by configure.
8137 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8138
8139 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8140
8141 Remove unused function hourglass_started.
8142 * dispextern.h (hourglass_started):
8143 * w32fns.c (hourglass_started):
8144 * xdisp.c (hourglass_started): Remove.
8145
8146 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
8147
8148 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8149 Update dependencies.
8150
8151 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8152
8153 * xgselect.c (xg_select): Put maxfds+1 into a var.
8154 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8155
8156 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8157
8158 2012-05-10 Dave Abrahams <dave@boostpro.com>
8159
8160 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8161 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8162
8163 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
8164
8165 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8166 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8167 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8168 Initialize xd_registered_buses.
8169
8170 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8171
8172 Untag more efficiently if USE_LSB_TAG.
8173 This is based on a proposal by YAMAMOTO Mitsuharu in
8174 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8175 For an admittedly artificial (nth 8000 longlist) benchmark on
8176 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8177 Emacs's overall text size by 1%.
8178 * lisp.h (XUNTAG): New macro.
8179 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8180 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8181 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8182 * eval.c (Fautoload):
8183 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8184 * frame.h (XFRAME): Use XUNTAG.
8185
8186 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8187 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8188 Remove unportable assumptions about print widths of types like
8189 dbus_uint32_t.
8190 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8191 intptr_t when converting between pointer and integer, to avoid GCC
8192 warnings about wrong width.
8193
8194 2012-05-09 Eli Zaretskii <eliz@gnu.org>
8195
8196 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8197 stack for each reader_thread, instead of defaulting to 8MB
8198 determined by the linker. This avoids failures in creating
8199 subprocesses on Windows 7, see the discussion in this thread:
8200 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8201
8202 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8203
8204 Fix up display of the *Minibuf-0* buffer in the mini window.
8205 * keyboard.c (read_char): Don't clear the echo area if there's no
8206 message to clear.
8207 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8208 contents of *Minibuf-0*) if there's no message displayed in its stead.
8209
8210 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
8211
8212 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8213 batch mode.
8214
8215 2012-05-06 Chong Yidong <cyd@gnu.org>
8216
8217 * lisp.mk (lisp): Update.
8218
8219 2012-05-05 Jim Meyering <meyering@redhat.com>
8220
8221 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8222
8223 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8224
8225 * data.c (PUT_ERROR): New macro.
8226 (syms_of_data): Use it. Add new error type `user-error'.
8227 * undo.c (user_error): New function.
8228 (Fprimitive_undo): Use it.
8229 * print.c (print_error_message): Adjust print style for `user-error'.
8230 * keyboard.c (user_error): New function.
8231 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8232
8233 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8234
8235 Do not limit current-time-string to years 1000..9999.
8236 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8237 (Fcurrent_time_string): Support any year that is supported by the
8238 underlying localtime representation. Don't use asctime, as it
8239 has undefined behavior for years outside the range -999..9999.
8240
8241 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8242
8243 Fix race conditions involving setenv, gmtime, localtime, asctime.
8244 Without this fix, interrupts could mess up code that uses these
8245 nonreentrant functions, since setting TZ invalidates existing
8246 tm_zone or tzname values, and since most of these functions return
8247 pointers to static storage.
8248 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8249 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8250 Grow the critical sections to include not just invoking
8251 localtime/gmtime, but also accessing these functions' results
8252 including their tm_zone values if any, and any related TZ setting.
8253 (format_time_string): Last arg is now struct tm *, not struct tm **,
8254 so that the struct tm is saved in the critical section.
8255 All callers changed. Simplify allocation of initial buffer, partly
8256 motivated by the fact that memory allocation needs to be outside
8257 the critical section.
8258
8259 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8260
8261 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8262 with RESET_INTERVAL.
8263
8264 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8265 Remove duplicated buffer name initialization.
8266
8267 2012-05-02 Jim Meyering <jim@meyering.net>
8268
8269 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8270
8271 * xfns.c (x_window): Use xstrdup (Bug#11375).
8272
8273 2012-05-02 Eli Zaretskii <eliz@gnu.org>
8274
8275 * xdisp.c (pos_visible_p): If already at a newline from the
8276 display string before the 'while' loop, don't walk back the glyphs
8277 from it3.glyph_row. Solves assertion violation when the display
8278 string begins with a newline (egg.el). (Bug#11367)
8279
8280 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8281
8282 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8283 Move to simple.el.
8284
8285 2012-05-01 Glenn Morris <rgm@gnu.org>
8286
8287 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8288 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8289 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8290 All were removed before 23.1.
8291
8292 * dispnew.c: Remove HAVE_LIBNCURSES test;
8293 it is always true on relevant platforms.
8294
8295 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8296 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8297
8298 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8299
8300 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8301
8302 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8303 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8304 Remove.
8305
8306 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8307
8308 Do not avoid creating empty evaporating overlays (Bug#9642).
8309 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8310 That is, do not delete an evaporating overlay if it becomes
8311 empty after its bounds are adjusted to fit within its buffer.
8312 This fix caused other problems, and I'm reverting it until we get
8313 to the bottom of them.
8314
8315 2012-04-27 Chong Yidong <cyd@gnu.org>
8316
8317 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8318
8319 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8320
8321 * xdisp.c (pos_visible_p): If the window start position is beyond
8322 ZV, start the display from buffer beginning. Prevents assertion
8323 violation in init_iterator when the minibuffer window is scrolled
8324 via the scroll bar.
8325
8326 * window.c (window_scroll_pixel_based): Likewise.
8327
8328 2012-04-27 Chong Yidong <cyd@gnu.org>
8329
8330 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8331
8332 2012-04-27 Glenn Morris <rgm@gnu.org>
8333
8334 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8335 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8336
8337 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8338
8339 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8340 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
8341
8342 2012-04-26 Eli Zaretskii <eliz@gnu.org>
8343
8344 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8345 display element, check also the underlying string or buffer
8346 character. (Bug#11341)
8347
8348 * w32menu.c: Include w32heap.h.
8349 (add_menu_item): If the call to AppendMenuW (via
8350 unicode_append_menu) fails, disable Unicode menus only if we are
8351 running on Windows 9X/Me.
8352
8353 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8354
8355 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8356 (xgetint): Add missing shift for LSB tags.
8357
8358 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8359
8360 * keyboard.c (read_char): Don't wipe echo area for select window
8361 events: These might get delayed via `mouse-autoselect-window'
8362 (Bug#11304).
8363
8364 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8365
8366 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8367 manipulation of :loaded-from data.
8368
8369 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8370
8371 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8372 now a cons (bug#11311).
8373
8374 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8375
8376 Do not create empty overlays with the evaporate property (Bug#9642).
8377 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8378 if it becomes empty after its bounds are adjusted to fit within
8379 its buffer. Without this fix, in a nonempty buffer (let ((o
8380 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8381 yields an empty overlay that has the evaporate property, which is
8382 not supposed to happen.
8383
8384 Fix minor GTK3 problems found by static checking.
8385 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8386 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8387 (struct _EmacsFixedClass, emacs_fixed_get_type):
8388 Move decls here from emacsgtkfixed.h, since they needn't be public.
8389 (emacs_fixed_get_type): Now static.
8390 (emacs_fixed_class_init): Omit unused local.
8391 (emacs_fixed_child_type): Remove; unused.
8392 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8393 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8394 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8395 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8396 (EMACS_FIXED_GET_CLASS): Remove; unused.
8397 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8398
8399 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8400 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8401
8402 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8403
8404 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8405 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8406 (__malloc_size_t, __malloc_ptrdiff_t):
8407 Remove. All uses removed, replaced by the definiens if needed,
8408 since we can assume C89 or better now.
8409 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8410 (protect_malloc_state, align, get_contiguous_space)
8411 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8412 (malloc_atfork_handler_child, malloc_enable_thread)
8413 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8414 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8415 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8416 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8417 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8418 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8419 Define using prototypes, not old style.
8420 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8421 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8422 (align): Don't assume that signed integer overflow wraps around.
8423 Omit unused local var.
8424 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8425 (_free_internal_nolock, memalign, mallochook, reallochook):
8426 Omit no-longer-needed casts.
8427 (valloc): Use getpagesize, not __getpagesize.
8428 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8429 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8430
8431 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8432
8433 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
8434
8435 Move functions from C to Lisp. Make non-blocking method calls
8436 the default. Implement further D-Bus standard interfaces.
8437
8438 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8439 (QCdbus_request_name_allow_replacement)
8440 (QCdbus_request_name_replace_existing)
8441 (QCdbus_request_name_do_not_queue)
8442 (QCdbus_request_name_reply_primary_owner)
8443 (QCdbus_request_name_reply_in_queue)
8444 (QCdbus_request_name_reply_exists)
8445 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8446 (QCdbus_registered_serial, QCdbus_registered_method)
8447 (QCdbus_registered_signal): New Lisp objects.
8448 (XD_DEBUG_MESSAGE): Use sizeof.
8449 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8450 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8451 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8452 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8453 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8454 (xd_signature, xd_append_arg): Allow float for integer types.
8455 (xd_get_connection_references): New function.
8456 (xd_get_connection_address): Rename from xd_initialize.
8457 Return cached address.
8458 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8459 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8460 level.
8461 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8462 Return number of refcounts.
8463 (Fdbus_get_unique_name): Make stronger parameter check.
8464 (Fdbus_message_internal): New defun.
8465 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8466 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8467 (Fdbus_send_signal, Fdbus_register_service)
8468 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8469 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8470 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8471 (Vdbus_compiled_version, Vdbus_runtime_version)
8472 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8473 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8474 (Vdbus_message_type_signal): New defvars.
8475 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8476 Adapt docstring.
8477
8478 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8479
8480 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8481 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8482 Do not assume ptrdiff_t is the same width as 'int'.
8483
8484 * alloc.c: Handle unusual debugging option combinations.
8485 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8486 since the two debugging options are incompatible.
8487 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8488 is defined.
8489 (mem_init, mem_insert, mem_insert_fixup):
8490 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8491 (NEED_MEM_INSERT): Remove; no longer needed.
8492
8493 2012-04-22 Leo Liu <sdl.web@gmail.com>
8494
8495 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8496
8497 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8498
8499 * sysdep.c [__FreeBSD__]: Minor cleanups.
8500 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8501 Use Emacs indenting style more consistently. Avoid some casts.
8502 Use 'double' consistently rather than mixing 'float' and 'double'.
8503
8504 2012-04-21 Eduard Wiebe <usenet@pusto.de>
8505
8506 * sysdep.c (list_system_processes, system_process_attributes):
8507 Add implementation for FreeBSD (Bug#5243).
8508
8509 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8510
8511 * lisp.mk (lisp): Update.
8512
8513 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8514
8515 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8516 It is never used otherwise.
8517
8518 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8519
8520 * print.c (print_preprocess): Only check print_depth if print-circle
8521 is nil.
8522 (print_object): Check for cycles even when print-circle is nil and
8523 print-gensym is t, but only check print_depth if print-circle is nil.
8524
8525 2012-04-20 Chong Yidong <cyd@gnu.org>
8526
8527 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8528 set the status to "failed" and ensure that sentinel is run.
8529
8530 2012-04-20 Glenn Morris <rgm@gnu.org>
8531
8532 * process.c (Fset_process_inherit_coding_system_flag)
8533 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8534 (Fmake_network_process, Fmake_serial_process): Doc fix.
8535
8536 2012-04-20 Eli Zaretskii <eliz@gnu.org>
8537
8538 * xdisp.c (string_buffer_position_lim): Limit starting position to
8539 BEGV.
8540 (set_cursor_from_row): If called for a mode-line or header-line
8541 row, return zero immediately.
8542 (try_cursor_movement): If inside continuation line, don't back up
8543 farther than the first row after the header line, if any.
8544 Don't consider the header-line row as "partially visible", even if
8545 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8546
8547 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8548
8549 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8550 (bug#11238).
8551
8552 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
8553 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
8554
8555 configure: new option --enable-gcc-warnings (Bug#11207)
8556 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8557 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8558 (ALL_CFLAGS): Use new macros rather than old.
8559 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8560 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8561 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8562 -Wunused-result, -Wunused-variable. This should go away once
8563 the Emacs and Gnulib regex code is merged.
8564 (xmalloc, xrealloc): Now static.
8565
8566 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8567
8568 * dired.c (Fsystem_groups): Remove unused local.
8569
8570 2012-04-17 Glenn Morris <rgm@gnu.org>
8571
8572 * dired.c (Fsystem_users): Doc fix.
8573
8574 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8575
8576 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8577 (syms_of_dired): Add them.
8578
8579 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8580
8581 Fix minor alloc.c problems found by static checking.
8582 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8583 New extern decls, to avoid calling undeclared functions.
8584 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8585 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8586 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8587 (NEED_MEM_INSERT): New macro.
8588 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8589 Remove one incorrect comment and fix another.
8590
8591 Fix minor ralloc.c problems found by static checking.
8592 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8593 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8594 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8595 (r_alloc_sbrk): Now static.
8596
8597 Improve ralloc.c interface checking.
8598 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8599 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8600 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8601 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8602 [REL_ALLOC]: ... to here, to check interface.
8603 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8604 Remove decls. This fixes an "It stinks!".
8605
8606 * alloc.c (which_symbols): Fix alignment issue / type clash.
8607
8608 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8609
8610 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8611 (struct Lisp_Misc_Any): Likewise.
8612 (struct Lisp_Free): Likewise.
8613 * alloc.c (union aligned_Lisp_Symbol): Define.
8614 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8615 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8616 (union aligned_Lisp_Misc): Define.
8617 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8618 aligned_Lisp_Misc instead of union Lisp_Misc.
8619 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8620
8621 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8622
8623 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8624 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8625 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8626 * s/netbsd.h, s/sol2-6.h:
8627 Remove definition of GC_MARK_STACK, since the default now works.
8628 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8629 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8630 no longer the default.
8631 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8632
8633 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8634
8635 * lread.c (lisp_file_lexically_bound_p):
8636 Fix hang at ";-*-\n" (bug#11238).
8637
8638 2012-04-14 Eli Zaretskii <eliz@gnu.org>
8639
8640 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8641 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8642
8643 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8644
8645 * nsterm.m (constrainFrameRect): Always constrain when there is only
8646 one screen (Bug#10962).
8647
8648 2012-04-13 Ken Brown <kbrown@cornell.edu>
8649
8650 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8651
8652 2012-04-13 Reuben Thomas <rrt@sc3d.org>
8653
8654 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8655
8656 2012-04-11 Daniel Colascione <dancol@dancol.org>
8657
8658 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8659 against is gone. It's better to use vfork now so that when Cygwin
8660 gains a new, working vfork, we use it automatically (bug#10398).
8661
8662 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8663
8664 * window.c (save_window_save): Obey window-point-insertion-type.
8665
8666 2012-04-11 Glenn Morris <rgm@gnu.org>
8667
8668 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8669
8670 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8671
8672 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8673
8674 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
8675
8676 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8677 (force_quit_count): New var.
8678 (handle_interrupt): Use it.
8679
8680 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
8681
8682 * w32.c (w32_delayed_load): Record the full path of the library
8683 being loaded (bug#10424).
8684
8685 2012-04-09 Glenn Morris <rgm@gnu.org>
8686
8687 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8688 not just in the obarray, before snarfing them. (Bug#11036)
8689
8690 * Makefile.in ($(leimdir)/leim-list.el):
8691 Pass EMACS rather than BUILT_EMACS.
8692
8693 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8694
8695 * process.c (make_process):
8696 * process.h: Add integer `gnutls_handshakes_tried' member to
8697 process struct.
8698
8699 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8700 Add convenience `GNUTLS_LOG2i' macro.
8701
8702 * gnutls.c (gnutls_log_function2i): Convenience log function.
8703 (emacs_gnutls_read): Use new log functions,
8704 `gnutls_handshakes_tried' process member, and
8705 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8706 attempts per process (connection).
8707
8708 2012-04-09 Chong Yidong <cyd@gnu.org>
8709
8710 * eval.c (Fuser_variable_p, user_variable_p_eh)
8711 (lisp_indirect_variable): Functions deleted.
8712 (Fdefvar): Caller changed.
8713
8714 * callint.c (Finteractive, Fcall_interactively):
8715 * minibuf.c (Fread_variable): Callers changed.
8716
8717 2012-04-09 Eli Zaretskii <eliz@gnu.org>
8718
8719 * xdisp.c (set_cursor_from_row): If the display string appears in
8720 the buffer at position that is closer to point than the position
8721 after the display string, display the cursor on the first glyph of
8722 the display string. Fixes cursor display when a 'display' text
8723 property immediately follows invisible text. (Bug#11094)
8724
8725 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8726
8727 composite.c: use 'double' consistently
8728 * composite.c (get_composition_id): Use 'double' consistently
8729 instead of converting 'float' to 'double' and vice versa; this is
8730 easier to understand and avoids a GCC warning.
8731
8732 2012-04-09 Glenn Morris <rgm@gnu.org>
8733
8734 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8735 preparation for dumping it with emacs. (Bug#4789)
8736 (leimdir): New variable.
8737 ($(leimdir)/leim-list.el): New rule.
8738 (emacs$(EXEEXT)): Depend on leim-list.el.
8739
8740 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8741 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8742 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8743
8744 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8745
8746 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8747 proper alignment.
8748
8749 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
8750
8751 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8752 Remove unused local variable.
8753
8754 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8755
8756 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8757 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8758 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8759 objects, as mark_maybe_pointer will catch them otherwise.
8760 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8761 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8762
8763 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8764
8765 Fix typo that broke non-Windows builds.
8766 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8767
8768 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8769
8770 Support building on MS-Windows with libxml2.
8771
8772 * makefile.w32-in (OBJ2): Add xml.$(O).
8773 (GLOBAL_SOURCES): Add xml.c.
8774 ($(BLD)/xml.$(O)): New dependency list.
8775
8776 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8777 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8778 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8779 [!WINDOWSNT]: New macros.
8780 (init_libxml2_functions, libxml2_loaded_p): New functions.
8781 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8782 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8783 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8784 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8785 linked in).
8786 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8787 Call init_libxml2_functions before calling libxml2 functions.
8788 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8789
8790 * emacs.c: Don't include libxml/parser.h.
8791 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8792 xmlCleanupParser directly.
8793
8794 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8795
8796 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8797
8798 * indent.c (Fvertical_motion): If there is a display string at
8799 point, use it.vpos to compute how many lines to backtrack after
8800 move_it_to point. (Bug#11133)
8801
8802 2012-04-06 Eli Zaretskii <eliz@gnu.org>
8803
8804 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8805 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8806 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8807 macros related to unification of CJK characters. For the details,
8808 see the discussion following the message here:
8809 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8810
8811 2012-04-04 Chong Yidong <cyd@gnu.org>
8812
8813 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8814
8815 2012-04-01 Eli Zaretskii <eliz@gnu.org>
8816
8817 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8818 instead of alloca. (Bug#11138)
8819
8820 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8821
8822 * w32menu.c (is_simple_dialog): Properly check lisp types.
8823 (Bug#11141)
8824
8825 2012-03-31 Eli Zaretskii <eliz@gnu.org>
8826
8827 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8828 position we get to after a call to move_it_to fails the
8829 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8830 only if we wind up in a string from display property. (Bug#11063)
8831
8832 * window.c (Fdelete_other_windows_internal): Invalidate the row
8833 and column information about mouse highlight, so that redisplay
8834 restores it after reallocating the glyph matrices. (Bug#7464)
8835
8836 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8837 string comes from a `display' text property, use the buffer
8838 position of that property as if we actually saw that position in
8839 the row's glyphs.
8840 (move_it_by_lines): Remove the assertion that
8841 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8842 violated when there's a before-string at the beginning of a line.
8843 (Bug#11063)
8844
8845 2012-03-30 Eli Zaretskii <eliz@gnu.org>
8846
8847 * xdisp.c (append_space_for_newline): If the default face was
8848 remapped, use the remapped face for the appended newline.
8849 (extend_face_to_end_of_line): Use the remapped default face for
8850 extending the face to the end of the line.
8851 (display_line): Call extend_face_to_end_of_line when the default
8852 face was remapped. (Bug#11068)
8853
8854 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8855
8856 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8857
8858 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8859
8860 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8861
8862 2012-03-27 Glenn Morris <rgm@gnu.org>
8863
8864 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8865 Doc fixes.
8866
8867 2012-03-26 Kenichi Handa <handa@m17n.org>
8868
8869 * dispextern.h (struct glyph): Fix previous change. Change the
8870 bit length of glyphless.ch to 25 (Bug#11082).
8871
8872 2012-03-26 Chong Yidong <cyd@gnu.org>
8873
8874 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8875 (command_loop_1): Use it; inhibit selection update for
8876 handle-select-window too (Bug#8996).
8877
8878 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8879
8880 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8881
8882 2012-03-25 Kenichi Handa <handa@m17n.org>
8883
8884 * dispextern.h (struct glyph): Change the bit length of
8885 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8886
8887 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8888
8889 * s/ms-w32.h (tzname): Include time.h before redirecting to
8890 _tzname. Fixes the MSVC build. (Bug#9960)
8891
8892 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8893
8894 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8895 characters.
8896
8897 * xterm.c (XTread_socket): Only modify handling_signal if
8898 !SYNC_INPUT. (Bug#11080)
8899
8900 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8901
8902 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8903 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8904 when fetching a multibyte character consumes more bytes than
8905 CHAR_BYTES returns, due to unification of CJK characters in
8906 string_char. (Bug#11073)
8907
8908 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8909
8910 * process.c (wait_reading_process_output): Handle pty disconnect
8911 by refraining from sending oneself a SIGCHLD (bug#10933).
8912
8913 2012-03-22 Chong Yidong <cyd@gnu.org>
8914
8915 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8916
8917 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8918 Mark string as coming from a prefix property.
8919 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8920 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8921
8922 2012-03-21 Chong Yidong <cyd@gnu.org>
8923
8924 * xfaces.c (Vface_remapping_alist): Doc fix.
8925
8926 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8927
8928 * w32proc.c (Fw32_set_console_codepage)
8929 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8930 Doc fixes.
8931
8932 2012-03-20 Chong Yidong <cyd@gnu.org>
8933
8934 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8935 to reflect default non-nil value of redisplay-dont-pause.
8936
8937 2012-03-19 Kenichi Handa <handa@m17n.org>
8938
8939 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8940 it fit in a valid range (Bug#11003).
8941
8942 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8943
8944 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8945 that is not from display property, accept the row as a "cursor
8946 row" if one of the string's character has a non-nil `cursor'
8947 property. Fixes cursor positioning when there are newlines in
8948 overlay strings, e.g. in icomplete.el. (Bug#11035)
8949
8950 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8951
8952 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8953
8954 2012-03-12 Chong Yidong <cyd@gnu.org>
8955
8956 * eval.c (inhibit_lisp_code): Rename from
8957 inhibit_window_configuration_change_hook; move from window.c.
8958
8959 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8960 * window.c (run_window_configuration_change_hook)
8961 (syms_of_window): Callers changed.
8962
8963 2012-03-11 Chong Yidong <cyd@gnu.org>
8964
8965 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8966
8967 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8968
8969 2012-03-10 Chong Yidong <cyd@gnu.org>
8970
8971 * frame.c (other_visible_frames): Don't assume the selected frame
8972 is visible (Bug#10955).
8973
8974 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8975
8976 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8977
8978 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8979
8980 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8981 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8982 zero (Bug#10954).
8983
8984 2012-03-03 Glenn Morris <rgm@gnu.org>
8985
8986 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8987
8988 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8989
8990 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8991 position past the first glyph_row that ends at ZV. (Bug#10902)
8992 (redisplay_window, next_element_from_string): Fix typos in
8993 comments.
8994 (redisplay_window): Pass to move_it_vertically the margin in
8995 pixels, not in screen lines.
8996
8997 2012-03-02 Glenn Morris <rgm@gnu.org>
8998
8999 * buffer.c (buffer-list-update-hook): Doc fix.
9000
9001 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9002
9003 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9004 push_it before setting up the iterator for the first overlay
9005 string, even if we have an empty string loaded.
9006 (next_overlay_string): If there's an empty string on the iterator
9007 stack, pop the stack. (Bug#10903)
9008
9009 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9010
9011 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9012 Suggested by Stefan Monnier in
9013 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9014 * alloc.c (widen_to_Lisp_Object): New static function.
9015 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9016 and widening them to Lisp_Objects. This would work even if
9017 USE_LSB_TAG is defined and wide integers are used, which might
9018 happen in a future version of Emacs.
9019
9020 2012-02-25 Chong Yidong <cyd@gnu.org>
9021
9022 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9023 Doc fix.
9024
9025 * xselect.c (Fx_selection_exists_p): Doc fix.
9026 (x_clipboard_manager_save_all): Print an informative message
9027 before saving to clipboard manager.
9028
9029 2012-02-24 Chong Yidong <cyd@gnu.org>
9030
9031 * keyboard.c (process_special_events): Handle all X selection
9032 requests in kbd_buffer, not just the next one (Bug#8869).
9033
9034 2012-02-23 Chong Yidong <cyd@gnu.org>
9035
9036 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9037 call when setting menu-bar-lines and tool-bar-lines parameters.
9038 (unwind_create_frame_1): New helper function.
9039
9040 * window.c (inhibit_window_configuration_change_hook): New var.
9041 (run_window_configuration_change_hook): Obey it.
9042 (syms_of_window): Initialize it.
9043
9044 2012-02-22 Chong Yidong <cyd@gnu.org>
9045
9046 * xterm.c (x_draw_image_relief): Add missing type check for
9047 Vtool_bar_button_margin (Bug#10743).
9048
9049 2012-02-21 Chong Yidong <cyd@gnu.org>
9050
9051 * fileio.c (Vfile_name_handler_alist): Doc fix.
9052
9053 * buffer.c (Fget_file_buffer): Protect against invalid file
9054 handler return value.
9055
9056 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9057
9058 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9059 when computing $valmask.
9060
9061 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9062 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9063 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9064 It's useless in that case, and it can cause problems on hosts
9065 that allocate halves of EMACS_INT values separately.
9066 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9067 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9068 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9069 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9070 it avoids undefined behavior on hosts where shifting right by more
9071 than the word width has undefined behavior.
9072
9073 2012-02-19 Chong Yidong <cyd@gnu.org>
9074
9075 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9076 (Funhandled_file_name_directory, Ffile_name_as_directory)
9077 (Fdirectory_file_name, Fexpand_file_name)
9078 (Fsubstitute_in_file_name): Protect against invalid file handler
9079 return values (Bug#10845).
9080
9081 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9082
9083 * .gdbinit (pitx): Fix incorrect references to fields of the
9084 iterator stack.
9085
9086 2012-02-17 Chong Yidong <cyd@gnu.org>
9087
9088 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9089
9090 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9091
9092 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9093 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9094
9095 2012-02-15 Chong Yidong <cyd@gnu.org>
9096
9097 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9098 marked as special. Also, starting docstrings with * is obsolete.
9099
9100 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9101
9102 * gnutls.c (emacs_gnutls_write): Fix last change.
9103
9104 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9105
9106 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9107 send_process.
9108
9109 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9110
9111 * keymap.c (Fsingle_key_description): Handle char ranges.
9112
9113 2012-02-12 Chong Yidong <cyd@gnu.org>
9114
9115 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9116 as that creates a dangerous corner case.
9117
9118 * window.c (Fdelete_window_internal): Invalidate the mouse
9119 highlight (Bug#9904).
9120
9121 2012-02-12 Glenn Morris <rgm@gnu.org>
9122
9123 * xselect.c (Fx_own_selection_internal)
9124 (Fx_get_selection_internal, Fx_disown_selection_internal)
9125 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9126 * nsselect.m (Fx_own_selection_internal)
9127 (Fx_disown_selection_internal, Fx_selection_exists_p)
9128 (Fx_selection_owner_p, Fx_get_selection_internal):
9129 Sync docs and argument specs with the xselect.c versions.
9130
9131 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9132
9133 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9134
9135 2012-02-11 Eli Zaretskii <eliz@gnu.org>
9136
9137 * w32select.c (Fx_selection_exists_p): Sync doc string and
9138 argument list with xselect.c. (Bug#10783)
9139
9140 * w16select.c (Fx_selection_exists_p): Sync doc string and
9141 argument list with xselect.c. (Bug#10783)
9142
9143 2012-02-10 Glenn Morris <rgm@gnu.org>
9144
9145 * fns.c (Fsecure_hash): Doc fix.
9146
9147 2012-02-09 Kenichi Handa <handa@m17n.org>
9148
9149 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9150
9151 2012-02-07 Chong Yidong <cyd@gnu.org>
9152
9153 * buffer.c (Fbuffer_local_variables)
9154 (buffer_lisp_local_variables): Handle unbound vars correctly;
9155 don't let Qunbound leak into Lisp.
9156
9157 2012-02-07 Glenn Morris <rgm@gnu.org>
9158
9159 * image.c (Fimagemagick_types): Doc fix.
9160
9161 * image.c (imagemagick-render-type): Change it from a lisp object
9162 to an integer. Move the doc here from the lisp manual.
9163 Treat all values not equal to 0 the same.
9164
9165 2012-02-06 Chong Yidong <cyd@gnu.org>
9166
9167 * doc.c (store_function_docstring): Avoid applying docstring of
9168 alias to base function (Bug#2603).
9169
9170 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9171
9172 * .gdbinit (pp1, pv1): Remove redundant defines.
9173 (pr): Use pp.
9174
9175 2012-02-04 Chong Yidong <cyd@gnu.org>
9176
9177 * nsterm.m: Declare a global (Bug#10694).
9178
9179 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9180
9181 * w32.c (get_emacs_configuration_options):
9182 Include --enable-checking, if specified, in the return value.
9183
9184 2012-02-04 Martin Rudalics <rudalics@gmx.at>
9185
9186 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9187 after rounding frame sizes. (Bug#9723)
9188
9189 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9190
9191 * keyboard.c (adjust_point_for_property): Don't position point
9192 before BEGV. (Bug#10696)
9193
9194 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9195
9196 Handle overflow when computing char display width (Bug#9496).
9197 * character.c (char_width): Return EMACS_INT, not int.
9198 (char_width, c_string_width): Check for overflow when
9199 computing the width; this is possible now that individual
9200 characters can have unbounded width. Problem introduced
9201 by merge from Emacs 23 on 2012-01-19.
9202
9203 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
9204
9205 * dbusbind.c (Fdbus_register_method): Mention the return value
9206 :ignore in the docstring.
9207
9208 2012-02-02 Glenn Morris <rgm@gnu.org>
9209
9210 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9211
9212 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9213 Unconditionally set to t. (Bug#10673)
9214 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9215 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9216 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9217
9218 2012-02-02 Kenichi Handa <handa@m17n.org>
9219
9220 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9221 0, do not call append_composite_glyph.
9222
9223 2012-02-02 Kenichi Handa <handa@m17n.org>
9224
9225 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9226 NULL (Bug#6988).
9227 (x_produce_glyphs): If the component of a composition is a null
9228 string, set it->pixel_width to 1 to avoid zero-width glyph.
9229
9230 2012-02-01 Eli Zaretskii <eliz@gnu.org>
9231
9232 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9233 first 2 arguments are identical. This makes inserting large
9234 output from a subprocess an order of magnitude faster on
9235 MS-Windows, where all sbrk'ed memory is always contiguous.
9236
9237 2012-01-31 Glenn Morris <rgm@gnu.org>
9238
9239 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9240 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9241 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9242
9243 2012-01-29 Glenn Morris <rgm@gnu.org>
9244
9245 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9246
9247 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9248
9249 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9250
9251 2012-01-28 Chong Yidong <cyd@gnu.org>
9252
9253 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9254
9255 2012-01-26 Chong Yidong <cyd@gnu.org>
9256
9257 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9258
9259 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9260 repeat counts (Bug#10507).
9261
9262 2012-01-26 Glenn Morris <rgm@gnu.org>
9263
9264 * lread.c (syms_of_lread): Doc fix.
9265
9266 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9267
9268 * coding.c (encode_designation_at_bol): Change return value to
9269 EMACS_INT.
9270
9271 2012-01-25 Chong Yidong <cyd@gnu.org>
9272
9273 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9274
9275 2012-01-21 Chong Yidong <cyd@gnu.org>
9276
9277 * floatfns.c (Fcopysign): Make the second argument non-optional,
9278 since nil is not allowed anyway.
9279
9280 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9281
9282 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9283 (send_process): Likewise.
9284
9285 2012-01-19 Martin Rudalics <rudalics@gmx.at>
9286
9287 * window.c (save_window_save, Fcurrent_window_configuration)
9288 (Vwindow_persistent_parameters): Do not use Qstate.
9289 Rewrite doc-strings.
9290
9291 2012-01-19 Kenichi Handa <handa@m17n.org>
9292
9293 * character.c (char_width): New function.
9294 (Fchar_width, c_string_width, lisp_string_width):
9295 Use char_width (Bug#9496).
9296
9297 2012-01-16 Martin Rudalics <rudalics@gmx.at>
9298
9299 * window.c (Vwindow_persistent_parameters): New variable.
9300 (Fset_window_configuration, save_window_save): Handle persistent
9301 window parameters.
9302
9303 2012-01-14 Eli Zaretskii <eliz@gnu.org>
9304
9305 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9306 thrashing the stack of the thread. (Bug#9087)
9307
9308 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9309
9310 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9311
9312 2012-01-11 Eli Zaretskii <eliz@gnu.org>
9313
9314 * xdisp.c (rows_from_pos_range): Handle the case where the
9315 highlight ends on a newline. (Bug#10464)
9316 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9317 he end column for display of highlight that ends on a newline
9318 before a R2L line.
9319
9320 2012-01-11 Glenn Morris <rgm@gnu.org>
9321
9322 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9323 from load-path also when installation-directory is nil. (Bug#10208)
9324
9325 2012-01-10 Glenn Morris <rgm@gnu.org>
9326
9327 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9328
9329 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9330 Update template values to be closer to their typical values these days.
9331
9332 2012-01-09 Eli Zaretskii <eliz@gnu.org>
9333
9334 * xdisp.c (rows_from_pos_range): Accept additional argument
9335 DISP_STRING, and accept any glyph in a row whose object is that
9336 string as eligible for mouse highlight. Fixes mouse highlight of
9337 display strings from overlays. (Bug#10464)
9338
9339 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
9340
9341 emacs: fix an auto-save permissions race condition (Bug#10400)
9342 * fileio.c (auto_saving_dir_umask): New static var.
9343 (Fmake_directory_internal): Use it.
9344 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9345 creating the directory. The old code temporarily assigns
9346 too-generous permissions to the directory.
9347 (do_auto_save_eh): Clear it.
9348 (Fdo_auto_save): Catch all errors, not just file errors, so
9349 that the var is always cleared.
9350
9351 2012-01-07 Eli Zaretskii <eliz@gnu.org>
9352
9353 * search.c (scan_buffer): Pass character positions to
9354 know_region_cache, not byte positions. (Bug#6540)
9355
9356 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
9357
9358 * w32.c (sys_rename): Report EXDEV when rename of a directory
9359 fails because the target is on another logical disk. (Bug#10284)
9360
9361 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9362
9363 * xterm.c (x_embed_request_focus): New function.
9364
9365 * xterm.h: Add prototype.
9366
9367 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9368
9369 2012-01-05 Glenn Morris <rgm@gnu.org>
9370
9371 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9372
9373 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9374
9375 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9376 Load gnutls_transport_set_lowat only if GnuTLS version is below
9377 2.11.1.
9378 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9379 GnuTLS versions below 2.11.1.
9380
9381 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9382
9383 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9384 to the doc string advising against its use for altering the way
9385 windows are scrolled.
9386
9387 2011-12-28 Kenichi Handa <handa@m17n.org>
9388
9389 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9390 coding-system ASCII compatible only when it does not produce BOM
9391 on encoding (Bug#10383).
9392
9393 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9394
9395 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9396 can scroll.
9397 (create_and_show_popup_menu): Always use menu_position_func for
9398 Gtk3 (Bug#10361).
9399
9400 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9401
9402 * callint.c (Fcall_interactively): Don't truncate prompt string.
9403
9404 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9405
9406 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9407 property that ends at ZV, so that the bidi iteration could be
9408 resumed from there (after widening). (Bug#10360)
9409
9410 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9411
9412 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9413
9414 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9415
9416 * nsterm.m (x_free_frame_resources):
9417 Release f->output_data.ns->miniimage.
9418 (ns_index_color): Fix indentation. Do not retain
9419 color_table->colors[i].
9420
9421 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9422 before returning.
9423
9424 * nsfns.m (x_set_background_color): Assign return value from
9425 ns_index_color to face-background instead of NSColor*.
9426 (ns_implicitly_set_icon_type): Fix indentation.
9427 Change assignment in for loop to comparison.
9428
9429 * emacs.c (ns_pool): New variable.
9430 (main): Assign ns_pool.
9431 (Fkill_emacs): Call ns_release_autorelease_pool.
9432
9433 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9434 autorelease fdesc, release fdAttrs and tdict.
9435 (ns_get_covering_families): Release charset.
9436 (ns_findfonts): Release NSFontDescriptor created with new.
9437 (ns_uni_to_glyphs): Fix indentation.
9438 (setString): Release attrStr before assigning new value.
9439
9440 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9441
9442 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9443 and NS_IMPL_COCOA.
9444 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9445 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9446
9447 2011-12-18 David Reitter <reitter@cmu.edu>
9448
9449 * nsterm.m (ns_term_init): Subscribe for notifications
9450 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9451 to method trackingNotification in EmacsMenu.
9452
9453 * nsmenu.m (trackingMenu): New variable.
9454 (trackingNotification): New method (from Aquamacs).
9455 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9456 from Aquamacs (Bug#7030).
9457
9458 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9459
9460 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9461 (symbol_to_nsstring): Fix indentation.
9462 (ns_symbol_to_pb): New function.
9463 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9464 (Fns_rotate_cut_buffers_internal): Remove.
9465 (Fns_store_selection_internal): Rename from
9466 Fns_store_cut_buffer_internal.
9467 (ns_get_foreign_selection, Fx_own_selection_internal)
9468 (Fx_disown_selection_internal, Fx_selection_exists_p)
9469 (Fns_get_selection_internal, Fns_store_selection_internal):
9470 Use ns_symbol_to_pb and check if return value is nil.
9471 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9472 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9473 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9474 renamed to Sns_store_selection_internal.
9475 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9476 and remove this function.
9477 (ns_handle_selection_clear): Remove, never used.
9478 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9479 here.
9480
9481 2011-12-17 Ken Brown <kbrown@cornell.edu>
9482
9483 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9484 GID is unknown (Bug#10257).
9485
9486 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9487
9488 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9489 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9490 which caused a build failure on GNU/Linux IA-64. This problem was
9491 introduced by my 2011-10-07 patch.
9492
9493 2011-12-15 Juri Linkov <juri@jurta.org>
9494
9495 * image.c (imagemagick_error): New function. (Bug#10112)
9496 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9497 Use `imagemagick_error' where ImageMagick functions return
9498 `MagickFalse'.
9499 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9500 proper order.
9501
9502 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9503
9504 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9505 fill background (Bug#8992).
9506
9507 2011-12-13 Martin Rudalics <rudalics@gmx.at>
9508
9509 * window.c (Vwindow_combination_resize)
9510 (Vwindow_combination_limit): Use t instead of non-nil in
9511 doc-strings.
9512 (Vrecenter_redisplay): Add first sentence of doc-string on
9513 separate line.
9514 (Frecenter): Fix doc-string typo.
9515
9516 2011-12-11 Kenichi Handa <handa@m17n.org>
9517
9518 * coding.c (Funencodable_char_position): Pay attention to the
9519 buffer text relocation (Bug#9389).
9520
9521 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9522
9523 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9524 gtk_init (Bug#10100).
9525
9526 2011-12-10 Eli Zaretskii <eliz@gnu.org>
9527
9528 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9529 IT->string is nil. (Bug#10263)
9530
9531 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9532
9533 * nsterm.h (x_free_frame_resources): Declare.
9534
9535 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9536 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9537
9538 * nsterm.h (ns_get_defaults_value): Declare.
9539
9540 * nsterm.m (ns_default): Call ns_get_defaults_value.
9541
9542 2011-12-09 Eli Zaretskii <eliz@gnu.org>
9543
9544 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9545 (Bug#10170)
9546
9547 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9548
9549 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9550 that where the value of an _OBJC_* symbol points to is in the .bss
9551 section (Bug#10240).
9552
9553 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9554
9555 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9556 after the loop to call ccl_driver at least once (Bug#8619).
9557
9558 2011-12-08 Kenichi Handa <handa@m17n.org>
9559
9560 * ftfont.c (get_adstyle_property): Fix previous change
9561 (Bug#10233).
9562
9563 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
9564
9565 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9566 dirs from the default value of EMACSLOADPATH (bug#10208).
9567
9568 2011-12-07 Glenn Morris <rgm@gnu.org>
9569
9570 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9571 installation and source directories as well. (Bug#10208)
9572
9573 2011-12-06 Chong Yidong <cyd@gnu.org>
9574
9575 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9576
9577 2011-12-06 Glenn Morris <rgm@gnu.org>
9578
9579 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9580 as an error, not just -1. (Bug#10217)
9581
9582 2011-12-05 Chong Yidong <cyd@gnu.org>
9583
9584 * keyboard.c (process_special_events): New function.
9585 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9586
9587 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9588
9589 * coding.c (encode_designation_at_bol): Don't use uninitialized
9590 local variable (Bug#9318).
9591
9592 2011-12-05 Kenichi Handa <handa@m17n.org>
9593
9594 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9595 return Qnil (Bug#8046, Bug#10193).
9596
9597 2011-12-05 Kenichi Handa <handa@m17n.org>
9598
9599 * coding.c (encode_designation_at_bol): New args charbuf_end and
9600 dst. Return the number of produced bytes. Callers changed.
9601 (coding_set_source): Return how many bytes coding->source was
9602 relocated.
9603 (coding_set_destination): Return how many bytes
9604 coding->destination was relocated.
9605 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9606 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9607
9608 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9609
9610 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9611 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9612 macro (Bug#9318).
9613
9614 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9615
9616 The following changes are to fix Bug#9318.
9617
9618 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9619 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9620 (encode_coding_iso_2022, encode_coding_sjis)
9621 (encode_coding_big5, encode_coding_charset): Use the above macros.
9622
9623 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
9624
9625 * lisp.h (process_quit_flag): Fix external declaration.
9626
9627 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9628
9629 Don't macro-inline non-performance-critical code.
9630 * eval.c (process_quit_flag): New function.
9631 * lisp.h (QUIT): Use it.
9632
9633 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9634
9635 * nsfns.m (get_geometry_from_preferences): New function.
9636 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9637
9638 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9639
9640 * emacs.c (Qkill_emacs): Define.
9641 (syms_of_emacs): Initialize it.
9642 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9643 Qquit_flag to `kill-emacs' instead.
9644 (quit_throw_to_read_char): Add parameter `from_signal'.
9645 All callers changed. Call Fkill_emacs if requested and safe.
9646 * lisp.h (QUIT): Call Fkill_emacs if requested.
9647
9648 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9649
9650 * widget.c (update_wm_hints): Return if wmshell is null.
9651 (widget_update_wm_size_hints): New function.
9652
9653 * widget.h (widget_update_wm_size_hints): Declare.
9654
9655 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9656 widget_update_wm_size_hints (Bug#10104).
9657
9658 2011-12-03 Eli Zaretskii <eliz@gnu.org>
9659
9660 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9661 before a newline, prepare the bidi iterator for consuming the
9662 newline, and keep the current paragraph direction. (Bug#10183)
9663 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9664
9665 2011-12-02 Juri Linkov <juri@jurta.org>
9666
9667 * search.c (Fword_search_regexp): New Lisp function created from
9668 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9669 (Fword_search_backward, Fword_search_forward)
9670 (Fword_search_backward_lax, Fword_search_forward_lax):
9671 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9672 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9673
9674 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9675
9676 * fileio.c (Finsert_file_contents): Move after-change-function call
9677 to before the "handled:" label, since all "goto handled" appear in
9678 cases where the *-change-functions have already been properly called
9679 (bug#10117).
9680
9681 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9682
9683 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9684 waiting for input. (Bug#10169)
9685
9686 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9687
9688 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9689 verifies glyph row's hash code--we have just reallocated the
9690 glyphs, so their contents can be complete garbage. (Bug#10164)
9691
9692 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
9693
9694 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9695
9696 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9697
9698 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9699 attributes are tested _before_ calling verify_row_hash, to protect
9700 against GCC re-ordering of the tests. (Bug#10164)
9701
9702 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9703
9704 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9705
9706 * xterm.c (handle_one_xevent): Only set async_visible and friends
9707 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9708 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9709 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9710
9711 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9712
9713 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9714 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9715 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9716 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9717 All uses changed to use GCPRO1 etc.
9718 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9719 Revert to old implementation (i.e., before 2011-03-11).
9720
9721 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9722
9723 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9724 of scroll runs so as to avoid assigning disabled bogus rows and
9725 unnecessary graphics copy operations.
9726
9727 2011-11-27 Eli Zaretskii <eliz@gnu.org>
9728
9729 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9730 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9731 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9732 (malloc, free, realloc, calloc): Redirect to e_* only when
9733 compiling Emacs.
9734
9735 * lisp.h (GCTYPEBITS): Move before first use.
9736 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9737 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9738 this macro definition.
9739
9740 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9741 _MSC_VER.
9742
9743 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9744
9745 * gtkutil.c (xg_create_frame_widgets):
9746 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9747 present with Gtk+ 2.0.
9748
9749 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9750
9751 * fileio.c (Finsert_file_contents): Undo previous change; see
9752 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9753
9754 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9755
9756 Rename locals to avoid shadowing.
9757 * fileio.c (Finsert_file_contents):
9758 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9759 * process.c (wait_reading_process_output):
9760 Rename inner 'proc' to 'p' to avoid shadowing.
9761 Indent for consistency with usual Emacs style.
9762
9763 2011-11-25 Eli Zaretskii <eliz@gnu.org>
9764
9765 * xdisp.c (redisplay_window): If cursor row is not fully visible
9766 after recentering, and scroll-conservatively is set to a large
9767 number, scroll window by a few more lines to make the cursor fully
9768 visible and out of scroll-margin. (Bug#10105)
9769 (start_display): Don't move to the next line if the display should
9770 start at a newline that is part of a display vector or an overlay
9771 string. (Bug#10119)
9772
9773 2011-11-24 Juri Linkov <juri@jurta.org>
9774
9775 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9776 after the `MagickPingImage' call. (Bug#10112)
9777
9778 2011-11-23 Chong Yidong <cyd@gnu.org>
9779
9780 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9781
9782 2011-11-23 Martin Rudalics <rudalics@gmx.at>
9783
9784 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9785 making another buffer current. (Bug#10114)
9786
9787 2011-11-23 Glenn Morris <rgm@gnu.org>
9788
9789 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9790
9791 2011-11-23 Chong Yidong <cyd@gnu.org>
9792
9793 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9794 using it (Bug#5984).
9795
9796 2011-11-22 Eli Zaretskii <eliz@gnu.org>
9797
9798 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9799 and header-lines, as they don't have one computed for them.
9800 (Bug#10098)
9801
9802 * .gdbinit (prow): Make displayed values more self-explaining.
9803 Add row's hash code.
9804
9805 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9806
9807 * process.c (wait_reading_process_output): Fix asynchrounous
9808 GnuTLS socket handling on some versions of the GnuTLS library.
9809 (wait_reading_process_output): Add comment and URL.
9810
9811 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9812
9813 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9814
9815 2011-11-21 Chong Yidong <cyd@gnu.org>
9816
9817 * window.c (Fnext_window, Fprevious_window): Doc fix.
9818
9819 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9820
9821 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9822
9823 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9824
9825 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9826
9827 2011-11-20 Martin Rudalics <rudalics@gmx.at>
9828
9829 * window.c (Fset_window_combination_limit): Rename argument
9830 STATUS to LIMIT.
9831 (Vwindow_combination_limit): Remove "status" from doc-string.
9832
9833 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9834
9835 * m/ibms390.h: Remove.
9836 * m/ibms390x.h: Don't include "ibms390.h".
9837
9838 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9839
9840 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9841 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9842
9843 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9844
9845 * casetab.c (Fset_case_table):
9846 * charset.c (Fcharset_after): Fix typos.
9847
9848 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9849
9850 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9851 Otherwise, valgrind does not work on some platforms.
9852 Problem reported by Andreas Schwab in
9853 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9854 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9855 is set, removing the need for VIRT_ADDRESS_VARIES.
9856 (PURE_P): Use a more-efficient implementation that needs just one
9857 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9858 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9859 to 4 (xorl, subq, cmpq, setbe).
9860 * alloc.c (pure): Always extern now, since that's the
9861 VIRT_ADDR_VARIES behavior.
9862 (PURE_POINTER_P): Use a single comparison, not two, for
9863 consistency with the new puresize.h.
9864 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9865 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9866 Remove VIRT_ADDR_VARIES no longer needed.
9867
9868 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9869
9870 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9871 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9872 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9873 behave as if the cursor position were at the window margin.
9874
9875 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9876 and the cursor position is out of bounds, behave as if the cursor
9877 position were at the window margin. (Bug#10075)
9878
9879 2011-11-18 Chong Yidong <cyd@gnu.org>
9880
9881 * window.c (Fwindow_combination_limit): Make first argument
9882 non-optional, since it is meaningless for live windows like the
9883 selected window.
9884
9885 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9886
9887 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9888
9889 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9890
9891 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9892 (graft_intervals_into_buffer): Simplify.
9893
9894 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9895
9896 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9897 hash values of the two rows.
9898 (copy_row_except_pointers): Preserve the used[] arrays and the
9899 hash values of the two rows. (Bug#10035)
9900 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9901
9902 * xdisp.c (row_hash): New function, body extracted from
9903 compute_line_metrics.
9904 (compute_line_metrics): Call row_hash, instead of computing the
9905 hash code inline.
9906
9907 * dispnew.c (verify_row_hash): Call row_hash for computing the
9908 hash code of a row, instead of duplicating code from xdisp.c.
9909
9910 * dispextern.h (row_hash): Add prototype.
9911
9912 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9913
9914 * frame.c (delete_frame): Don't delete the terminal when the last
9915 X frame is closed if emacs is built with GTK toolkit.
9916
9917 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9918
9919 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9920
9921 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9922
9923 * window.c (Vwindow_splits): Rename to
9924 Vwindow_combination_resize. Suggested by Juri Linkov.
9925 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9926 of Vwindow_splits.
9927
9928 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9929
9930 * nsfns.m (Fns_font_name):
9931 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9932
9933 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9934
9935 * window.h (window): Rename slot "nest" to "combination_limit".
9936 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9937 (Fset_window_nest): Rename to Fset_window_combination_limit.
9938 (Vwindow_nest): Rename to Vwindow_combination_limit.
9939 (recombine_windows, make_parent_window, make_window)
9940 (Fsplit_window_internal, saved_window)
9941 (Fset_window_configuration, save_window_save): Rename all
9942 occurrences of window_nest to window_combination_limit.
9943
9944 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9945
9946 * image.c (imagemagick_load_image): Fix typo.
9947
9948 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9949
9950 * xdisp.c (display_line): Move the call to
9951 highlight_trailing_whitespace before the call to
9952 compute_line_metrics, since the latter needs to see the final
9953 faces of all the glyphs to compute ROW's hash value.
9954 Fixes assertion violations in row_equal_p. (Bug#10035)
9955
9956 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9957
9958 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9959 just return (bug#10044).
9960
9961 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9962
9963 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9964 with user-defined heap size. Bump the default size of the temacs
9965 heap to 27MB, to avoid memory warning when running temacs.
9966 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9967
9968 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9969 current_matrix and desired_matrix. (Bug#9990)
9970 (verify_row_hash) [XASSERTS]: New function.
9971 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9972 that the hash value of glyph rows is correct.
9973
9974 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9975
9976 * window.h (window): Remove splits slot.
9977 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9978 (Fdelete_other_windows_internal, make_parent_window)
9979 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9980 (Fset_window_configuration, save_window_save): Don't deal with
9981 split status of windows.
9982 (saved_window): Remove splits slot.
9983 (Vwindow_splits): Rewrite doc-string.
9984
9985 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9986
9987 * xfns.c (unwind_create_frame):
9988 * nsfns.m (unwind_create_frame):
9989 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9990 Vframe_list (Bug#9999).
9991
9992 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9993
9994 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9995
9996 2011-11-11 Kenichi Handa <handa@m17n.org>
9997
9998 * callproc.c (Fcall_process): Set the member dst_multibyte of
9999 process_coding.
10000
10001 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10002
10003 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10004 avoid a crash (bug#9496).
10005
10006 2011-11-09 Chong Yidong <cyd@gnu.org>
10007
10008 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10009 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10010
10011 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10012
10013 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10014
10015 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10016
10017 Avoid some portability problems by eschewing 'extern inline' functions.
10018 The trivial performance wins aren't worth the portability hassles; see
10019 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10020 et seq.
10021 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10022 (window_box_width, window_box_left, window_box_left_offset)
10023 (window_box_right, window_box_right_offset): Undo previous change,
10024 by removing the "extern"s.
10025 * intervals.c (adjust_intervals_for_insertion)
10026 (adjust_intervals_for_deletion): Undo previous change,
10027 making these static again.
10028 (offset_intervals, temp_set_point_both, temp_set_point)
10029 (copy_intervals_to_string): No longer inline.
10030 * xdisp.c (window_text_bottom_y, window_box_width)
10031 (window_box_height, window_box_left_offset)
10032 (window_box_right_offset, window_box_left, window_box_right)
10033 (window_box): No longer inline.
10034
10035 2011-11-08 Chong Yidong <cyd@gnu.org>
10036
10037 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10038 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10039 Signal an error if not a live window.
10040 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10041 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10042
10043 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
10044
10045 * lisp.h (syms_of_abbrev): Remove declaration.
10046 Reported by CHENG Gao <chenggao@royau.me>.
10047
10048 2011-11-07 Eli Zaretskii <eliz@gnu.org>
10049
10050 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10051 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10052 of temacs in GUI mode.
10053
10054 2011-11-07 Martin Rudalics <rudalics@gmx.at>
10055
10056 * window.h: Declare delete_all_child_windows instead of
10057 delete_all_subwindows.
10058 * window.c (Fwindow_nest, Fset_window_nest)
10059 (Fset_window_new_total, Fset_window_new_normal)
10060 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10061 (delete_all_subwindows): Rename to delete_all_child_windows.
10062 (Fdelete_other_windows_internal, Fset_window_configuration):
10063 Call delete_all_child_windows instead of delete_all_subwindows.
10064 * frame.c (delete_frame): Call delete_all_child_windows instead
10065 of delete_all_subwindows.
10066
10067 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10068
10069 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10070 This is also needed for porting to any host where GC_MARK_STACK is
10071 not GC_MAKE_GCPROS_NOOPS.
10072 (which_symbols): Use it.
10073
10074 2011-11-07 Kenichi Handa <handa@m17n.org>
10075
10076 * coding.c (coding_set_destination): Check coding->src_pos only
10077 when coding->src_object is a buffer (bug#9910).
10078
10079 * process.c (send_process): Set the member src_multibyte of coding
10080 to 0 (bug#9911) when sending a unibyte text.
10081
10082 * callproc.c (Fcall_process): Set the member src_multibyte of
10083 process_coding to 0 (bug#9912).
10084
10085 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10086
10087 * xmenu.c (cleanup_widget_value_tree): New function.
10088 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10089 calling free_menubar_widget_value_tree directly (Bug#9830).
10090
10091 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10092
10093 Fix some portability problems with 'inline'.
10094 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10095 (window_box_width, window_box_left, window_box_left_offset)
10096 (window_box_right, window_box_right_offset): Declare extern.
10097 Otherwise, these inline functions do not conform to C99 and
10098 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10099 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10100 * intervals.c (adjust_intervals_for_insertion)
10101 (adjust_intervals_for_deletion): Now extern, because otherwise the
10102 extern inline functions 'offset_intervals' couldn't refer to it.
10103 (static_offset_intervals): Remove.
10104 (offset_intervals): Rewrite using the old contents of
10105 static_offset_intervals. The old version didn't conform to C99
10106 because an extern inline function contained a reference to an
10107 identifier with static linkage.
10108
10109 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10110
10111 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10112 GC.
10113
10114 2011-11-06 Eli Zaretskii <eliz@gnu.org>
10115
10116 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10117 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10118 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10119 return Qleft_to_right.
10120
10121 2011-11-06 Chong Yidong <cyd@gnu.org>
10122
10123 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10124 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10125 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10126 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10127 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10128 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10129 (Fwindow_vscroll): Doc fix.
10130 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10131 argument, since it makes no sense to pass a live window and for
10132 consistency with window-child.
10133
10134 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10135
10136 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10137 support MSVC.
10138
10139 2011-11-05 Jason Rumney <jasonr@gnu.org>
10140
10141 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10142 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10143 fonts (Bug#6029).
10144 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10145 bitwise arithmetic preventing use of unicode-sip and non-truetype
10146 opentype fonts.
10147
10148 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10149
10150 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10151 "emacs"-only part.
10152
10153 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10154 initialization code to keep similarity to xfns.c after changes
10155 from 2011-11-05.
10156
10157 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10158
10159 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10160 (unwind_create_frame): New function (Bug#9943).
10161 (Fx_create_frame): Restructure code to be more similar to the one in
10162 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10163 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10164 Move terminal->reference_count++ just before making the frame official
10165 (Bug#9943).
10166
10167 * nsterm.m (x_free_frame_resources): New function.
10168 (x_destroy_window): Move code to x_free_frame_resources.
10169
10170 * xfns.c (unwind_create_frame): Fix comment.
10171 (Fx_create_frame, x_create_tip_frame):
10172 Move terminal->reference_count++ just before making the frame
10173 official. Move initialization of image_cache_refcount and
10174 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10175
10176 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10177
10178 Support MSVC build with newer versions of Visual Studio.
10179 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10180 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10181 nt/gmake.defs.
10182
10183 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10184 which are not supported by MSVC.
10185 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10186 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10187 bitfields.
10188 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10189 types in bitfields.
10190 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10191
10192 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10193
10194 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
10195
10196 Support MSVC build with newer versions of Visual Studio.
10197 * w32.c: Don't include w32api.h for MSVC.
10198 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10199
10200 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10201 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10202 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10203 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10204 e_* cousins.
10205 (alloca) [_MSC_VER]: Define to _alloca.
10206
10207 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10208
10209 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10210
10211 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10212
10213 * xdisp.c (note_mouse_highlight): If either of
10214 previous/next-single-property-change returns nil, treat that as
10215 the beginning or the end of the buffer. (Bug#9955)
10216
10217 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10218
10219 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10220 label is not null (Bug#9951).
10221 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10222 may be NULL.
10223
10224 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10225
10226 * window.c (Fwindow_body_size): Mention in the doc string that the
10227 return value is in frame's canonical units. (Bug#9949)
10228
10229 2011-11-03 Eli Zaretskii <eliz@gnu.org>
10230
10231 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10232
10233 * w32fns.c (unwind_create_frame): If needed, free the glyph
10234 matrices of the partially constructed frame. (Bug#9943)
10235 * xfns.c (unwind_create_frame): Likewise.
10236
10237 2011-11-01 Eli Zaretskii <eliz@gnu.org>
10238
10239 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10240 Don't stop backward scan on the continuation glyph, even though
10241 its CHARPOS is positive.
10242 (mouse_face_from_buffer_pos, note_mouse_highlight):
10243 Rename cover_string to disp_string.
10244
10245 2011-11-01 Martin Rudalics <rudalics@gmx.at>
10246
10247 * window.c (temp_output_buffer_show): Don't use
10248 Vtemp_buffer_show_specifiers.
10249 (Vtemp_buffer_show_specifiers): Remove unused variable.
10250
10251 2011-10-30 Eli Zaretskii <eliz@gnu.org>
10252
10253 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10254 past the beginning of the current glyph matrix.
10255
10256 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
10257
10258 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10259 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10260 HAVE_GTK3 (Bug#9869).
10261
10262 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10263 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10264
10265 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10266
10267 * xterm.c: Declare x_handle_net_wm_state to return int.
10268 (handle_one_xevent): Check if we are iconified but don't have
10269 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10270 (get_current_wm_state): Return non-zero if not hidden,
10271 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10272 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10273 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10274 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10275
10276 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10277
10278 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10279 so that this new function doesn't get optimized away by a
10280 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10281
10282 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10283
10284 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10285
10286 2011-10-29 Eli Zaretskii <eliz@gnu.org>
10287
10288 Fix the `xbytecode' command.
10289 * .gdbinit (xprintbytestr): New command.
10290 (xwhichsymbols): Rename from `which'; all callers changed.
10291 (xbytecode): Print the byte-code string as well.
10292
10293 2011-10-29 Kim Storm <storm@cua.dk>
10294
10295 * alloc.c (which_symbols): New function.
10296
10297 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10298
10299 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10300 line. (Bug#9903)
10301
10302 2011-10-29 Glenn Morris <rgm@gnu.org>
10303
10304 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10305 Not clear what it was for, and it causes various bugs. (Bug#9839)
10306
10307 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10308
10309 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10310 possible random value that matches one of those tested as
10311 condition to clear the mouse face.
10312
10313 2011-10-28 Chong Yidong <cyd@gnu.org>
10314
10315 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10316
10317 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10318
10319 * window.c (make_window): Initialize phys_cursor_on_p.
10320
10321 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10322
10323 * lisp.h (struct Lisp_Symbol): Update comments.
10324
10325 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
10326
10327 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10328
10329 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10330
10331 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10332 <oslsachem@gmail.com> for helping to debug this.
10333
10334 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10335 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10336 (g_b_init_get_glyph_outline_w): New static variables.
10337 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10338 (GetGlyphOutlineW_Proc): New typedefs.
10339 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10340 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10341 New functions.
10342 (w32font_open_internal, compute_metrics):
10343 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10344 instead of calling the "wide" APIs directly.
10345
10346 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10347
10348 * w32.h (syms_of_w32font): Add prototype.
10349
10350 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10351
10352 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10353 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10354 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10355 (Fmove_to_window_line): Doc fix.
10356
10357 2011-10-27 Chong Yidong <cyd@gnu.org>
10358
10359 * process.c (make_process): Set gnutls_state to NULL.
10360
10361 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10362 non-NULL, regardless of GNUTLS_INITSTAGE.
10363 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10364 an error. Set process slots as soon as we allocate them.
10365
10366 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10367
10368 2011-10-27 Chong Yidong <cyd@gnu.org>
10369
10370 * gnutls.c (emacs_gnutls_deinit): New function.
10371 Deallocate credentials structures as well as calling gnutls_deinit.
10372 (Fgnutls_deinit, Fgnutls_boot): Use it.
10373
10374 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10375 (deactivate_process): Call emacs_gnutls_deinit.
10376
10377 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10378
10379 * image.c (x_create_x_image_and_pixmap):
10380 * w32.c (sys_rename, w32_delayed_load):
10381 * w32font.c (fill_in_logfont):
10382 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10383
10384 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10385
10386 * w32fns.c (w32_default_color_map): New function,
10387 extracted from Fw32_default_color_map.
10388 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10389
10390 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10391
10392 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10393
10394 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10395
10396 * keyboard.c (test_undefined): New function (bug#9751).
10397 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10398
10399 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10400
10401 * sysdep.c (init_sys_modes): Fix the check for the controlling
10402 terminal (Bug#6649).
10403
10404 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10405
10406 * dispextern.h (struct bidi_it): New member next_en_type.
10407
10408 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10409 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10410 current character, check also for next_en_type being WEAK_EN.
10411 (bidi_resolve_weak): Don't enter the expensive loop if the current
10412 position is before next_en_pos. Record the bidi type of the first
10413 non-ET, non-BN character we find, in addition to its position.
10414 (bidi_level_of_next_char): Invalidate next_en_type when
10415 next_en_pos is over-stepped.
10416
10417 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10418
10419 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10420 * editfns.c: Rewrite current-time-zone so that it invokes
10421 the equivalent of (format-time-string "%Z") to get the time zone name.
10422 This fixes a bug when the time zone name contains characters that
10423 need converting from the system time locale to Emacs internal format.
10424 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10425 that patch fixed format-time-string to do the conversion, but
10426 I forgot to fix current-time-zone.
10427 (format_time_string): New function, containing most of
10428 what Fformat_time_string used to contain.
10429 (Fformat_time_string): Rewrite in terms of format_time_string.
10430 This doesn't change this function's behavior.
10431 (current-time-zone): Rewrite to use format_time_string.
10432 This fixes the bug reported by Michael Schierl in
10433 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10434 Jason Rumney's 2007-06-07 change worked around this bug, but
10435 didn't fix it.
10436 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10437
10438 2011-10-19 Eli Zaretskii <eliz@gnu.org>
10439
10440 * xdisp.c (start_display): If the character at POS is displayed
10441 via a display vector, reset IT->current.dpvec_index to zero.
10442 (try_window_reusing_current_matrix): If a line ends in a display
10443 vector or the next line starts in a display vector, continue
10444 redrawing the window even though the character position of
10445 start_row was reached.
10446 (Bug#9771, part 2)
10447
10448 2011-10-18 Chong Yidong <cyd@gnu.org>
10449
10450 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10451 with nobreak-char-display too.
10452
10453 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10454
10455 Fix part 3 of bug#9771.
10456 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10457 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10458 non-neutral characters if the current character is a paragraph
10459 separator (a.k.a. Newline). This avoids running the same
10460 expensive loop twice, once when we consume the preceding newline
10461 and the other time when the line actually needs to be displayed.
10462 Avoid the loop when we see neutrals on the base embedding level
10463 following a character whose directionality is the same as the
10464 paragraph's. This avoids running the expensive loop when a line
10465 ends in a long sequence of neutrals, like control characters.
10466 Add assertion against STRONG_AL type. Slightly rearrange code
10467 that determines the type of a neutral given the first non-neutral
10468 that follows it.
10469 (bidi_level_of_next_char): Set next_en_pos to zero when
10470 invalidating its info.
10471
10472 2011-10-17 Eli Zaretskii <eliz@gnu.org>
10473
10474 * xdisp.c (push_display_prop): Determine whether to record string
10475 or buffer position by IT->string, not by IT->method. Allow
10476 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10477 (move_it_vertically_backward): Don't look for character position
10478 immediately after the newline when in a continuation line.
10479 (Bug#9771, part 1)
10480
10481 2011-10-15 Martin Rudalics <rudalics@gmx.at>
10482
10483 * window.c (coordinates_in_window): Rewrite and delabelize
10484 vertical border check. (Bug#5357) (Bug#9618)
10485
10486 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10487
10488 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10489 errors in XSetWindowBorder (bug#9310).
10490
10491 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10492
10493 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10494 avoid crash when xmalloc overrun checking is enabled.
10495
10496 2011-10-13 Eli Zaretskii <eliz@gnu.org>
10497
10498 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10499 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10500 cursor motion with <left> and <right> arrow keys.
10501
10502 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10503 some callers set that themselves.
10504
10505 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10506
10507 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10508 display string and the previous row comes from the same string and
10509 is empty. (Bug#9739) (Bug#9738)
10510
10511 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10512
10513 * doc.c (get_doc_string): Encode file name (bug#9735).
10514
10515 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10516
10517 * bidi.c (bidi_level_of_next_char):
10518 * xdisp.c (get_visually_first_element): Remove old incorrect
10519 comments regarding the Unicode Line Separator character.
10520
10521 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10522
10523 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10524
10525 * alloc.c (Fgc_status): Do not access beyond zombies array
10526 boundary if nzombies > MAX_ZOMBIES.
10527 * alloc.c (dump_zombies): Add missing format specifier.
10528
10529 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10530
10531 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10532 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10533
10534 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10535 Some packages use them to denote characters with modifiers.
10536
10537 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10538
10539 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10540 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10541 matching a pp-number. Rename parameter var to var1.
10542
10543 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10544
10545 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10546
10547 2011-10-08 Glenn Morris <rgm@gnu.org>
10548
10549 * callint.c (Fcall_interactively): Give a more explicit error for the
10550 'c' case with a non-character input. (Bug#8479)
10551
10552 2011-10-08 Eli Zaretskii <eliz@gnu.org>
10553
10554 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10555 lines.
10556 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10557 lines that are hscrolled on the left.
10558
10559 * dispnew.c (buffer_posn_from_coords): Account for a possible
10560 presence of header-line. (Bug#4426)
10561
10562 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10563
10564 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10565 Don't advertise functionality which we discourage or doesn't work.
10566
10567 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10568
10569 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10570 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10571 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10572 this makes Emacs dump core during garbage collection on rare
10573 occasions. sizeof is obviously inferior to offsetof here, so
10574 stick with offsetof.
10575 (GC_POINTER_ALIGNMENT): New macro.
10576 (mark_memory): Omit 3rd (offset) arg; caller changed.
10577 Don't assume EMACS_INT alignment is the same as pointer alignment.
10578
10579 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10580
10581 * keyboard.c (read_key_sequence_remapped): New var.
10582 (read_key_sequence): Compute remapping in the right buffer.
10583 (command_loop_1): Use read_key_sequence's remapping directly.
10584
10585 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10586
10587 * dired.c (file_name_completion): Don't expand file name.
10588 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10589 before checking file name handler.
10590
10591 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10592 they've been requested explicitly (bug#9591).
10593
10594 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
10595
10596 * keymap.c (Fsingle_key_description): Use make_specified_string
10597 instead of build_string to build string from push_key_description.
10598 (Bug#5193)
10599
10600 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10601
10602 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10603 This fixes a Y2038 bug on 64-bit hosts.
10604 * buffer.c (reset_buffer):
10605 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10606 (Fclear_buffer_auto_save_failure):
10607 Use 0, not -1, to represent an unset failure time, since time_t
10608 might not be signed.
10609
10610 Remove dependency on glibc malloc internals.
10611 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10612 Move back here from lisp.h, but with their new implementations.
10613 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10614 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10615 * charset.c (charset_table_init): New static var.
10616 (syms_of_charset): Use it instead of xmalloc. This removes a
10617 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10618 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10619 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10620 Move back to alloc.c.
10621 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10622 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10623
10624 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10625
10626 * nsterm.m (windowDidResize): Call x_set_window_size only when
10627 ns_in_resize is true. Otherwise set pixelwidth/height and
10628 call change_frame_size (Bug#9628).
10629
10630 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10631
10632 Port --enable-checking=all to Fedora 14 x86-64.
10633 * charset.c (syms_of_charset): Also account for glibc malloc's
10634 internal overhead when calculating the initial malloc maximum.
10635
10636 Port --enable-checking=all to Fedora 14 x86.
10637 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10638 Move to lisp.h.
10639 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10640 (overrun_check_realloc, overrun_check_free):
10641 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10642 That way, xmalloc returns a properly-aligned pointer even if
10643 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10644 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10645 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10646 into account when calculating the initial malloc maximum.
10647 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10648 Move here from alloc.c, so that charset.c can use it too.
10649 Properly align; the old code wasn't right for common 32-bit hosts
10650 when configured with --enable-checking=all.
10651 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10652 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10653
10654 2011-09-29 Eli Zaretskii <eliz@gnu.org>
10655
10656 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10657 use EDOM.
10658
10659 2011-09-28 Eli Zaretskii <eliz@gnu.org>
10660
10661 * xdisp.c (compute_display_string_end): If there's no display
10662 string at CHARPOS, return -1.
10663
10664 * bidi.c (bidi_fetch_char): When compute_display_string_end
10665 returns a negative value, treat the character as a normal
10666 character not covered by a display string. (Bug#9624)
10667
10668 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
10669
10670 * lread.c (Fread_from_string): Fix typo in docstring.
10671
10672 2011-09-27 Eli Zaretskii <eliz@gnu.org>
10673
10674 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10675 newline, reseat the iterator instead of bidi-iterating there one
10676 character at a time. (Bug#9610)
10677 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10678 TO_CHARPOS if the bidi iterator is at base embedding level.
10679
10680 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10681
10682 * lread.c (readevalloop): Use correct code for NBSP.
10683 (read1): Likewise. (Bug#9608)
10684
10685 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
10686
10687 * dbusbind.c (Fdbus_register_signal): When service is not
10688 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10689
10690 2011-09-25 Glenn Morris <rgm@gnu.org>
10691
10692 * buffer.c (truncate-lines): Doc fix.
10693
10694 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
10695
10696 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10697 (Fset_window_next_buffers): Doc fix.
10698
10699 2011-09-24 Glenn Morris <rgm@gnu.org>
10700
10701 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10702
10703 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10704
10705 Fix minor problems found by static checking.
10706 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10707 * indent.c (Fvertical_motion): Fix == vs = typo.
10708
10709 2011-09-24 Eli Zaretskii <eliz@gnu.org>
10710
10711 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10712 Default value is now t. Doc fix.
10713
10714 * indent.c (Fvertical_motion): Compute and apply the overshoot
10715 logic when moving up, not only when moving down. Fix the
10716 confusing name and values of the it_overshoot_expected variable;
10717 logic changes accordingly. (Bug#9254) (Bug#9549)
10718
10719 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10720 CHARPOS is covered by a display string which includes newlines.
10721 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10722 is covered by a display string with embedded newlines.
10723
10724 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
10725
10726 * dbusbind.c (Fdbus_register_signal): Add match rule to
10727 Vdbus_registered_objects_table. (Bug#9581)
10728 (Fdbus_register_method, Vdbus_registered_objects_table):
10729 Fix docstring.
10730
10731 2011-09-24 Jim Meyering <meyering@redhat.com>
10732
10733 do not ignore write error for any output size
10734 The previous change was incomplete.
10735 While it makes emacs --batch detect the vast majority of stdout
10736 write failures, errors were still ignored whenever the output size is
10737 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10738 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10739 && echo FAIL: ignored write error
10740 FAIL: ignored write error
10741 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10742 && echo FAIL: ignored write error
10743 FAIL: ignored write error
10744 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10745
10746 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10747
10748 * emacs.c (Fkill_emacs): In noninteractive mode exit
10749 non-successfully if a write error occurred on stdout. (Bug#9574)
10750
10751 2011-09-21 Eli Zaretskii <eliz@gnu.org>
10752
10753 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10754 the xassert test.
10755
10756 * dispextern.h (struct it): Update the comment documenting what
10757 can it->OBJECT be.
10758
10759 2011-09-20 Eli Zaretskii <eliz@gnu.org>
10760
10761 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10762 a display string, extend search for cursor position to end of row.
10763 (find_row_edges): If the row ends in a newline from a display
10764 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10765 Handle the case of a display string with multiple newlines.
10766 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10767 non-empty line. Fixes confusing cursor motion with arrow keys at
10768 the beginning of a line that starts with whitespace.
10769
10770 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10771
10772 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10773 (bug#9493).
10774
10775 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
10776
10777 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10778 boolean (Bug#9154).
10779
10780 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10781
10782 * xdisp.c (display_line): Record maximum and minimum buffer
10783 positions even if no glyphs were produced (e.g., by a zero-width
10784 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10785 buffer positions that will be removed from the glyph row because
10786 they don't fit.
10787 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10788 column is beyond frame width: don't subtract 1 "pixel" when
10789 computing width of the stretch.
10790 (reseat_at_next_visible_line_start): Undo the change made on
10791 2011-09-17 that saved paragraph information and restored it after
10792 the call to `reseat'. (Bug#9545)
10793
10794 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10795
10796 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10797 and turn window cursor on if cleared (Bug#9415).
10798
10799 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10800
10801 * search.c (boyer_moore): Take unibyte characters from pattern
10802 literally. (Bug#9458)
10803
10804 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10805
10806 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10807
10808 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10809
10810 Fix minor problem found by static checking.
10811 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10812 initialized, to pacify gcc -Wuninitialized.
10813
10814 * fileio.c: Report proper errno when syscall falls.
10815 (Finsert_file_contents): Save and restore errno,
10816 so that report_file_error outputs the correct diagnostic.
10817 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10818
10819 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10820
10821 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10822
10823 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10824
10825 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10826 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10827
10828 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10829
10830 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10831 about the current paragraph and restore it after the call to reseat.
10832
10833 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10834 (bidi_find_paragraph_start): Search back for paragraph beginning
10835 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10836 (bidi_move_to_visually_next): Only trigger paragraph-related
10837 computations when the last character is a newline or at EOB, not
10838 just any NEUTRAL_B. (Bug#9470)
10839
10840 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10841 truncated lines if point is covered by a display string. (Bug#9524)
10842
10843 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10844
10845 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10846 (cons_to_x_long): New function.
10847 (lisp_data_to_selection_data): Use it. Correct the test for
10848 short-versus-long data; it was negated. Break out of vector
10849 loop, for efficiency, when a long datum is discovered.
10850
10851 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10852
10853 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10854
10855 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10856
10857 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10858 GCC PR/17406) by declaring this function with external scope.
10859
10860 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10861
10862 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10863 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10864
10865 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10866
10867 * editfns.c (Fformat): Correctly handle text properties on "%%".
10868
10869 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10870
10871 * xterm.c (x_draw_composite_glyph_string_foreground):
10872 * w32term.c (x_draw_composite_glyph_string_foreground):
10873 * term.c (encode_terminal_code):
10874 * composite.c (composition_update_it, get_composition_id):
10875 * xdisp.c (get_next_display_element)
10876 (fill_composite_glyph_string): Add comments about special meaning
10877 of TAB characters in a composition.
10878
10879 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10880
10881 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10882 This occurs when processing a multibyte format.
10883 Problem reported by Wolfgang Jenker.
10884
10885 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10886
10887 * xdisp.c (try_cursor_movement): Only check for exact match if
10888 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10889
10890 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10891
10892 Remove unused external symbols.
10893 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10894 * xdisp.c (calc_pixel_width_or_height): Now static.
10895 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10896 * indent.c (check_display_width):
10897 * w32term.c: Fix comment to match code.
10898 * xterm.c, xterm.h (x_catching_errors): Remove.
10899
10900 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10901
10902 * xselect.c: Use signed conversions more consistently (Bug#9498).
10903 (selection_data_to_lisp_data): Assume incoming selection data are
10904 signed integers, not unsigned. This is to be consistent with
10905 outgoing selection data, which was modified to use signed integers
10906 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10907 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10908 expects long, not unsigned long.
10909
10910 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10911
10912 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10913 computation of loop end. Reported by Johan Bockgård
10914 <bojohan@gnu.org>.
10915
10916 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10917
10918 * frame.c (Fother_visible_frames_p): Function deleted.
10919
10920 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10921
10922 * indent.c (compute_motion): Process display vector front to back
10923 rather than the other way around. (Bug#2496)
10924
10925 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10926
10927 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10928
10929 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10930
10931 * minibuf.c (Fread_from_minibuffer): Doc fix.
10932
10933 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10934
10935 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10936 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10937
10938 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10939
10940 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10941 value for non-existent files.
10942
10943 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10944
10945 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10946 set its "size" to -1. This will set the modtime_size field of
10947 the corresponding buffer to -1, which is what
10948 verify-visited-file-modtime expects for files that do not exist.
10949 (Bug#9139)
10950
10951 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10952
10953 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10954 here ...
10955 * lisp.h: ... from here. push_key_description is no longer
10956 defined in keyboard.c, so its declaration should not be in
10957 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10958 logically belongs with push_key_description.
10959
10960 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10961
10962 * buffer.h: Include <sys/types.h> instead of <time.h>.
10963 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10964 Problem reported by Herbert J. Skuhra.
10965
10966 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10967
10968 * xml.c (parse_region): Make the parsing work for
10969 non-comment-starting XML files again (bug#9144).
10970
10971 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10972
10973 * image.c (gif_load): Fix calculation of bottom and right corner.
10974 (Bug#9468)
10975
10976 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10977
10978 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10979 redisplay in small windows.
10980
10981 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10982
10983 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10984
10985 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10986
10987 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10988 Operate on live windows only.
10989
10990 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10991
10992 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10993
10994 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10995
10996 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10997 only under bidi iteration.
10998
10999 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11000
11001 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11002
11003 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11004
11005 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11006 Without this fix, the command to link temacs failed due to an
11007 undefined symbol __builtin_isnan. This is because
11008 /usr/include/iso/math_c99.h #defines isnan(x) to
11009 __builtin_isnan(x), but the bundled gcc, which identifies itself
11010 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11011 a __builtin_isnan.
11012 * floatfns.c (isnan): #undef, and then #define to a clone of
11013 what's in data.c.
11014 (Fisnan): Always define, since it's always available now.
11015 (syms_of_floatfns): Always define isnan at the Lisp level.
11016
11017 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11018
11019 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11020
11021 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11022
11023 * fileio.c: Fix bugs with large file offsets (Bug#9428).
11024 The previous code assumed that file offsets (off_t values) fit in
11025 EMACS_INT variables, which is not true on typical 32-bit hosts.
11026 The code messed up by falsely reporting buffer overflow in cases
11027 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11028 when "big" contains more than 2**29 bytes, even though this
11029 inserts just one byte and does not overflow the buffer.
11030 (Finsert_file_contents): Store file offsets as off_t
11031 values, not as EMACS_INT values. Check for overflow when
11032 converting between EMACS_INT and off_t. When checking for
11033 buffer overflow or for overlap, take the offsets into account.
11034 Don't use EMACS_INT for small values where int suffices.
11035 When checking for overlap, fix a typo: ZV was used where
11036 ZV_BYTE was intended.
11037 (Fwrite_region): Don't assume off_t fits into 'long'.
11038 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11039
11040 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
11041
11042 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11043
11044 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11045
11046 sprintf-related integer and memory overflow issues (Bug#9412).
11047
11048 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11049 (esprintf, exprintf, evxprintf): New functions.
11050 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11051 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11052 (modify_event_symbol): Do not assume that the length of
11053 name_alist_or_stem is safe to alloca and fits in int.
11054 (Fexecute_extended_command): Likewise for function name and binding.
11055 (Frecursion_depth): Wrap around reliably on integer overflow.
11056 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11057 since some callers pass EMACS_INT values.
11058 (Fsingle_key_description): Don't crash if symbol name contains more
11059 than MAX_ALLOCA bytes.
11060 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11061 (get_minibuffer): Arg is now EMACS_INT, not int.
11062 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11063 (esprintf, exprintf, evxprintf): New decls.
11064 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11065
11066 * dbusbind.c (signature_cat): New function.
11067 (xd_signature, Fdbus_register_signal):
11068 Do not overrun buffer; instead, report string overflow.
11069
11070 * dispnew.c (add_window_display_history): Don't overrun buffer.
11071 Truncate instead; this is OK since it's just a log.
11072
11073 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11074 even if the time zone offset is outlandishly large.
11075 Don't mishandle offset == INT_MIN.
11076
11077 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11078 when creating daemon; the previous buffer-overflow check was incorrect.
11079
11080 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11081 which has the guts of the old verror function.
11082
11083 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11084 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11085
11086 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11087 (font_unparse_xlfd): Don't blindly alloca long strings.
11088 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11089 fits in int, when using sprintf. Use single snprintf to count
11090 length of string rather than counting it via multiple sprintfs;
11091 that's simpler and more reliable.
11092 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11093 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11094 sprintf, in case result does not fit in int.
11095
11096 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11097 (fontset_from_font): Print it.
11098
11099 * frame.c (tty_frame_count): Now printmax_t, not int.
11100 (make_terminal_frame, set_term_frame_name): Print it.
11101 (x_report_frame_params): In X, window IDs are unsigned long,
11102 not signed long, so print them as unsigned.
11103 (validate_x_resource_name): Check for implausibly long names,
11104 and don't assume name length fits in 'int'.
11105 (x_get_resource_string): Don't blindly alloca invocation name;
11106 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11107 not fit in int.
11108
11109 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11110 (xg_check_special_colors, xg_set_geometry):
11111 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11112
11113 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11114 Use esprintf, not sprintf, in case result does not fit in int.
11115
11116 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11117 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11118 it as a large positive number.
11119 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11120 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11121
11122 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11123 in case result does not fit in int.
11124
11125 * print.c (float_to_string): Detect width overflow more reliably.
11126 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11127 buffer overrun. Don't assume list length fits in 'int'. Treat
11128 print length of 0 as 0, not as infinity; to be consistent with other
11129 uses of print length in this function. Don't overflow print length
11130 index. Don't assume hash table size fits in 'long', or that
11131 vectorlike size fits in 'unsigned long'.
11132
11133 * process.c (make_process): Use printmax_t, not int, to format
11134 process-name gensyms.
11135
11136 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11137
11138 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11139 to avoid potential buffer overrun.
11140
11141 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11142 if X resource line is longer than 512 bytes.
11143
11144 * xfns.c (x_window): Make sprintf buffer a bit bigger
11145 to avoid potential buffer overrun.
11146
11147 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11148
11149 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11150
11151 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11152
11153 Integer overflow fixes for scrolling, etc.
11154 Without these, Emacs silently mishandles large integers sometimes.
11155 For example, "C-u 4294967297 M-x recenter" was treated as if
11156 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11157
11158 * xdisp.c (try_window_id): Check Emacs fixnum range before
11159 converting to 'int'.
11160
11161 * window.c (window_scroll_line_based, Frecenter):
11162 Check that an Emacs fixnum is in range before assigning it to 'int'.
11163 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11164 values converted from Emacs fixnums.
11165 (Frecenter): Don't wrap around a line count if it is out of 'int'
11166 range; instead, treat it as an extreme value.
11167 (Fset_window_configuration, compare_window_configurations):
11168 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11169
11170 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11171 that can exceed INT_MAX. Check that EMACS_INT value is in range
11172 before assigning it to the (possibly-narrower) index.
11173 (match_limit): Don't assume that a fixnum can fit in 'int'.
11174
11175 * print.c (print_object): Use ptrdiff_t, not int, for index that can
11176 exceed INT_MAX.
11177
11178 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11179 (Fvertical_motion): Don't wrap around LINES values that don't fit
11180 in 'int'. Instead, treat them as extreme values. This is good
11181 enough for windows, which can't have more than INT_MAX lines anyway.
11182
11183 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11184
11185 * Require libxml/parser.h to avoid compilation warning.
11186
11187 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11188
11189 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11190 since this reportedly can destroy thread storage.
11191
11192 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
11193
11194 * syntax.c (find_defun_start): Update all cache variables if
11195 exiting early (Bug#9401).
11196
11197 2011-08-30 Eli Zaretskii <eliz@gnu.org>
11198
11199 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11200
11201 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11202 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11203 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11204
11205 * term.c (tty_append_glyph): New function.
11206 (produce_stretch_glyph): Static function and its prototype deleted.
11207
11208 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11209 Add prototypes.
11210
11211 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11212
11213 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11214 when checking :margin (Bug#9390).
11215 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11216 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11217 so that the name doesn't mislead. All uses changed.
11218
11219 2011-08-28 Johan Bockgård <bojohan@gnu.org>
11220
11221 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11222 set_tty_hooks.
11223
11224 2011-08-27 Eli Zaretskii <eliz@gnu.org>
11225
11226 * xdisp.c (move_it_to): Don't bail out early when reaching
11227 position beyond to_charpos, if we are scanning backwards.
11228 (move_it_vertically_backward): When DY == 0, make sure we get to
11229 the first character in the line after the newline.
11230
11231 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11232
11233 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11234 (ccl_driver): Do not generate an out-of-range pointer.
11235 (Fccl_execute_on_string): Remove unnecessary check for
11236 integer overflow, noted by Stefan Monnier in
11237 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11238 Remove a FIXME that didn't need fixing.
11239 Simplify the newly-introduced buffer reallocation code.
11240
11241 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
11242
11243 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11244
11245 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
11246
11247 Integer and memory overflow issues (Bug#9196).
11248
11249 * doc.c (get_doc_string): Rework so that
11250 get_doc_string_buffer_size is the actual buffer size, rather than
11251 being 1 less than the actual buffer size; this makes xpalloc more
11252 convenient.
11253
11254 * image.c (x_allocate_bitmap_record, cache_image):
11255 * xselect.c (Fx_register_dnd_atom):
11256 Simplify previous changes by using xpalloc.
11257
11258 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11259 since either will do and ptrdiff_t is convenient with xpalloc.
11260
11261 * charset.c (charset_table_size)
11262 (struct charset_sort_data.priority): Now ptrdiff_t.
11263 (charset_compare): Don't overflow if priorities differ greatly.
11264 (Fsort_charsets): Don't assume list length fits in int.
11265 Check for size-calculation overflow when allocating sort data.
11266 (syms_of_charset): Allocate an initial charset table that is
11267 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11268
11269 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11270
11271 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11272 The actual value is always <= INT_MAX, and leaving it unsigned made
11273 overflow checking harder.
11274
11275 * dispextern.h (struct glyph_matrix.rows_allocated)
11276 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11277 with xpalloc. The values are still always <= INT_MAX.
11278
11279 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11280
11281 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11282 (SAFE_NALLOCA): New macro.
11283
11284 * region-cache.c (struct boundary.pos, find_cache_boundary)
11285 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11286 (set_cache_region, invalidate_region_cache)
11287 (revalidate_region_cache, know_region_cache, region_cache_forward)
11288 (region_cache_backward, pp_cache):
11289 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11290 so that ptrdiff_t * can be passed to xpalloc.
11291 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11292 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11293 (pp_cache): Don't assume cache_len fits in int.
11294 * region-cache.h: Adjust extern decls to match.
11295
11296 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11297 EMACS_INT, since either will do, for xpalloc.
11298
11299 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11300 (xnmalloc, xnrealloc, xpalloc): New functions.
11301
11302 * bidi.c (bidi_shelve_header_size): New constant.
11303 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11304 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11305
11306 * bidi.c (bidi_cache_shrink):
11307 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11308 (overlay_strings):
11309 Don't update size of array until after memory allocation succeeds,
11310 because xmalloc/xrealloc may not return.
11311 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11312 now that we have proper integer overflow checking.
11313 (record_overlay_string, overlay_strings): Catch overflows when
11314 calculating size of overlay_str_buf.
11315
11316 * callproc.c (Fcall_process): Check for size overflow when
11317 calculating size of args2.
11318 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11319 Normally we prefer signed values, but sticking with ptrdiff_t would
11320 require adding more-complicated checks.
11321
11322 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11323 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11324 Redo buffer-overflow calculations to avoid integer overflow.
11325 Add a FIXME comment where memory seems to be over-allocated.
11326
11327 * character.c (Fstring): Check for size-calculation overflow.
11328
11329 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11330 unnecessary integer overflow. Check for size overflow.
11331 (encode_coding_object): Don't update size until xmalloc succeeds.
11332
11333 * composite.c (get_composition_id): Check for overflow in glyph
11334 length calculations.
11335
11336 Integer and memory overflow fixes for display code.
11337 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11338 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11339 (scrolling_window): Check for overflow in size calculations.
11340 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11341 Don't assume glyph table len fits in int.
11342 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11343 (row_table_size): Now ptrdiff_t, not int.
11344 (scrolling_window): Avoid overflow in size calculations.
11345 Don't update size until allocation succeeds.
11346 * fns.c (concat): Check for overflow in size calculations.
11347 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11348 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11349 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11350
11351 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11352 (get_doc_string): Check for size calculation overflow.
11353 Don't update size until allocation succeeds.
11354 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11355 EMACS_INT, where ptrdiff_t will do.
11356 (Fsubstitute_command_keys): Check for string overflow.
11357
11358 * editfns.c (set_time_zone_rule): Don't assume environment length
11359 fits in int.
11360 (message_length): Now ptrdiff_t, not int.
11361 (Fmessage_box): Don't update size until allocation succeeds.
11362 Don't assume message length fits in int.
11363 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11364
11365 * emacs.c (main): Do not reallocate argv, since there is a null at
11366 the end that can be overwritten, and this way there's no need to
11367 worry about size-calculation overflow.
11368 (sort_args): Check for size-calculation overflow.
11369
11370 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11371 alloc succeeds.
11372 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11373
11374 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11375 (x_set_scroll_bar_width, x_figure_window_size):
11376 Check for integer overflow.
11377 (x_set_alpha): Do not assume XINT fits in int.
11378
11379 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11380 This is for the members text_lines, text_cols, total_lines, total_cols,
11381 where the system imposes an 'int' limit.
11382
11383 * fringe.c (Fdefine_fringe_bitmap):
11384 Don't update size until alloc works.
11385
11386 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11387 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11388
11389 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11390 Check for size-calculation overflow.
11391 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11392 do, as we prefer signed integers.
11393 (id_to_widget.max_size, id_to_widget.used)
11394 (xg_store_widget_in_map, xg_remove_widget_from_map)
11395 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11396 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11397 Use and return ptrdiff_t, not int.
11398 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11399 * gtkutil.h: Change prototypes to match the above.
11400
11401 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11402 are duplicate now that they've been promoted to lisp.h.
11403 (x_allocate_bitmap_record, x_alloc_image_color)
11404 (make_image_cache, cache_image, xpm_load):
11405 Don't update size until alloc is done.
11406 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11407 (x_detect_edges):
11408 Check for size calculation overflow.
11409 (ct_colors_allocated_max): New constant.
11410 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11411 overflow.
11412
11413 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11414 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11415 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11416 Use ptrdiff_t, not int, to count maps.
11417 (read_char_minibuf_menu_prompt): Check for overflow in size
11418 calculations. Don't update size until allocation succeeds.
11419 Redo calculations to avoid overflow.
11420 * keyboard.h: Change prototypes to match the above.
11421
11422 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11423 to count maps.
11424 (current_minor_maps): Check for size calculation overflow.
11425 * keymap.h: Change prototypes to match the above.
11426
11427 * lread.c (read1, init_obarray): Don't update size until alloc done.
11428
11429 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11430 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11431
11432 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11433 Now ptrdiff_t, not int.
11434 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11435 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11436
11437 * process.c (Fnetwork_interface_list): Check for overflow
11438 in size calculation.
11439
11440 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11441
11442 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11443 overflow. Don't bother calling xmalloc when xrealloc will do.
11444
11445 * search.c (Freplace_match): Check for size calculation overflow.
11446 (Fset_match_data): Don't assume list lengths fit in 'int'.
11447
11448 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11449 for command line length. Do not attempt to address one before the
11450 beginning of an array, as that's not portable.
11451
11452 * term.c (max_frame_lines): Remove; unused.
11453 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11454 not int.
11455 (encode_terminal_code, calculate_costs): Check for size
11456 calculation overflow.
11457 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11458 table lengths and related sizes. Don't update size until alloc
11459 done. Redo calculations to avoid overflow.
11460 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11461
11462 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11463 subtracting pointers.
11464 (gobble_line): Check for overflow more carefully. Don't update size
11465 until alloc done.
11466
11467 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11468 Don't update size until alloc done.
11469 Redo size calculations to avoid overflow.
11470 Check for size calculation overflow.
11471 (main) [DEBUG]: Fix typo in invoking tparam1.
11472
11473 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11474 Use ptrdiff_t, not int, for sizes.
11475 (store_mode_line_noprop_char): Don't update size until alloc done.
11476
11477 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11478 Use ptrdiff_t, not int, for sizes.
11479 (Finternal_make_lisp_face, cache_face):
11480 Check for size calculation overflow.
11481 (cache_face): Treat size calculation overflows as if they were
11482 memory exhaustion (the usual treatment), rather than aborting.
11483
11484 * xfns.c (x_encode_text, x_set_name_internal)
11485 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11486 sizes, since they can exceed INT_MAX in size. Check for size
11487 calculation overflow.
11488
11489 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11490 (xg_select): Check for size calculation overflow.
11491 Don't update size until alloc done.
11492
11493 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11494 as sprintf is limited to int lengths.
11495
11496 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11497 (X_LONG_MIN): New macros.
11498 Use them to make the following changes clearer.
11499 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11500 This change doesn't affect the value now, but it may help remind
11501 future maintainers not to raise the value too much later.
11502 (SELECTION_QUANTUM): Remove, replacing with ...
11503 (selection_quantum): ... new function, which avoids overflow.
11504 All uses changed.
11505 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11506 assumption that selection length fits in 'int'.
11507 (x_reply_selection_request, x_handle_selection_request)
11508 (x_get_window_property, receive_incremental_selection)
11509 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11510 (lisp_data_to_selection_data, clean_local_selection_data):
11511 Use ptrdiff_t, not int, to record length of selection.
11512 (x_reply_selection_request, x_get_window_property)
11513 (receive_incremental_selection, x_property_data_to_lisp):
11514 Redo calculations to avoid overflow.
11515 (x_reply_selection_request): When sending hint, ceiling it at
11516 X_LONG_MAX rather than relying on wraparound overflow to send
11517 something.
11518 (x_get_window_property, receive_incremental_selection)
11519 (lisp_data_to_selection_data, x_property_data_to_lisp):
11520 Check for size-calculation overflow.
11521 (x_get_window_property, receive_incremental_selection)
11522 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11523 Don't store size until memory allocation succeeds.
11524 (x_get_window_property): Plug memory leak on memory exhaustion.
11525 Don't double-block input; malloc is safe here. Don't assume 2**34
11526 - 4 fits in unsigned long. Add an xassert to check
11527 XGetWindowProperty overflow. Be more careful about overflow
11528 calculations, and distinguish size from memory overflow better.
11529 (receive_incremental_selection): When tracing, don't assume
11530 unsigned int is less than INT_MAX.
11531 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11532 harmful) conversions of unsigned short to int.
11533 (lisp_data_to_selection_data): Don't assume that integers
11534 in the range -65535 through -1 fit in an X unsigned short.
11535 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11536 result parameters unless successful. Rely on cons_to_unsigned
11537 to report problems with elements; the old code wasn't right anyway.
11538 (x_check_property_data): Check for int overflow; we cannot use
11539 a wider type due to X limits.
11540 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11541
11542 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11543
11544 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11545 (x_term_init): Check for size calculation overflow.
11546 (x_color_cells): Don't store size until memory allocation succeeds.
11547 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11548 Don't assume alloca size is less than MAX_ALLOCA.
11549 (x_term_init): Don't assume length fits in int (sprintf is limited
11550 to int size).
11551
11552 Use ptrdiff_t for composition IDs.
11553 * character.c (lisp_string_width):
11554 * composite.c (composition_table_size, n_compositions)
11555 (get_composition_id, composition_gstring_from_id):
11556 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11557 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11558 * window.c (Frecenter):
11559 Use ptrdiff_t, not int, for composition IDs.
11560 * composite.c (get_composition_id): Check for integer overflow.
11561 * composite.h: Adjust prototypes to match the above changes.
11562
11563 Use ptrdiff_t for hash table indexes.
11564 * category.c (hash_get_category_set):
11565 * ccl.c (ccl_driver):
11566 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11567 * coding.c (coding_system_charset_list, detect_coding_system):
11568 * coding.h (struct coding_system.id):
11569 * composite.c (get_composition_id, gstring_lookup_cache):
11570 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11571 * image.c (xpm_get_color_table_h):
11572 * lisp.h (hash_lookup, hash_put):
11573 * minibuf.c (Ftest_completion):
11574 Use ptrdiff_t for hash table indexes, not int (which is too
11575 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11576 32-bit --with-wide-int hosts).
11577
11578 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11579 Add a FIXME comment about memory leaks.
11580 (syms_of_charset): Don't assume xmalloc returns.
11581
11582 Don't assume that stated character widths fit in int.
11583 * character.c (Fchar_width, c_string_width, lisp_string_width):
11584 * character.h (CHAR_WIDTH):
11585 * indent.c (MULTIBYTE_BYTES_WIDTH):
11586 Use sanitize_char_width to avoid undefined and/or bad behavior
11587 with outlandish widths.
11588 * character.h (sanitize_tab_width): Rename from sanitize_width,
11589 now that we have two such functions. All uses changed.
11590 (sanitize_char_width): New inline function.
11591
11592 Don't assume that tab-width fits in int.
11593 * character.h (sanitize_width): New inline function.
11594 (SANE_TAB_WIDTH): New macro.
11595 (ASCII_CHAR_WIDTH): Use it.
11596 * indent.c (sane_tab_width): Remove. All uses replaced by
11597 SANE_TAB_WIDTH (current_buffer).
11598 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11599
11600 * fileio.c: Integer overflow issues with file modes.
11601 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11602
11603 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11604 Remove unreachable code.
11605 (read_hex, load_charset_map_from_file): Check for integer overflow.
11606
11607 * xterm.c: Don't go over XClientMessageEvent limit.
11608 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11609 (x_send_scroll_bar_event): Likewise. Check that the size does not
11610 exceed limits imposed by XClientMessageEvent, as well as the usual
11611 ptrdiff_t and size_t limits.
11612
11613 * keyboard.c: Overflow, signedness and related fixes.
11614 (make_lispy_movement): Use same integer type in forward decl
11615 that is used in the definition.
11616 (read_key_sequence, keyremap_step):
11617 Change bufsize argument back to int, undoing my 2011-03-30 change.
11618 We prefer signed types, and int is wide enough here.
11619 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11620 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11621 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11622 length, not size_t. Use ptrdiff_t for index, not int.
11623 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11624 possibility of integer overflow.
11625
11626 Overflow, signedness and related fixes for images.
11627
11628 * dispextern.h (struct it.stack[0].u.image.image_id)
11629 (struct_it.image_id, struct image.id, struct image_cache.size)
11630 (struct image_cache.used, struct image_cache.ref_count):
11631 * gtkutil.c (update_frame_tool_bar):
11632 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11633 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11634 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11635 * nsmenu.m (update_frame_tool_bar):
11636 * xdisp.c (calc_pixel_width_or_height):
11637 * xfns.c (image_cache_refcount):
11638 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11639 on typical 64-bit hosts.
11640
11641 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11642 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11643 Omit unnecessary casts to int.
11644 (parse_image_spec): Check that integers fall into 'int' range
11645 when the callers expect that.
11646 (image_ascent): Redo ascent calculation to avoid int overflow.
11647 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11648 (lookup_image): Remove unnecessary tests.
11649 (xbm_image_p): Locals are now of int, not EMACS_INT,
11650 since parse_image_check makes sure they fit into int.
11651 (png_load, gif_load, svg_load_image):
11652 Prefer int to unsigned where either will do.
11653 (tiff_handler): New function, combining the cores of the
11654 old tiff_error_handler and tiff_warning_handler.
11655 This function is rewritten to use vsnprintf and thereby avoid
11656 stack buffer overflows. It uses only the features of vsnprintf
11657 that are common to both POSIX and native Microsoft.
11658 (tiff_error_handler, tiff_warning_handler): Use it.
11659 (tiff_load, gif_load, imagemagick_load_image):
11660 Don't assume :index value fits in 'int'.
11661 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11662 (imagemagick_load_image): Check that crop parameters fit into
11663 the integer types that MagickCropImage accepts. Don't assume
11664 Vimagemagick_render_type has a nonnegative value. Don't assume
11665 size_t fits in 'long'.
11666 (gs_load): Use printmax_t to print the widest integers possible.
11667 Check for integer overflow when computing image height and width.
11668
11669 2011-08-26 Eli Zaretskii <eliz@gnu.org>
11670
11671 * xdisp.c (redisplay_window): Don't force window start if point
11672 will be invisible in the resulting window. (Bug#9324)
11673
11674 2011-08-25 Eli Zaretskii <eliz@gnu.org>
11675
11676 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11677 the display spec is of the form `(space ...)'.
11678 (handle_display_spec): Return the value returned by
11679 handle_single_display_spec, not just 1 or zero.
11680 (handle_single_display_spec): If the display spec is of the form
11681 `(space ...)', and specifies display in the text area, return 2
11682 rather than 1.
11683 (try_cursor_movement): Check for the need to scroll more
11684 accurately, and prefer exact match for point under bidi.
11685 Don't advance `row' beyond the last row of the window.
11686
11687 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11688 into disp_prop; all users changed.
11689
11690 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11691 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11692 for the text covered by the display property.
11693
11694 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
11695
11696 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11697 Change return value to nil.
11698 (Frecord_buffer): Delete unused function.
11699
11700 2011-08-24 Eli Zaretskii <eliz@gnu.org>
11701
11702 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11703 buffers, return left-to-right.
11704 (set_cursor_from_row): Consider candidate row a win if its glyph
11705 represents a newline and point is on that newline. Fixes cursor
11706 positioning on the newline at EOL of R2L text within L2R
11707 paragraph, and vice versa.
11708 (try_cursor_movement): Check continued rows, in addition to
11709 continuation rows. Fixes unwarranted scroll when point enters a
11710 continued line of R2L text within an L2R paragraph, or vice versa.
11711 (cursor_row_p): Consider the case of point being equal to
11712 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11713 from the end of a short line to the beginning of a continued line
11714 of R2L text within L2R paragraph.
11715 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11716 composed characters.
11717
11718 * bidi.c (bidi_check_type): Use xassert.
11719 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11720 members.
11721
11722 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11723
11724 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11725 a character.
11726
11727 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
11728
11729 * nsfont.m (ns_otf_to_script): Fix typo.
11730
11731 2011-08-22 Kenichi Handa <handa@m17n.org>
11732
11733 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11734 extra slot even if the purpose is char-code-property-table.
11735
11736 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11737
11738 * xdisp.c (redisplay_window): When computing centering_position,
11739 account for the height of the header line. (Bug#8874)
11740
11741 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11742 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11743 candidate is selected by the mouse, and that candidate has a
11744 composed character under the mouse.
11745
11746 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11747 coordinates reported by pos-visible-in-window-p for a composed
11748 character in column zero.
11749
11750 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11751
11752 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11753
11754 2011-08-22 Eli Zaretskii <eliz@gnu.org>
11755
11756 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11757 consider it a hit if to_charpos is anywhere in the range of the
11758 composed buffer positions.
11759
11760 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
11761
11762 * image.c (gif_load): Don't assume that each subimage has the same
11763 dimensions as the base image. Handle disposal method that is
11764 "undefined" by the gif spec (Bug#9335).
11765
11766 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
11767
11768 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11769 (Fcondition_case): Document `debug' symbol in error handler.
11770
11771 2011-08-19 Eli Zaretskii <eliz@gnu.org>
11772
11773 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11774 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11775 from an Org mode buffer to a Speedbar frame.
11776
11777 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11778 a composition, take its buffer position from IT->cmp_it.charpos.
11779 Fixes cursor positioning at the beginning of a line that begins
11780 with a composed character.
11781
11782 2011-08-18 Eli Zaretskii <eliz@gnu.org>
11783
11784 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11785 character bidirectional type, use STRONG_L instead. Fixes crashes
11786 in a buffer produced by `describe-categories'.
11787
11788 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11789 members before the level stack, so they would be saved and
11790 restored when copying iterator state. Fixes incorrect reordering
11791 around TABs covered by display properties.
11792
11793 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11794
11795 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11796
11797 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
11798
11799 * eval.c (internal_condition_case, internal_condition_case_1)
11800 (internal_condition_case_2, internal_condition_case_n):
11801 Remove unnecessary aborts (Bug#9081).
11802
11803 2011-08-17 Eli Zaretskii <eliz@gnu.org>
11804
11805 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11806 has no `load' handler, try opening the file locally. (Bug#9311)
11807
11808 2011-08-16 Ken Brown <kbrown@cornell.edu>
11809
11810 * gmalloc.c: Expand comment.
11811
11812 2011-08-16 Eli Zaretskii <eliz@gnu.org>
11813
11814 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11815 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11816
11817 2011-08-16 Ken Brown <kbrown@cornell.edu>
11818
11819 Fix memory allocation problems in Cygwin build (Bug#9273).
11820
11821 * unexcw.c ( __malloc_initialized): Declare external variable.
11822 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11823
11824 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11825 New variables.
11826 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11827 dumped emacs.
11828 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11829 in the static heap.
11830 [CYGWIN] (special_realloc): New function.
11831 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11832 requests to realloc storage in the static heap.
11833
11834 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11835
11836 * bidi.c (bidi_initialize): Remove unused local.
11837
11838 2011-08-15 Eli Zaretskii <eliz@gnu.org>
11839
11840 * bidimirror.h:
11841 * biditype.h: Remove file.
11842 * makefile.w32-in ($(BLD)/bidi.$(O)):
11843 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11844
11845 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11846
11847 * chartab.c: Improve commentary for the uniprop_table API.
11848
11849 * bidi.c (bidi_paragraph_init): Support zero value of
11850 bidi_ignore_explicit_marks_for_paragraph_level.
11851 (bidi_initialize): Use uniprop_table instead of including
11852 biditype.h and bidimirror.h.
11853
11854 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11855 coordinates of the iterator when restoring from ppos_it.
11856 (Bug#9296)
11857
11858 2011-08-14 Kenichi Handa <handa@m17n.org>
11859
11860 * process.c (create_process): Call setup_process_coding_systems
11861 after the pid of the process is set to -1 (Bug#8162).
11862
11863 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11864
11865 * xdisp.c (move_it_in_display_line_to): Don't invoke
11866 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11867 ppos_it. Fixes vertical cursor motion when line beginning is
11868 covered by an image. (Bug#9296)
11869
11870 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11871
11872 * nsterm.h (ns_run_ascript): Declare.
11873 (NSAPP_DATA2_RUNASSCRIPT): Define.
11874
11875 * nsfns.m (as_script, as_result, as_status): New static variables.
11876 (ns_run_ascript): New function.
11877 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11878 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11879 the event loop. Get status from as_status (Bug#7276).
11880
11881 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11882 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11883 the event loop (Bug#7276).
11884
11885 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11886
11887 * gnutls.c (QCgnutls_bootprop_priority)
11888 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11889 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11890 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11891 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11892 (QCgnutls_bootprop_verify_hostname_error)
11893 (QCgnutls_bootprop_callbacks_verify): Rename from
11894 Qgnutls_bootprop_..., all uses changed.
11895
11896 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11897 uses changed.
11898
11899 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11900
11901 * xfaces.c (Qframe_set_background_mode): Now static.
11902 * dispextern.h (Qframe_set_background_mode): Remove decl.
11903
11904 * process.c (Fnetwork_interface_info): Declare local only if needed.
11905
11906 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11907
11908 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11909 (Fnetwork_interface_list): Allocate in increments of bytes instead
11910 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11911 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11912 sockaddr.
11913 (struct ifflag_def): notrailers is smart on OSX.
11914 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11915 Get hardware address with getifaddrs if available.
11916
11917 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11918
11919 * xdisp.c (iterate_out_of_display_property): xassert that
11920 IT->position is set to within IT->object's boundaries. Break from
11921 the loop as soon as EOB is reached; avoids infloops in redisplay
11922 when IT->position is set up wrongly due to some bug.
11923 Set IT->current to match the bidi iterator unconditionally.
11924 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11925 entry. Force push_it to save on the stack the current
11926 buffer/string position, to be restored by pop_it. Fix flags in
11927 the iterator structure wrt the object coming from a display
11928 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11929 properties. (Bug#9284)
11930
11931 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11932
11933 * fontset.c (fontset_get_font_group): Add proper type checks.
11934 (Bug#9172)
11935
11936 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11937
11938 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11939 and LC_VERSION_MIN_MACOSX.
11940 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11941 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11942
11943 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11944
11945 * xdisp.c (forward_to_next_line_start): Allow to use the
11946 no-display-properties-and-no-overlays under bidi display.
11947 Set disp_pos in the bidi iterator to avoid searches for display
11948 properties and overlays.
11949
11950 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11951
11952 * editfns.c (Fset_time_zone_rule): Document relationship with the
11953 setenv function.
11954
11955 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11956 the font entity extracted from the cache (Bug#8109).
11957
11958 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11959
11960 * composite.c (autocmp_chars): Don't reset point. That is done by
11961 restore_point_unwind (Bug#5984).
11962
11963 2011-08-07 Juri Linkov <juri@jurta.org>
11964
11965 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11966 to show the arg `TIME' instead of `TIMEVAL'.
11967
11968 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11969
11970 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11971 display property strides EOL and includes a newline, as in
11972 longlines-mode. (Bug#9254)
11973 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11974 word-wrap under bidirectional display. (Bug#9224)
11975
11976 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11977 is non-zero, even if the data buffer is NULL. Fixes a crash in
11978 vertical-motion with longlines-mode. (Bug#9254)
11979
11980 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11981
11982 * bidi.c <bidi_cache_total_alloc>: Now static.
11983 (bidi_initialize): Initialize bidi_cache_total_alloc.
11984
11985 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11986 cache. (Bug#9221)
11987
11988 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11989 amount allocated this far in `bidi_cache_total_alloc'.
11990 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11991 non-zero, only free the data buffer without restoring the cache
11992 contents. All callers changed.
11993
11994 * dispextern.h (bidi_unshelve_cache): Update prototype.
11995
11996 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11997 (move_it_in_display_line, move_it_to)
11998 (move_it_vertically_backward, move_it_by_lines): Replace the call
11999 to xfree to an equivalent call to bidi_unshelve_cache.
12000 (move_it_in_display_line_to): Fix logic of returning
12001 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12002
12003 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12004
12005 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12006 came from a string character with a `cursor' property. (Bug#9229)
12007
12008 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12009
12010 * Makefile.in (LIB_PTHREAD): New variable.
12011 (LIBES): Add LIB_PTHREAD (Bug#9216).
12012
12013 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12014 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12015
12016 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12017
12018 * regex.c (re_iswctype): Remove some redundant boolean conversions.
12019
12020 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12021
12022 * xterm.c (x_find_topmost_parent): New function.
12023 (x_set_frame_alpha): Find topmost parent window with
12024 x_find_topmost_parent and set the property there also (bug#9181).
12025 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12026
12027 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12028
12029 * callproc.c (Fcall_process): Avoid vfork clobbering
12030 the local vars buffer, coding_systems, current_dir.
12031
12032 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12033
12034 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12035
12036 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12037
12038 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12039 so that it is not optimized away.
12040
12041 * xdisp.c (compute_display_string_pos): Remove unused local.
12042
12043 2011-08-02 Eli Zaretskii <eliz@gnu.org>
12044
12045 Fix slow cursor motion and scrolling in large buffers with
12046 selective display, like Org Mode buffers. (Bug#9218)
12047
12048 * dispextern.h (struct bidi_it): New member disp_prop_p.
12049
12050 * xdisp.c: Remove one-slot cache of display string positions.
12051 (compute_display_string_pos): Accept an additional argument
12052 DISP_PROP_P; callers changed. Scan at most 5K characters forward
12053 for a display string or property. If found, set DISP_PROP_P
12054 non-zero.
12055
12056 * bidi.c (bidi_fetch_char): Accept an additional argument
12057 DISP_PROP_P, and pass it to compute_display_string_pos.
12058 Only handle text covered by a display string if DISP_PROP_P is returned
12059 non-zero. All callers of bidi_fetch_char changed.
12060
12061 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12062
12063 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12064
12065 2010-12-03 Don March <don@ohspite.net>
12066
12067 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12068 last character M-[char] is translated to ESC [char] (bug#7541).
12069
12070 2011-08-02 Kenichi Handa <handa@m17n.org>
12071
12072 * lisp.h (uniprop_table): Extern it.
12073
12074 * chartab.c (uniprop_table): Make it non-static.
12075
12076 2011-08-01 Eli Zaretskii <eliz@gnu.org>
12077
12078 * xdisp.c (forward_to_next_line_start): Accept additional argument
12079 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12080 on the newline.
12081 (reseat_at_next_visible_line_start): Use the bidi iterator state
12082 returned by forward_to_next_line_start to restore the state of
12083 it->bidi_it after backing up to previous newline. (Bug#9212)
12084
12085 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12086
12087 * regex.c (re_comp): Protoize.
12088 (re_exec): Fix return type.
12089 (regexec): Fix type of `ret'. (Bug#9203)
12090
12091 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12092
12093 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12094 This is needed if max-image-size is a floating-point number.
12095
12096 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12097
12098 * print.c (print_object): Print empty symbol as ##.
12099
12100 * lread.c (read1): Read ## as empty symbol.
12101
12102 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12103
12104 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12105 setting frame foreground color (Bug#9175).
12106 (x_set_background_color): Likewise.
12107
12108 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12109 contents (Bug#9176).
12110 (EmacsTooltip -init): Remove bezels and add shadows to
12111 tooltip windows.
12112
12113 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12114 or scroll bar (Bug#8470).
12115
12116 * nsfont.m (nsfont_open): Remove assignment to voffset and
12117 unnecessary vars hshink, expand, hd, full_height, min_height.
12118 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12119
12120 * nsterm.h (nsfont_info): Remove voffset field.
12121
12122 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12123
12124 Implement strike-through and overline on NextStep (Bug#8863).
12125
12126 * nsfont.m (nsfont_open): Use underline position provided by font,
12127 instead of hard-coded value of 2.
12128 (nsfont_draw): Call ns_draw_text_decoration instead.
12129
12130 * nsterm.h: Add declaration for ns_draw_text_decoration.
12131
12132 * nsterm.m (ns_draw_text_decoration): New function for drawing
12133 underline, overline, and strike-through.
12134 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12135 ns_draw_text_decoration. Change treatment of cursor drawing to
12136 accommodate underlining, etc.
12137
12138 2011-07-28 Eli Zaretskii <eliz@gnu.org>
12139
12140 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12141 default.
12142
12143 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12144
12145 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12146 Without this fix, if a signal arrives just after memory fills up,
12147 'malloc' might be invoked reentrantly.
12148
12149 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12150 In other words, assume that every image size is allowed, on non-X
12151 hosts. This assumption is probably wrong, but it lets Emacs compile.
12152
12153 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12154
12155 * regex.c (re_iswctype): Convert return values to boolean.
12156
12157 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12158
12159 * xdisp.c (compute_display_string_pos): Don't use cached display
12160 string position if the buffer had its restriction changed.
12161 (Bug#9184)
12162
12163 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12164
12165 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12166
12167 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12168
12169 Integer signedness and overflow and related fixes. (Bug#9079)
12170
12171 * bidi.c: Integer size and overflow fixes.
12172 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12173 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12174 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12175 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12176 (bidi_find_other_level_edge):
12177 Use ptrdiff_t instead of EMACS_INT where either will do.
12178 This works better on 32-bit hosts configured --with-wide-int.
12179 (bidi_cache_ensure_space): Check for size-calculation overflow.
12180 Use % rather than repeated addition, for better worst-case speed.
12181 Don't set bidi_cache_size until after xrealloc returns, because it
12182 might not return.
12183 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12184 (bidi_cache_ensure_space): Also check that the bidi cache size
12185 does not exceed that of the largest Lisp string or buffer. See Eli
12186 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12187
12188 * alloc.c (__malloc_size_t): Remove.
12189 All uses replaced by size_t. See Andreas Schwab's note
12190 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12191
12192 * image.c: Improve checking for integer overflow.
12193 (check_image_size): Assume that f is nonnull, since
12194 it is always nonnull in practice. This is one less thing to
12195 worry about when checking for integer overflow later.
12196 (x_check_image_size): New function, which checks for integer
12197 overflow issues inside X.
12198 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12199 This removes the need for a memory_full check.
12200 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12201 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12202 (xbm_read_bitmap_data): Change locals back to 'int', since
12203 their values must fit in 'int'.
12204 (xpm_load_image, png_load, tiff_load):
12205 Invoke x_create_x_image_and_pixmap earlier,
12206 to avoid much needless work if the image is too large.
12207 (tiff_load): Treat overly large images as if
12208 x_create_x_image_and_pixmap failed, not as malloc failures.
12209 (gs_load): Use x_check_image_size.
12210
12211 * gtkutil.c: Omit integer casts.
12212 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12213 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12214
12215 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12216
12217 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12218 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12219 would wrongly return t on a 64-bit host.
12220
12221 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12222 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12223 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12224 and therefore cause GCC to emit a bogus diagnostic in some cases.
12225
12226 * image.c: Integer signedness and overflow and related fixes.
12227 This is not an exhaustive set of fixes, but it's time to
12228 record what I've got.
12229 (lookup_pixel_color, check_image_size): Remove redundant decls.
12230 (check_image_size): Don't assume that arbitrary EMACS_INT values
12231 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12232 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12233 (tiff_load, imagemagick_load_image):
12234 Check for overflow in size calculations.
12235 (x_create_x_image_and_pixmap): Remove unnecessary test for
12236 xmalloc returning NULL; that can't happen.
12237 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12238 (xpm_color_bucket): Use better integer hashing function.
12239 (xpm_cache_color): Don't possibly over-allocate memory.
12240 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12241 (gif_memory_source):
12242 Use ptrdiff_t, not int or size_t, to record sizes.
12243 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12244 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12245 either works, as we prefer signed integers.
12246 (tiff_read_from_memory, tiff_write_from_memory):
12247 Return tsize_t, not size_t, since that's what the TIFF API wants.
12248 (tiff_read_from_memory): Don't fail simply because the read would
12249 go past EOF; instead, return a short read.
12250 (tiff_load): Omit no-longer-needed casts.
12251 (Fimagemagick_types): Don't assume size fits into 'int'.
12252
12253 Improve hashing quality when configured --with-wide-int.
12254 * fns.c (hash_string): New function, taken from sxhash_string.
12255 Do not discard information about ASCII character case; this
12256 discarding is no longer needed.
12257 (sxhash-string): Use it. Change sig to match it. Caller changed.
12258 * lisp.h: Declare it.
12259 * lread.c (hash_string): Remove, since we now use fns.c's version.
12260 The fns.c version returns a wider integer if --with-wide-int is
12261 specified, so this should help the quality of the hashing a bit.
12262
12263 * emacs.c: Integer overflow minor fix.
12264 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12265 Define only if GNU_LINUX.
12266 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12267
12268 * dispnew.c: Integer signedness and overflow fixes.
12269 Remove unnecessary forward decls, that were a maintenance hassle.
12270 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12271 All uses changed.
12272 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12273 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12274 (prepare_desired_row, line_draw_cost):
12275 Use int, not unsigned, where either works.
12276 (save_current_matrix, restore_current_matrix):
12277 Use ptrdiff_t, not size_t, where either works.
12278 (init_display): Check for overflow more accurately, and without
12279 relying on undefined behavior.
12280
12281 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12282 Remove, replacing with the new symbols in lisp.h. All uses changed.
12283 * fileio.c (make_temp_name):
12284 * filelock.c (lock_file_1, lock_file):
12285 * xdisp.c (message_dolog):
12286 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12287 Use pMd etc. instead.
12288 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12289 replacing the pWIDE etc. symbols removed from editfns.c.
12290
12291 * keyboard.h (num_input_events): Now uintmax_t.
12292 This is (very slightly) less likely to mess up due to wraparound.
12293 All uses changed.
12294
12295 * buffer.c: Integer signedness fixes.
12296 (alloc_buffer_text, enlarge_buffer_text):
12297 Use ptrdiff_t rather than size_t when either will do, as we prefer
12298 signed integers.
12299
12300 * alloc.c: Integer signedness and overflow fixes.
12301 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12302 (__malloc_size_t): Default to size_t, not to int.
12303 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12304 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12305 Prefer ptrdiff_t to size_t when either would do, as we prefer
12306 signed integers.
12307 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12308 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12309 Now const. Initialize with values that are in range even if char
12310 is signed.
12311 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12312 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12313 These functions do the right thing with sizes > 2**32.
12314 (check_depth): Now ptrdiff_t, not int.
12315 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12316 Adjust to new way of storing sizes. Check for size overflow bugs
12317 in rest of code.
12318 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12319 slightly wrong anyway, as it missed one instance of
12320 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12321 (refill_memory_reserve): Omit needless cast to size_t.
12322 (mark_object_loop_halt): Mark as externally visible.
12323
12324 * xselect.c: Integer signedness and overflow fixes.
12325 (Fx_register_dnd_atom, x_handle_dnd_message):
12326 Use ptrdiff_t, not size_t, since we prefer signed.
12327 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12328 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12329 x_dnd_atoms_size and x_dnd_atoms_length.
12330
12331 * doprnt.c: Prefer signed to unsigned when either works.
12332 * eval.c (verror):
12333 * doprnt.c (doprnt):
12334 * lisp.h (doprnt):
12335 * xdisp.c (vmessage):
12336 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12337 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12338 prefer signed arithmetic to avoid comparison confusion.
12339 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12340 but is a bit tricky.
12341
12342 Assume freestanding C89 headers, string.h, stdlib.h.
12343 * data.c, doprnt.c, floatfns.c, print.c:
12344 Include float.h unconditionally.
12345 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12346 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12347 * regex.c: Likewise for stddef.h, string.h.
12348 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12349 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12350 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12351 (STDC_HEADERS): Remove obsolete defines.
12352 * sysdep.c: Include limits.h unconditionally.
12353
12354 Assume support for memcmp, memcpy, memmove, memset.
12355 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12356 * regex.c (memcmp, memcpy):
12357 Remove; we assume C89 now.
12358
12359 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12360 (__malloc_safe_bcopy): Remove; no longer needed.
12361
12362 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12363 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12364 well either way, and we prefer signed to unsigned.
12365
12366 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12367
12368 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12369 closes the connection while we're reading (bug#9182).
12370
12371 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12372
12373 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12374 are specified (Bug#9168).
12375
12376 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12377
12378 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12379 Found by GCC static checking and --with-wide-int on a 32-bit host.
12380
12381 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12382
12383 * xdisp.c (compute_display_string_pos): Fix logic of caching
12384 previous display string position. Initialize cached_prev_pos to
12385 -1. Fixes slow-down at the beginning of a buffer.
12386
12387 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12388
12389 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12390 for attrs[LFACE_FONTSET_INDEX].
12391
12392 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12393
12394 * xml.c (parse_region): Remove unused local
12395 that was recently introduced.
12396
12397 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12398
12399 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12400 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12401
12402 * xdisp.c (move_it_in_display_line_to): Record the best matching
12403 position for TO_CHARPOS while scanning the line, and restore it on
12404 exit if none of the characters scanned was an exact match.
12405 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12406 when exact match is impossible due to invisible text, and the
12407 lines are truncated.
12408
12409 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12410
12411 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12412 for OSX >= 10.7.
12413
12414 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12415
12416 Fix a significant slow-down of cursor motion with C-n, C-p,
12417 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12418 auto-repeat under bidi redisplay in fontified buffers.
12419 * xdisp.c (compute_stop_pos_backwards): New function.
12420 (next_element_from_buffer): Call compute_stop_pos_backwards to
12421 find a suitable prev_stop when we find ourselves before
12422 base_level_stop.
12423 (reseat): Don't look for prev_stop, as that could mean a very long
12424 run.
12425 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12426 <cached_disp_overlay_modiff>: Cache for last found display string
12427 position.
12428 (compute_display_string_pos): Return the cached position if asked
12429 about the same buffer in the same area of character positions, and
12430 the buffer wasn't changed since the time the display string
12431 position was cached.
12432
12433 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12434
12435 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12436 is an integer, which is important for empty lines. (Bug#9149)
12437
12438 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
12439
12440 * frame.c (Fmodify_frame_parameters): In tty case, update the
12441 default face if necessary (Bug#4238).
12442
12443 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
12444
12445 * editfns.c (Fstring_to_char): No need to explain what a character
12446 is in the docstring (Bug#6576).
12447
12448 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12449
12450 * xml.c (parse_region): Make sure we always return a tree.
12451
12452 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12453
12454 * xml.c (parse_region): If a document contains only comments,
12455 return that, too.
12456
12457 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12458
12459 * xml.c (make_dom): Return comments, too.
12460
12461 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12462
12463 Port to OpenBSD.
12464 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12465 and the surrounding thread.
12466 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12467 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12468 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12469 timer goes off.
12470 * s/openbsd.h (BROKEN_SIGIO): Define.
12471 * unexelf.c (unexec) [__OpenBSD__]:
12472 Don't update the .mdebug section of the Alpha COFF symbol table.
12473
12474 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12475
12476 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12477 (bug#8460).
12478
12479 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12480
12481 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12482 This fixes some race conditions on the permissions of any newly
12483 created file.
12484
12485 * alloc.c (valid_pointer_p): Use pipe, not open.
12486 This fixes some permissions issues when debugging.
12487
12488 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12489 If fchown fails to set both uid and gid, try to set just gid,
12490 as that is sometimes allowed. Adjust the file's mode to eliminate
12491 setuid or setgid bits that are inappropriate if fchown fails.
12492
12493 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12494
12495 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12496 to compare Lisp_Objects.
12497 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12498 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12499 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12500
12501 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12502
12503 * lread.c (read_integer): Unread even EOF character.
12504 (read1): Likewise. Properly record start position of symbol.
12505
12506 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12507 symbol character follows.
12508
12509 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12510
12511 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12512 This works around a problem with the previous change to Fcopy_file.
12513 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12514 and without this change, GCC might complain about discarding
12515 fchown's return value.
12516
12517 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
12518
12519 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12520
12521 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12522
12523 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12524
12525 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12526
12527 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12528 it's used from the C level.
12529
12530 * process.c: Use the same condition for POLL_FOR_INPUT in both
12531 keyboard.c and process.c (bug#1858).
12532
12533 2011-07-09 Lawrence Mitchell <wence@gmx.li>
12534
12535 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12536 (Fgnutls_boot): Use it.
12537
12538 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12539
12540 * doc.c (Fsubstitute_command_keys): Revert last change.
12541
12542 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12543
12544 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12545 quotes the next character, and doesn't affect other longer
12546 sequences (bug#8935).
12547
12548 * lread.c (syms_of_lread): Clarify that is isn't only
12549 `eval-buffer' and `eval-defun' that's affected by
12550 `lexical-binding' (bug#8460).
12551
12552 2011-07-15 Eli Zaretskii <eliz@gnu.org>
12553
12554 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12555 bidi redisplay when a line includes both an image and is truncated.
12556
12557 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12558
12559 Fix minor problems found by static checking.
12560 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12561 (elsz): Now a signed constant, not a size_t var. We prefer signed
12562 types to unsigned, to avoid integer comparison confusion. Without
12563 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12564 "cannot optimize loop, the loop counter may overflow", a symptom
12565 of the confusion.
12566 * indent.c (Fvertical_motion): Mark locals as initialized.
12567 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12568
12569 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12570
12571 * search.c (Fre_search_backward): Mention `case-fold-search' in
12572 all the re_search_* functions (bug#8138).
12573
12574 * keyboard.c (Fopen_dribble_file): Document when the file is
12575 closed (bug#8056).
12576
12577 2011-07-14 Eli Zaretskii <eliz@gnu.org>
12578
12579 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12580 bidi_cache_idx.
12581
12582 Support bidi reordering of display and overlay strings.
12583 * xdisp.c (compute_display_string_pos)
12584 (compute_display_string_end): Accept additional argument STRING.
12585 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12586 (reseat_to_string): Initialize bidi_it->string.s and
12587 bidi_it->string.schars.
12588 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12589 NULL (avoids a crash in bidi_paragraph_init).
12590 Initialize itb.string.lstring.
12591 (init_iterator): Call bidi_init_it only of a valid
12592 buffer position was specified. Initialize paragraph_embedding to
12593 L2R.
12594 (reseat_to_string): Initialize the bidi iterator.
12595 (display_string): If we need to ignore text properties of
12596 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12597 original value of -1 will not work with bidi.)
12598 (compute_display_string_pos): First arg is now struct
12599 `text_pos *'; all callers changed. Support display properties on
12600 Lisp strings.
12601 (compute_display_string_end): Support display properties on Lisp
12602 strings.
12603 (init_iterator, reseat_1, reseat_to_string): Initialize the
12604 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12605 when iterating on a string not from display properties).
12606 (compute_display_string_pos, compute_display_string_end):
12607 Fix calculation of the object to scan. Fixes an error when using
12608 arrow keys.
12609 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12610 base_level_stop; instead, set base_level_stop to BEGV.
12611 Fixes crashes in vertical-motion.
12612 (next_element_from_buffer): Improve commentary for when
12613 the iterator is before prev_stop.
12614 (init_iterator): Initialize bidi_p from the default value of
12615 bidi-display-reordering, not from buffer-local value. Use the
12616 buffer-local value only if initializing for buffer iteration.
12617 (handle_invisible_prop): Support invisible properties on strings
12618 that are being bidi-reordered.
12619 (set_iterator_to_next): Support bidi reordering of C strings and
12620 Lisp strings.
12621 (next_element_from_string): Support bidi reordering of Lisp
12622 strings.
12623 (handle_stop_backwards): Support Lisp strings as well.
12624 (display_string): Support display of R2L glyph rows.
12625 Use IT_STRING_CHARPOS when displaying from a Lisp string.
12626 (init_iterator): Don't initialize it->bidi_p for strings
12627 here.
12628 (reseat_to_string): Initialize it->bidi_p for strings here.
12629 (next_element_from_string, next_element_from_c_string)
12630 (next_element_from_buffer): Add xassert's for correspondence
12631 between IT's object being iterated and it->bidi_it.string
12632 structure.
12633 (face_before_or_after_it_pos): Support bidi iteration.
12634 (next_element_from_c_string): Handle the case of the first string
12635 character that is not the first one in the visual order.
12636 (get_visually_first_element): New function, refactored from common
12637 parts of next_element_from_buffer, next_element_from_string, and
12638 next_element_from_c_string.
12639 (tool_bar_lines_needed, redisplay_tool_bar)
12640 (display_menu_bar): Force left-to-right direction. Add a FIXME
12641 comment for making that be controlled by a user option.
12642 (push_it, pop_it): Save and restore the state of the
12643 bidi iterator. Save and restore the bidi_p flag.
12644 (pop_it): Iterate out of display property for string iteration as
12645 well.
12646 (iterate_out_of_display_property): Support iteration over strings.
12647 (handle_single_display_spec): Set up it->bidi_it for iteration
12648 over a display string, and call bidi_init_it.
12649 (handle_single_display_spec, next_overlay_string)
12650 (get_overlay_strings_1, push_display_prop): Set up the bidi
12651 iterator for displaying display or overlay strings.
12652 (forward_to_next_line_start): Don't use the shortcut if
12653 bidi-iterating.
12654 (back_to_previous_visible_line_start): If handle_display_prop
12655 pushed the iterator stack, restore the internal state of the bidi
12656 iterator by calling bidi_pop_it same number of times.
12657 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12658 and we are bidi-iterating, don't decrement the iterator position;
12659 instead, set the first_elt flag in the bidi iterator, to produce
12660 the same effect.
12661 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12662 (push_display_prop): xassert that we are iterating a buffer.
12663 (push_it, pop_it): Save and restore paragraph_embedding member.
12664 (handle_single_display_spec, next_overlay_string)
12665 (get_overlay_strings_1, reseat_1, reseat_to_string)
12666 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12667 correctly. Don't assume unibyte strings are not bidi-reordered.
12668 (compute_display_string_pos)
12669 (compute_display_string_end): Fix handling the case of C string.
12670 (push_it, pop_it): Save and restore from_disp_prop_p.
12671 (handle_single_display_spec, push_display_prop): Set the
12672 from_disp_prop_p flag.
12673 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12674 (pop_it): Call iterate_out_of_display_property only if we are
12675 popping after iteration over a string that came from a display
12676 property. Fix a typo in popping stretch info. Add an assertion
12677 for verifying that the iterator position is in sync with the bidi
12678 iterator.
12679 (handle_single_display_spec, get_overlay_strings_1)
12680 (push_display_prop): Fix initialization of paragraph direction for
12681 string when that of the parent object is not yet determined.
12682 (reseat_1): Call bidi_init_it to resync the bidi
12683 iterator with IT's position. (Bug#7616)
12684 (find_row_edges): If ROW->start.pos gives position
12685 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12686 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12687 Reset the from_disp_prop_p flag.
12688 (SAVE_IT, RESTORE_IT): New macros.
12689 (pos_visible_p, face_before_or_after_it_pos)
12690 (back_to_previous_visible_line_start)
12691 (move_it_in_display_line_to, move_it_in_display_line)
12692 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12693 (try_scrolling, redisplay_window, display_line): Use them when
12694 saving a temporary copy of the iterator and restoring it back.
12695 (back_to_previous_visible_line_start, reseat_1)
12696 (init_iterator): Empty the bidi cache "stack".
12697 (move_it_in_display_line_to): If iterator ended up at
12698 EOL, but we never saw any buffer positions smaller than
12699 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12700 motion in bidi-reordered lines.
12701 (move_it_in_display_line_to): Record prev_method and prev_pos
12702 immediately before the call to set_iterator_to_next. Fixes cursor
12703 motion in bidi-reordered lines with stretch glyphs and strings
12704 displayed in margins. (Bug#8133) (Bug#8867)
12705 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12706 TO_CHARPOS.
12707 (pos_visible_p): Support positions in bidi-reordered lines.
12708 Save and restore bidi cache.
12709
12710 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12711 (bidi_paragraph_info): Delete unused struct.
12712 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12713 (bidi_cache_start): New variable.
12714 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12715 to zero.
12716 (bidi_cache_fetch_state, bidi_cache_search)
12717 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12718 (bidi_cache_find, bidi_peek_at_next_level)
12719 (bidi_level_of_next_char, bidi_find_other_level_edge)
12720 (bidi_move_to_visually_next): Compare cache index with
12721 bidi_cache_start rather than with zero.
12722 (bidi_fetch_char): Accept new argument STRING; all callers
12723 changed. Support iteration over a string. Support strings with
12724 display properties. Support unibyte strings. Fix the type of
12725 `len' according to what STRING_CHAR_AND_LENGTH expects.
12726 (bidi_paragraph_init, bidi_resolve_explicit_1)
12727 (bidi_resolve_explicit, bidi_resolve_weak)
12728 (bidi_level_of_next_char, bidi_move_to_visually_next):
12729 Support iteration over a string.
12730 (bidi_set_sor_type, bidi_resolve_explicit_1)
12731 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12732 can now be zero (for strings); special values 0 and -1 were
12733 changed to -1 and -2, respectively.
12734 (bidi_char_at_pos): New function.
12735 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12736 Call it instead of FETCH_MULTIBYTE_CHAR.
12737 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12738 initialized to valid values.
12739 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12740 values.
12741 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12742 the test for valid cached positions. Fix the logic for looking up
12743 the sentinel state in the cache. GCPRO the Lisp string we are
12744 iterating.
12745 (bidi_push_it, bidi_pop_it): New functions.
12746 (bidi_initialize): Initialize the bidi cache start stack pointer.
12747 (bidi_cache_ensure_space): New function, refactored from part of
12748 bidi_cache_iterator_state. Don't assume the required size is just
12749 one BIDI_CACHE_CHUNK away.
12750 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12751 (bidi_count_bytes, bidi_char_at_pos): New functions.
12752 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12753 always valid if bidi_cache_idx is valid.
12754 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12755 is valid if it's going to be used.
12756 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12757 (bidi_cache_fetch_state, bidi_cache_search)
12758 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12759 (bidi_cache_iterator_state, bidi_cache_find)
12760 (bidi_find_other_level_edge, bidi_cache_start_stack):
12761 All variables related to cache indices are now EMACS_INT.
12762
12763 * dispextern.h (struct bidi_string_data): New structure.
12764 (struct bidi_it): New member `string'. Make flag members be 1-bit
12765 fields, and put them last in the struct.
12766 (compute_display_string_pos, compute_display_string_end):
12767 Update prototypes.
12768 (bidi_push_it, bidi_pop_it): Add prototypes.
12769 (struct iterator_stack_entry): New members bidi_p,
12770 paragraph_embedding, and from_disp_prop_p.
12771 (struct it): Member bidi_p is now a bit field 1 bit wide.
12772 (bidi_shelve_cache, bidi_unshelve_cache):
12773 Declare prototypes.
12774
12775 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12776 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12777 and vector-like objects.
12778
12779 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12780 cache around display iteration.
12781
12782 * window.c (Fwindow_end, window_scroll_pixel_based)
12783 (displayed_window_lines, Frecenter): Save and restore the bidi
12784 cache around display iteration.
12785
12786 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12787
12788 * editfns.c (Fdelete_region): Clarify the use of the named
12789 parameters (bug#6788).
12790
12791 2011-07-14 Martin Rudalics <rudalics@gmx.at>
12792
12793 * indent.c (Fvertical_motion): Set and restore w->pointm when
12794 saving and restoring the window's buffer (Bug#9006).
12795
12796 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12797
12798 * editfns.c (Fstring_to_char): Clarify just what is returned
12799 (bug#6576). Text by Eli Zaretskii.
12800
12801 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
12802
12803 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12804
12805 2011-07-13 Eli Zaretskii <eliz@gnu.org>
12806
12807 * buffer.c (mmap_find): Fix a typo.
12808
12809 2011-07-13 Johan Bockgård <bojohan@gnu.org>
12810
12811 Fix execution of x selection hooks.
12812 * xselect.c (Qx_lost_selection_functions)
12813 (Qx_sent_selection_functions): New vars.
12814 (syms_of_xselect): DEFSYM them.
12815 (x_handle_selection_request): Pass Qx_sent_selection_functions
12816 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12817 (x_handle_selection_clear,x_clear_frame_selections):
12818 Pass Qx_lost_selection_functions rather than
12819 Vx_lost_selection_functions to Frun_hook_with_args.
12820
12821 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12822
12823 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12824 The old code sometimes used this field without initializing it.
12825
12826 * alloc.c (gc_sweep): Don't read past end of array.
12827 In theory, the old code could also have corrupted Emacs internals,
12828 though it'd be very unlikely.
12829
12830 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12831
12832 * character.c (Fcharacterp): Don't advertise optional ignored
12833 argument. (Bug#4026)
12834
12835 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12836
12837 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12838 key" (bug#4257).
12839
12840 * window.c (Fset_window_start): Doc fix (bug#4199).
12841 (Fset_window_hscroll): Ditto.
12842
12843 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12844
12845 Fix minor new problems caught by GCC 4.6.1.
12846 * term.c (init_tty): Remove unused local.
12847 * xsettings.c (store_monospaced_changed): Define this function only
12848 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12849 not used otherwise.
12850
12851 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
12852
12853 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12854
12855 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12856
12857 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12858 are the mini-buffer and the echo area (bug#3320).
12859
12860 * term.c (init_tty): Remove support for supdup, c10 and perq
12861 terminals, which are no longer supported (bug#1482).
12862
12863 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12864
12865 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12866
12867 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12868
12869 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12870 for non-popups (Bug#3642).
12871
12872 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12873
12874 * alloc.c (reset_malloc_hooks): Protoize.
12875 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12876 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12877 * cm.c (losecursor): Likewise.
12878 * data.c (fmod): Likewise.
12879 * dispnew.c (swap_glyphs_in_rows): Likewise.
12880 * emacs.c (memory_warning_signal): Likewise.
12881 * floatfns.c (float_error): Likewise.
12882 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12883 (otf_open, font_otf_capability, generate_otf_features)
12884 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12885 Likewise.
12886 * image.c (pbm_read_file): Likewise.
12887 * indent.c (string_display_width): Likewise.
12888 * intervals.c (check_for_interval, search_for_interval)
12889 (inc_interval_count, count_intervals, root_interval)
12890 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12891 * lread.c (defalias): Likewise.
12892 * ralloc.c (r_alloc_check): Likewise.
12893 * regex.c (set_image_of_range_1, set_image_of_range)
12894 (regex_grow_registers): Likewise.
12895 * sysdep.c (strerror): Likewise.
12896 * termcap.c (valid_filename_p, tprint, main): Likewise.
12897 * tparam.c (main): Likewise.
12898 * unexhp9k800.c (run_time_remap, save_data_space)
12899 (update_file_ptrs, read_header, write_header, calculate_checksum)
12900 (copy_file, copy_rest, display_header): Likewise.
12901 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12902 Likewise.
12903 * xdisp.c (check_it): Likewise.
12904 * xfaces.c (register_color, unregister_color, unregister_colors):
12905 Likewise.
12906 * xfns.c (print_fontset_result): Likewise.
12907 * xrdb.c (member, fatal, main): Likewise.
12908
12909 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12910
12911 Fix minor problems found by static checking (Bug#9031).
12912 * chartab.c (char_table_set_range, map_sub_char_table):
12913 Remove unused locals.
12914 (uniprop_table): Now static.
12915 * composite.c (_work_char): Remove unused static var.
12916
12917 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12918
12919 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12920
12921 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12922
12923 * gtkutil.c (qttip_cb): Remove code without function.
12924
12925 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12926
12927 * w32.c (pthread_sigmask): New stub.
12928
12929 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12930
12931 Use pthread_sigmask, not sigprocmask (Bug#9010).
12932 sigprocmask is portable only for single-threaded applications, and
12933 Emacs can be multi-threaded when it uses GTK.
12934 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12935 (LIBES): Use it.
12936 * callproc.c (Fcall_process):
12937 * process.c (create_process):
12938 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12939 Use pthread_sigmask, not sigprocmask.
12940
12941 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12942
12943 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12944 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12945 wrong (Bug#8591).
12946
12947 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12948
12949 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12950 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12951 (xg_hide_tooltip): Fix comment.
12952
12953 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12954 in registerServicesMenuSendTypes.
12955 (validRequestorForSendType): Don't check ns_return_types.
12956
12957 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12958 ns_return_type.
12959
12960 2011-07-08 Jason Rumney <jasonr@gnu.org>
12961
12962 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12963 SH_SHOW for hidden windows (Bug#5482).
12964
12965 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12966 frame struct members of non-existent frames (Bug#6284).
12967
12968 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12969
12970 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12971 variable firstTime not needed on OSX >= 10.6.
12972 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12973 >= 10.5. Use setKnobProportion, setDoubleValue.
12974
12975 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12976 (MAC_OS_X_VERSION_10_5): Define if not defined.
12977 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12978 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12979 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12980
12981 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12982 cString and lossyCString on OSX >= 10.4.
12983
12984 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12985 sizeToFit on OSX >= 10.2.
12986
12987 * nsimage.m (allocInitFromFile): Don't use deprecated method
12988 bestRepresentationForDevice on OSX >= 10.6.
12989
12990 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12991 to avoid warning.
12992
12993 * emacs.c: Declare unexec_init_emacs_zone.
12994
12995 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12996
12997 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12998
12999 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13000 on svcsMenu (Bug#8842).
13001
13002 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13003 ns_return_types.
13004 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13005
13006 * nsterm.m (QUTF8_STRING): Declare.
13007 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13008 (validRequestorForSendType): Return type is (id).
13009 Change indexOfObjectIdenticalTo to indexOfObject.
13010 Check if we have local selection before returning self (Bug#8842).
13011 (writeSelectionToPasteboard): Put local selection into paste board
13012 if we have a local selection (Bug#8842).
13013 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13014
13015 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13016 (ns_get_local_selection): Declare.
13017
13018 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13019
13020 * keymap.c (describe_map_tree): Don't insert a double newline at
13021 the end of the buffer (bug#1169) and return whether we inserted
13022 something.
13023
13024 * callint.c (Fcall_interactively): Change "reading args" to
13025 "providing args" to try to clarify what it does (bug#1010).
13026
13027 2011-07-07 Kenichi Handa <handa@m17n.org>
13028
13029 * composite.c (composition_compute_stop_pos): Ignore a static
13030 composition starting before CHARPOS (Bug#8915).
13031
13032 * xdisp.c (handle_composition_prop): Likewise.
13033
13034 2011-07-07 Eli Zaretskii <eliz@gnu.org>
13035
13036 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13037 (Bug#9015)
13038
13039 2011-07-07 Kenichi Handa <handa@m17n.org>
13040
13041 * character.h (unicode_category_t): New enum type.
13042
13043 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13044 (Qchar_code_property_table): New variable.
13045 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13046 (UNIPROP_COMPRESSED_FORM_P): New macros.
13047 (char_table_ascii): Uncompress the compressed values.
13048 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13049 Uncompress the compressed values.
13050 (sub_char_table_ref_and_range): Likewise.
13051 (char_table_ref_and_range): Uncompress the compressed values.
13052 (sub_char_table_set): New arg is_uniprop. Callers changed.
13053 Uncompress the compressed values.
13054 (sub_char_table_set_range): Args changed. Callers changed.
13055 (char_table_set_range): Adjuted for the above change.
13056 (map_sub_char_table): Delete args default_val and parent. Add arg
13057 top. Give decoded values to a Lisp function.
13058 (map_char_table): Adjust for the above change. Give decoded
13059 values to a Lisp function. Gcpro more variables.
13060 (uniprop_table_uncompress)
13061 (uniprop_decode_value_run_length): New functions.
13062 (uniprop_decoder, uniprop_decoder_count): New variables.
13063 (uniprop_get_decoder, uniprop_encode_value_character)
13064 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13065 New functions.
13066 (uniprop_encoder, uniprop_encoder_count): New variables.
13067 (uniprop_get_encoder, uniprop_table)
13068 (Funicode_property_table_internal, Fget_unicode_property_internal)
13069 (Fput_unicode_property_internal): New functions.
13070 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13071 Sunicode_property_table_internal, Sget_unicode_property_internal,
13072 and Sput_unicode_property_internal. Defvar_lisp
13073 char-code-property-alist.
13074
13075 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13076 Vunicode_category_table.
13077
13078 * font.c (font_range): Adjust for the change of
13079 Vunicode_category_table.
13080
13081 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13082
13083 * m/iris4d.h: Remove file, move contents ...
13084 * s/irix6-5.h: ... here.
13085
13086 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13087
13088 Remove unportable assumption about struct layout (Bug#8884).
13089 * alloc.c (mark_buffer):
13090 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13091 (clone_per_buffer_values): Don't assume that
13092 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13093 This isn't true in general, and it's particularly not true
13094 if Emacs is configured with --with-wide-int.
13095 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13096 New macros, used in the buffer.c change.
13097
13098 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13099
13100 * xsettings.c: Use both GConf and GSettings if both are available.
13101 (store_config_changed_event): Add comment.
13102 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13103 (store_tool_bar_style_changed): New functions.
13104 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
13105 (struct xsettings): Move font inside HAVE_XFT.
13106 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13107 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13108 Move inside HAVE_XFT.
13109 (something_changed_gsettingsCB): Rename from something_changedCB.
13110 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13111 also.
13112 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13113 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
13114 (something_changed_gconfCB): Rename from something_changedCB.
13115 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13116 (parse_settings): Move check for font inside HAVE_XFT.
13117 (read_settings, apply_xft_settings): Add comment.
13118 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13119 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13120 call store_font_name_changed.
13121 (xft_settings_event): Add comment.
13122 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13123 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13124 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13125 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13126 (xsettings_initialize): Call init_gsettings last.
13127 (xsettings_get_system_font, xsettings_get_system_normal_font):
13128 Add comment.
13129
13130 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13131
13132 Random fixes. E.g., (random) never returned negative values.
13133 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13134 subseconds part to the entropy, as that's a bit more random.
13135 Prefer signed to unsigned, since the signedness doesn't matter and
13136 in general we prefer signed. When given a limit, use a
13137 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13138 latter isn't right if USE_2_TAGS_FOR_INTS.
13139 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13140 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13141
13142 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13143
13144 * textprop.c (text_property_stickiness):
13145 Obey Vtext_property_default_nonsticky.
13146 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13147 * w32fns.c (syms_of_w32fns):
13148 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13149
13150 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13151
13152 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13153 This is more efficient than Ffile_directory_p and avoids a minor race.
13154
13155 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13156
13157 * buffer.c (Foverlay_put): Say what the return value is
13158 (bug#7835).
13159
13160 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13161 is a directory before asking whether to use the file name
13162 (bug#7564).
13163 (barf_or_query_if_file_exists): Make the "File is a directory"
13164 error be more correct.
13165
13166 * fns.c (Frequire): Remove the mention of the .gz files, since
13167 that's installation-specific, but keep the mention of
13168 `get-load-suffixes'.
13169
13170 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13171
13172 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13173 Report string overflow if the output is too long.
13174
13175 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
13176
13177 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13178 (syms_of_gnutls): Remove duplicate DEFSYM for
13179 Qgnutls_bootprop_verify_hostname_error, an error for
13180 Qgnutls_bootprop_verify_error (which is no longer used).
13181
13182 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13183 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13184 Also (re)move comments that are misplaced or no longer relevant.
13185
13186 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13187
13188 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13189
13190 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
13191
13192 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13193 and background color parameters if they have been changed.
13194
13195 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13196
13197 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13198
13199 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13200
13201 * xsettings.c (SYSTEM_FONT): Define only when used.
13202 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13203
13204 * keymap.c (access_keymap_1): Now static.
13205
13206 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
13207
13208 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13209 leave any prefix arg for the up event (Bug#1586).
13210
13211 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13212
13213 * lread.c (syms_of_lread): Mention single symbols defined by
13214 `defvar' or `defconst' (bug#7154).
13215
13216 * fns.c (Frequire): Mention .el.gz files (bug#7314).
13217 (Frequire): Mention get-load-suffixes.
13218
13219 2011-07-02 Martin Rudalics <rudalics@gmx.at>
13220
13221 * window.h (window): Remove clone_number slot.
13222 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13223 Remove.
13224 (make_parent_window, make_window, saved_window)
13225 (Fset_window_configuration, save_window_save): Don't deal with
13226 clone numbers.
13227 * buffer.c (Qclone_number): Remove declaration.
13228 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13229
13230 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13231
13232 Add multiple inheritance to keymaps.
13233 * keymap.c (Fmake_composed_keymap): New function.
13234 (Fset_keymap_parent): Simplify.
13235 (fix_submap_inheritance): Remove.
13236 (access_keymap_1): New function extracted from access_keymap to handle
13237 embedded parents and handle lists of maps.
13238 (access_keymap): Use it.
13239 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13240 (Fcopy_keymap): Handle embedded parents.
13241 (Fcommand_remapping, define_as_prefix): Simplify.
13242 (Fkey_binding): Simplify.
13243 (syms_of_keymap): Move minibuffer-local-completion-map,
13244 minibuffer-local-filename-completion-map,
13245 minibuffer-local-must-match-map, and
13246 minibuffer-local-filename-must-match-map to Elisp.
13247 (syms_of_keymap): Defsubr make-composed-keymap.
13248 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13249 (parse_menu_item): Trivial simplification.
13250
13251 2011-07-01 Glenn Morris <rgm@gnu.org>
13252
13253 * Makefile.in (SETTINGS_LIBS): Fix typo.
13254
13255 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13256
13257 * coding.c (Fencode_coding_string): Record the last coding system
13258 used, as the function doc string says (bug#8738).
13259
13260 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13261
13262 * xsettings.c (store_monospaced_changed): Take new font as arg and
13263 check for change against current_mono_font.
13264 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13265 (emacs_settings_constructor, emacs_settings_get_property)
13266 (emacs_settings_set_property, emacs_settings_class_init)
13267 (emacs_settings_init, gsettings_obj): Remove.
13268 (something_changedCB): New function for HAVE_GSETTINGS.
13269 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13270 with value as argument.
13271 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13272 g_settings_new (Bug#8967). Do not create gsettings_obj.
13273 Remove calls to g_settings_bind. Connect something_changedCB to
13274 "changed".
13275
13276 * xgselect.c: Add defined (HAVE_GSETTINGS).
13277 (xgselect_initialize): Ditto.
13278
13279 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13280 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13281 xg_select.
13282
13283 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13284
13285 * eval.c (struct backtrace): Simplify and port the data structure.
13286 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13287 signed bit field, as this assumption is not portable and it makes
13288 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13289 "char debug_on_exit : 1" as this is not portable either; instead,
13290 use the portable "unsigned int debug_on_exit : 1". Remove unused
13291 member evalargs. Remove obsolete comments about cc bombing out.
13292
13293 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13294
13295 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
13296 Let HAVE_GSETTINGS override HAVE_GCONF.
13297 (store_monospaced_changed): New function.
13298 (EMACS_SETTINGS): A new type derived from GObject to handle
13299 GSettings notifications.
13300 (emacs_settings_constructor, emacs_settings_get_property)
13301 (emacs_settings_set_property, emacs_settings_class_init):
13302 New functions.
13303 (gsettings_client, gsettings_obj): New variables.
13304 (GSETTINGS_SCHEMA): New define.
13305 (something_changedCB): Call store_monospaced_changed.
13306 (init_gsettings): New function.
13307 (xsettings_initialize): Call init_gsettings.
13308 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13309 to NULL.
13310
13311 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13312 GCONF_CFLAGS/LIBS.
13313
13314 2011-06-29 Martin Rudalics <rudalics@gmx.at>
13315
13316 * window.c (resize_root_window, grow_mini_window)
13317 (shrink_mini_window): Rename Qresize_root_window to
13318 Qwindow_resize_root_window and Qresize_root_window_vertically to
13319 Qwindow_resize_root_window_vertically.
13320
13321 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13322
13323 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13324
13325 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
13326
13327 * makefile.w32-in: Redesign dependencies so they reflect more
13328 clearly which files are directly included by each source file,
13329 and not through other includes.
13330
13331 2011-06-27 Martin Rudalics <rudalics@gmx.at>
13332
13333 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13334 (sort_overlays, overlay_strings): When an overlay's clone number
13335 matches the window's clone number process the overlay even if
13336 the overlay's window property doesn't match the current window.
13337
13338 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13339 (Fwindow_hchild): Rename to Fwindow_left_child.
13340 (Fwindow_next): Rename to Fwindow_next_sibling.
13341 (Fwindow_prev): Rename to Fwindow_prev_sibling.
13342 (resize_window_check): Rename to window_resize_check.
13343 (resize_window_apply): Rename to window_resize_apply.
13344 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13345 (Fdelete_other_windows_internal, resize_frame_windows)
13346 (Fsplit_window_internal, Fdelete_window_internal)
13347 (grow_mini_window, shrink_mini_window)
13348 (Fresize_mini_window_internal): Fix callers accordingly.
13349
13350 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13351
13352 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13353 (emacs_fixed_set_min_size): Remove.
13354 (emacs_fixed_new): Take frame as argument.
13355
13356 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13357 (_EmacsFixedPrivate): Remove minwidth/height.
13358 Add struct frame *f.
13359 (emacs_fixed_init): Initialize priv->f.
13360 (get_parent_class, emacs_fixed_set_min_size): Remove.
13361 (emacs_fixed_new): Set priv->f to argument.
13362 (emacs_fixed_get_preferred_width)
13363 (emacs_fixed_get_preferred_height): Use min_width/height from
13364 frames size_hint to set minimum and natural (Bug#8919).
13365 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13366 and use min_width/height from frames size_hint to set
13367 min_width/height (Bug#8919).
13368
13369 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13370 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13371 Fix indentation.
13372
13373 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13374
13375 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13376 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13377 called at ZV.
13378
13379 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13380
13381 * process.c (wait_reading_process_output): Bypass select if
13382 waiting for a cell while ignoring keyboard input, and input is
13383 pending. Suggested by Jan Djärv (Bug#8869).
13384
13385 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13386
13387 Use gnulib's dup2 module instead of rolling our own.
13388 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13389
13390 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13391
13392 * dispnew.c (scrolling_window): Before scrolling, turn off a
13393 mouse-highlight in the window being scrolled.
13394
13395 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13396
13397 Move DEFSYM to lisp.h and use everywhere.
13398
13399 * character.h (DEFSYM): Move declaration...
13400 * lisp.h (DEFSYM): ...here.
13401
13402 * gnutls.c:
13403 * minibuf.c:
13404 * w32menu.c:
13405 * w32proc.c:
13406 * w32select.c: Don't include character.h.
13407
13408 * alloc.c (syms_of_alloc):
13409 * buffer.c (syms_of_buffer):
13410 * bytecode.c (syms_of_bytecode):
13411 * callint.c (syms_of_callint):
13412 * casefiddle.c (syms_of_casefiddle):
13413 * casetab.c (init_casetab_once):
13414 * category.c (init_category_once, syms_of_category):
13415 * ccl.c (syms_of_ccl):
13416 * cmds.c (syms_of_cmds):
13417 * composite.c (syms_of_composite):
13418 * dbusbind.c (syms_of_dbusbind):
13419 * dired.c (syms_of_dired):
13420 * dispnew.c (syms_of_display):
13421 * doc.c (syms_of_doc):
13422 * editfns.c (syms_of_editfns):
13423 * emacs.c (syms_of_emacs):
13424 * eval.c (syms_of_eval):
13425 * fileio.c (syms_of_fileio):
13426 * fns.c (syms_of_fns):
13427 * frame.c (syms_of_frame):
13428 * fringe.c (syms_of_fringe):
13429 * insdel.c (syms_of_insdel):
13430 * keymap.c (syms_of_keymap):
13431 * lread.c (init_obarray, syms_of_lread):
13432 * macros.c (syms_of_macros):
13433 * msdos.c (syms_of_msdos):
13434 * print.c (syms_of_print):
13435 * process.c (syms_of_process):
13436 * search.c (syms_of_search):
13437 * sound.c (syms_of_sound):
13438 * syntax.c (init_syntax_once, syms_of_syntax):
13439 * terminal.c (syms_of_terminal):
13440 * textprop.c (syms_of_textprop):
13441 * undo.c (syms_of_undo):
13442 * w32.c (globals_of_w32):
13443 * window.c (syms_of_window):
13444 * xdisp.c (syms_of_xdisp):
13445 * xfaces.c (syms_of_xfaces):
13446 * xfns.c (syms_of_xfns):
13447 * xmenu.c (syms_of_xmenu):
13448 * xsettings.c (syms_of_xsettings):
13449 * xterm.c (syms_of_xterm): Use DEFSYM.
13450
13451 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13452
13453 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13454
13455 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13456
13457 Integer and buffer overflow fixes (Bug#8873).
13458
13459 * print.c (printchar, strout): Check for string overflow.
13460 (PRINTPREPARE, printchar, strout):
13461 Don't set size unless allocation succeeds.
13462
13463 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13464 for sizes. Check for string overflow more accurately.
13465 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13466
13467 * macros.c: Integer and buffer overflow fixes.
13468 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13469 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13470 Use ptrdiff_t, not int, for sizes.
13471 Don't increment bufsize until after realloc succeeds.
13472 Check for size-calculation overflow.
13473 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13474
13475 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13476
13477 * lread.c: Integer overflow fixes.
13478 (read_integer): Radix is now EMACS_INT, not int,
13479 to improve quality of diagnostics for out-of-range radices.
13480 Calculate buffer size correctly for out-of-range radices.
13481 (read1): Check for integer overflow in radices, and in
13482 read-circle numbers.
13483 (read_escape): Avoid int overflow.
13484 (Fload, openp, read_buffer_size, read1)
13485 (substitute_object_recurse, read_vector, read_list, map_obarray):
13486 Use ptrdiff_t, not int, for sizes.
13487 (read1): Use EMACS_INT, not int, for sizes.
13488 Check for size overflow.
13489
13490 * image.c (cache_image): Check for size arithmetic overflow.
13491
13492 * lread.c: Integer overflow issues.
13493 (saved_doc_string_size, saved_doc_string_length)
13494 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13495 Now ptrdiff_t, not int.
13496 (read1): Don't assume doc string length fits in int. Check for
13497 out-of-range doc string lengths.
13498 (read_list): Don't assume file position fits in int.
13499 (read_escape): Check for hex character overflow.
13500
13501 2011-06-22 Leo Liu <sdl.web@gmail.com>
13502
13503 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13504 Move to minibuffer.el.
13505
13506 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13507
13508 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13509 The following patches are for when GLYPH_DEBUG && !XASSERT.
13510 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13511 * dispnew.c (flush_stdout):
13512 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13513 Mark as externally visible.
13514 * dispnew.c (check_window_matrix_pointers): Now static.
13515 * dispnew.c (window_to_frame_vpos):
13516 * xfns.c (unwind_create_frame):
13517 * xterm.c (x_check_font): Remove unused local.
13518 * scroll.c (CHECK_BOUNDS):
13519 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13520 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13521 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13522 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13523 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13524 Now static.
13525 (debug_method_add): Use va_list and vsprintf rather than relying
13526 on undefined behavior with wrong number of arguments.
13527 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13528 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13529 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13530 since we're not interested in debugging glyphs with old libraries.
13531 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13532 GCC 4.6.0's static checking.
13533
13534 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13535
13536 Integer overflow and signedness fixes (Bug#8873).
13537 A few related buffer overrun fixes, too.
13538
13539 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13540
13541 * dispextern.h (struct face.stipple):
13542 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13543 (x_bitmap_mask, x_allocate_bitmap_record)
13544 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13545 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13546 (x_create_bitmap_from_xpm_data):
13547 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13548 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13549 (.bitmaps_last):
13550 * xfaces.c (load_pixmap):
13551 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13552 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13553 (.bitmaps_last, struct x_output.icon_bitmap):
13554 Use ptrdiff_t, not int, for bitmap indexes.
13555 (x_allocate_bitmap_record): Check for size overflow.
13556 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13557
13558 Use ptrdiff_t, not int, for overlay counts.
13559 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13560 * editfns.c (overlays_around, get_pos_property):
13561 * textprop.c (get_char_property_and_overlay):
13562 * xdisp.c (next_overlay_change, note_mouse_highlight):
13563 * xfaces.c (face_at_buffer_position):
13564 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13565 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13566 (Fnext_overlay_change, Fprevious_overlay_change)
13567 (mouse_face_overlay_overlaps, Foverlays_in):
13568 Use ptrdiff_t, not int, for sizes.
13569 (overlays_at, overlays_in): Check for size-calculation overflow.
13570
13571 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13572
13573 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13574 (x_session_initialize): Do not assume string length fits in int.
13575
13576 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13577 This is unlikely, but can occur if DPI is outlandish.
13578
13579 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13580 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13581
13582 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13583 * xrdb.c (magic_file_p, search_magic_path):
13584 Omit last arg SUFFIX; it was always 0. All callers changed.
13585 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13586
13587 * xfont.c (xfont_match): Avoid need for strlen.
13588
13589 * xfns.c: Don't assume strlen fits in int.
13590 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13591
13592 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13593 not unsigned long, as we prefer signed integers. All callers changed.
13594 Detect integer overflow in repeat count.
13595 (message_dolog): Don't assume print length fits in 39 bytes.
13596 (display_mode_element): Don't assume strlen fits in int.
13597
13598 * termcap.c: Don't assume sizes fit in int and never overflow.
13599 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13600 (gobble_line): Check for size-calculation overflow.
13601
13602 * minibuf.c (Fread_buffer):
13603 * lread.c (intern, intern_c_string):
13604 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13605 Don't assume string length fits in int.
13606
13607 * keyboard.c (parse_tool_bar_item):
13608 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13609
13610 * font.c: Don't assume string length fits in int.
13611 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13612 Use ptrdiff_t, not int.
13613 (font_intern_prop): Don't assume string length fits in int.
13614 Don't assume integer property fits in fixnum.
13615 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13616
13617 * filelock.c: Fix some buffer overrun and integer overflow issues.
13618 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13619 Reformulate so as not to need the command string.
13620 Invoke gzip -cd rather than gunzip, as it's more portable.
13621 (lock_info_type, lock_file_1, lock_file):
13622 Don't assume pid_t and time_t fit in unsigned long.
13623 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13624 (current_lock_owner): Prefer signed type for sizes.
13625 Use memcpy, not strncpy, where memcpy is what is really wanted.
13626 Don't assume (via atoi) that time_t and pid_t fit in int.
13627 Check for time_t and/or pid_t out of range, e.g., via a network share.
13628 Don't alloca where an auto var works fine.
13629
13630 * fileio.c: Fix some integer overflow issues.
13631 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13632 Don't assume string length fits in int.
13633 (directory_file_name): Don't assume string length fits in long.
13634 (make_temp_name): Don't assume pid fits in int, or that its print
13635 length is less than 20.
13636
13637 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13638
13639 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13640
13641 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13642
13643 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13644 We prefer signed integers, even for size calculations.
13645
13646 * emacs.c: Don't assume string length fits in 'int'.
13647 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13648 (main): Don't invoke strlen when not needed.
13649
13650 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13651 (XD_DEBUG_MESSAGE): Don't waste a byte.
13652
13653 * callproc.c (getenv_internal_1, getenv_internal)
13654 (Fgetenv_internal):
13655 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13656
13657 * lread.c (invalid_syntax): Omit length argument.
13658 All uses changed. This doesn't fix a bug, but it simplifies the
13659 code away from its former Hollerith-constant appearance, and it's
13660 one less 'int' to worry about when looking at integer-overflow issues.
13661 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13662
13663 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13664 This didn't break anything, but it didn't help either.
13665 It's confusing to put a bogus integer in a place where the actual
13666 value does not matter.
13667 (LIST_END_P): Remove unused macro and its bogus comment.
13668 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13669
13670 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13671 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13672 implementation.
13673 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13674 We prefer signed types, and the value cannot exceed the EMACS_INT
13675 range anyway (because otherwise the length would not be representable).
13676 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13677 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13678 This avoids a GCC warning when WIDE_EMACS_INT.
13679
13680 * indent.c (sane_tab_width): New function.
13681 (current_column, scan_for_column, Findent_to, position_indentation)
13682 (compute_motion): Use it. This is just for clarity.
13683 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13684
13685 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13686
13687 * lisp.h (lint_assume): New macro.
13688 * composite.c (composition_gstring_put_cache):
13689 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13690
13691 * editfns.c, insdel.c:
13692 Omit unnecessary forward decls, to simplify future changes.
13693
13694 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13695
13696 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13697
13698 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13699 Use much-faster test for byte-length change.
13700 Don't assume string byte-length fits in 'int'.
13701 Check that character arg fits in 'int'.
13702 (mapcar1): Declare byte as byte, for clarity.
13703
13704 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13705
13706 * fns.c (concat): Catch string overflow earlier.
13707 Do not rely on integer wraparound.
13708
13709 * dispextern.h (struct it.overlay_strings_charpos)
13710 (struct it.selective): Now EMACS_INT, not int.
13711 * xdisp.c (forward_to_next_line_start)
13712 (back_to_previous_visible_line_start)
13713 (reseat_at_next_visible_line_start, next_element_from_buffer):
13714 Don't arbitrarily truncate the value of 'selective' to int.
13715
13716 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13717
13718 * composite.c: Don't truncate sizes to 'int'.
13719 (composition_gstring_p, composition_reseat_it)
13720 (composition_adjust_point): Use EMACS_INT, not int.
13721 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13722 not EMACS_UINT, for indexes.
13723
13724 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13725
13726 * buffer.c: Include <verify.h>.
13727 (struct sortvec.priority, struct sortstr.priority):
13728 Now EMACS_INT, not int.
13729 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13730 (struct sortstr.size, record_overlay_string)
13731 (struct sortstrlist.size, struct sortlist.used):
13732 Don't truncate size to int.
13733 (record_overlay_string): Check for size-calculation overflow.
13734 (init_buffer_once): Check at compile-time, not run-time.
13735
13736 2011-06-22 Jim Meyering <meyering@redhat.com>
13737
13738 Don't leak an XBM-image-sized buffer
13739 * image.c (xbm_load): Free the image buffer after using it.
13740
13741 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13742
13743 Port to Sun C.
13744 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13745 that Sun C diagnosed.
13746 * fns.c (secure_hash): Fix pointer signedness issue.
13747 * intervals.c (static_offset_intervals): New function.
13748 (offset_intervals): Use it.
13749
13750 2011-06-21 Leo Liu <sdl.web@gmail.com>
13751
13752 * deps.mk (fns.o):
13753 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13754 sha512.h.
13755
13756 * fns.c (secure_hash): Rename from crypto_hash_function and change
13757 the first arg to accept symbols.
13758 (Fsecure_hash): New primitive.
13759 (syms_of_fns): New symbols.
13760
13761 2011-06-20 Deniz Dogan <deniz@dogan.se>
13762
13763 * process.c (Fset_process_buffer): Clarify return value in
13764 docstring.
13765
13766 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
13767
13768 * dispnew.c (add_window_display_history): Use BVAR.
13769
13770 * xdisp.c (debug_method_add): Use BVAR.
13771 (check_window_end, dump_glyph_matrix, dump_glyph)
13772 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13773
13774 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13775 Likewise.
13776
13777 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13778 check till after the cache is created in init_frame_faces.
13779
13780 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13781
13782 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13783
13784 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13785
13786 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13787 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13788 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13789
13790 Improve buffer-overflow checking (Bug#8873).
13791 * fileio.c (Finsert_file_contents):
13792 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13793 Remove the old (too-loose) buffer overflow checks.
13794 They weren't needed, since make_gap checks for buffer overflow.
13795 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13796 The old code merely checked for Emacs fixnum overflow, and relied
13797 on undefined (wraparound) behavior. The new code avoids undefined
13798 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13799
13800 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13801 Tune. Don't use wider integers than needed. Don't use alloca.
13802 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13803
13804 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13805
13806 * insdel.c, lisp.h (buffer_overflow): New function.
13807 (insert_from_buffer_1, replace_range, replace_range_2):
13808 * insdel.c (make_gap_larger):
13809 * editfns.c (Finsert_char):
13810 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13811
13812 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13813
13814 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13815
13816 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13817
13818 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13819 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13820
13821 * fileio.c: Don't assume EMACS_INT fits in off_t.
13822 (emacs_lseek): New static function.
13823 (Finsert_file_contents, Fwrite_region): Use it.
13824 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13825
13826 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13827
13828 * fns.c: Don't overflow int when computing a list length.
13829 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13830 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13831 truncation on 64-bit hosts. Check for QUIT every
13832 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13833 faster and is responsive enough.
13834 (Flength): Report an error instead of overflowing an integer.
13835 (Fsafe_length): Return a float if the value is not representable
13836 as a fixnum. This shouldn't happen except in contrived situations.
13837 (Fnthcdr, Fsort): Don't assume list length fits in int.
13838 (Fcopy_sequence): Don't assume vector length fits in int.
13839
13840 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13841 (header_size, word_size): New constants.
13842 (allocate_vectorlike): Don't check size overflow here.
13843 (allocate_vector): Check it here instead, since this is the only
13844 caller of allocate_vectorlike that could cause overflow.
13845 Check that the new vector's length is representable as a fixnum.
13846
13847 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13848 The previous code was bogus. For example, next_almost_prime (32)
13849 returned 39, which is undesirable as it is a multiple of 3; and
13850 next_almost_prime (24) returned 25, which is a multiple of 5 so
13851 why was the code bothering to check for multiples of 7?
13852
13853 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13854
13855 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13856
13857 Variadic C functions now count arguments with ptrdiff_t.
13858 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13859 Back then I didn't know that the Emacs coding style prefers signed int.
13860 Also, in the meantime I found a few more instances where arguments
13861 were being counted with int, which may truncate counts on 64-bit
13862 machines, or EMACS_INT, which may be unnecessarily wide.
13863 * lisp.h (struct Lisp_Subr.function.aMANY)
13864 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13865 Arg counts are now ptrdiff_t, not size_t.
13866 All variadic functions and their callers changed accordingly.
13867 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13868 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13869 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13870 * callint.c (Fcall_interactively): Check arg count for overflow,
13871 to avoid potential buffer overrun. Use signed char, not 'int',
13872 for 'varies' array, so that we needn't bother to check its size
13873 calculation for overflow.
13874 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13875 * eval.c (apply_lambda):
13876 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13877 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13878 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13879
13880 * callint.c (Fcall_interactively): Don't use index var as event count.
13881
13882 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13883 * mem-limits.h (SIZE): Remove; no longer used.
13884
13885 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13886
13887 Remove unnecessary casts.
13888 * xterm.c (x_term_init):
13889 * xfns.c (x_set_border_pixel):
13890 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13891 These aren't needed now that we assume ANSI C.
13892
13893 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13894 It's more likely to cause problems (due to unsigned overflow)
13895 than to cure them.
13896
13897 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13898
13899 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13900
13901 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13902
13903 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13904
13905 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13906
13907 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13908
13909 GLYPH_CODE_FACE returns EMACS_INT, not int.
13910 * dispextern.h (merge_faces):
13911 * xfaces.c (merge_faces):
13912 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13913 Don't assume EMACS_INT fits in int.
13914
13915 * character.h (CHAR_VALID_P): Remove unused parameter.
13916 * fontset.c, lisp.h, xdisp.c: All uses changed.
13917
13918 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13919
13920 * fns.c (concat): Minor tuning based on overflow analysis.
13921 This doesn't fix any bugs. Use int to hold character, instead
13922 of constantly refetching from Emacs object. Use XFASTINT, not
13923 XINT, for value known to be a character. Don't bother comparing
13924 a single byte to 0400, as it's always less.
13925
13926 * floatfns.c (Fexpt):
13927 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13928
13929 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13930 for characters.
13931
13932 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13933
13934 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13935 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13936 incorrectly succeed when S was a string, because 4294967386 was
13937 truncated before it was used.
13938
13939 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13940 Otherwise, an out-of-range integer could cause undefined behavior
13941 on a 64-bit host.
13942
13943 * composite.c: Use int, not EMACS_INT, for characters.
13944 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13945 EMACS_INT, for values that are known to be in character range.
13946 This doesn't fix any bugs but is the usual style inside Emacs and
13947 may generate better code on 32-bit machines.
13948
13949 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13950 This is for reasons similar to the recent CHAR_STRING fix.
13951 * charset.c (Fencode_char): Check that character arg is actually
13952 a character. Pass an int to ENCODE_CHAR.
13953 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13954 wider than 'int', as a compile-time check to prevent future regressions
13955 in this area.
13956
13957 * character.c (char_string): Remove unnecessary casts.
13958
13959 Make sure a 64-bit char is never passed to CHAR_STRING.
13960 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13961 by silently ignoring the top 32 bits, allowing some values
13962 that were far too large to be valid characters.
13963 * character.h: Include <verify.h>.
13964 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13965 arguments are no wider than unsigned, as a compile-time check
13966 to prevent future regressions in this area.
13967 * data.c (Faset):
13968 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13969 (Fsubst_char_in_region):
13970 * fns.c (concat):
13971 * xdisp.c (decode_mode_spec_coding):
13972 Adjust to CHAR_STRING's new requirement.
13973 * editfns.c (Finsert_char, Fsubst_char_in_region):
13974 * fns.c (concat): Check that character args are actually
13975 characters. Without this test, these functions did the wrong
13976 thing with wildly out-of-range values on 64-bit hosts.
13977
13978 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13979 These casts should not be needed on 32-bit hosts, either.
13980 * keyboard.c (read_char):
13981 * lread.c (Fload): Remove casts to unsigned.
13982
13983 * lisp.h (UNSIGNED_CMP): New macro.
13984 This fixes comparison bugs on 64-bit hosts.
13985 (ASCII_CHAR_P): Use it.
13986 * casefiddle.c (casify_object):
13987 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13988 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13989 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13990 * dispextern.h (FACE_FROM_ID):
13991 * keyboard.c (read_char): Use UNSIGNED_CMP.
13992
13993 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13994 not to EMACS_INT, to avoid GCC warning.
13995
13996 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13997
13998 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13999 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14000 isn't needed on 32-bit machines.
14001
14002 * buffer.c (Fgenerate_new_buffer_name):
14003 Use EMACS_INT for count, not int.
14004 (advance_to_char_boundary): Return EMACS_INT, not int.
14005
14006 * data.c (Qcompiled_function): Now static.
14007
14008 * window.c (window_body_lines): Now static.
14009
14010 * image.c (gif_load): Rename local to avoid shadowing.
14011
14012 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14013 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14014 * alloc.c (make_save_value): Integer argument is now of type
14015 ptrdiff_t, not int.
14016 (mark_object): Use ptrdiff_t, not int.
14017 * lisp.h (pD): New macro.
14018 * print.c (print_object): Use it.
14019
14020 * alloc.c: Use EMACS_INT, not int, to count objects.
14021 (total_conses, total_markers, total_symbols, total_vector_size)
14022 (total_free_conses, total_free_markers, total_free_symbols)
14023 (total_free_floats, total_floats, total_free_intervals)
14024 (total_intervals, total_strings, total_free_strings):
14025 Now EMACS_INT, not int. All uses changed.
14026 (Fgarbage_collect): Compute overall total using a double, so that
14027 integer overflow is less likely to be a problem. Check for overflow
14028 when converting back to an integer.
14029 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14030 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14031 These were 'int' variables that could overflow on 64-bit hosts;
14032 they were never used, so remove them instead of repairing them.
14033 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14034 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14035 Previously, this ceilinged at INT_MAX, but that doesn't work on
14036 64-bit machines.
14037 (allocate_pseudovector): Don't use EMACS_INT when int would do.
14038
14039 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14040 (allocate_vectorlike): Check for ptrdiff_t overflow.
14041 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14042 when a (possibly-narrower) signed value would do just as well.
14043 We prefer using signed arithmetic, to avoid comparison confusion.
14044
14045 * alloc.c: Catch some string size overflows that we were missing.
14046 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14047 for convenience in STRING_BYTES_MAX.
14048 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14049 The definition here is exact; the one in lisp.h was approximate.
14050 (allocate_string_data): Check for string overflow. This catches
14051 some instances we weren't catching before. Also, it catches
14052 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14053 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14054 and ptrdiff_t and EMACS_INT are both 64 bits.
14055
14056 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14057 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14058 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14059
14060 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14061
14062 * alloc.c (Fmake_string): Check for out-of-range init.
14063
14064 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14065
14066 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14067
14068 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14069
14070 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14071 xg_get_default_scrollbar_width.
14072
14073 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14074 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14075 (style_changed_cb): Call update_theme_scrollbar_width and call
14076 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14077 all frames (Bug#8505).
14078 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14079 Call gtk_window_set_resizable if HAVE_GTK3.
14080 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14081 and height if HAVE_GTK3 (Bug#8505).
14082 (scroll_bar_width_for_theme): New variable.
14083 (update_theme_scrollbar_width): New function.
14084 (xg_get_default_scrollbar_width): Move code to
14085 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14086 (xg_initialize): Call update_theme_scrollbar_width.
14087
14088 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14089
14090 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14091
14092 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14093
14094 * frame.c (make_frame): Call other_buffer_safely instead of
14095 other_buffer.
14096
14097 * window.c (temp_output_buffer_show): Call display_buffer with
14098 second argument Vtemp_buffer_show_specifiers and reset latter
14099 immediately after the call.
14100 (Vtemp_buffer_show_specifiers): New variable.
14101 (auto_window_vscroll_p, next_screen_context_lines)
14102 (Vscroll_preserve_screen_position): Remove leading asterisks from
14103 doc-strings.
14104
14105 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
14106
14107 Fix minor problems found by GCC 4.6.0 static checking.
14108 * buffer.c (Qclone_number): Remove for now, as it's unused.
14109 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14110 (record_buffer): Remove unused local.
14111 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14112 (set_frame_buffer_list): Remove; unused.
14113 * frame.h (other_visible_frames): Remove decl.
14114 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14115 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14116 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14117 if HAVE_GPM.
14118 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14119 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14120 Define only if HAVE_GPM.
14121 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14122 (update_hints_inhibit): Remove; never set. All uses removed.
14123 * widgetprv.h (emacsFrameClassRec): Remove decl.
14124 * window.c (delete_deletable_window): Now returns void, since it
14125 wasn't returning anything.
14126 (compare_window_configurations): Remove unused locals.
14127 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14128 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14129 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14130 the same widths as pointers. This follows up on the 2011-05-06 patch.
14131 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14132 * xterm.h: Likewise.
14133 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14134
14135 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
14136
14137 * makefile.w32-in: Update dependencies.
14138 (LISP_H): Add lib/intprops.h.
14139
14140 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14141
14142 * image.c (gif_load): Add animation frame delay to the metadata.
14143 (syms_of_image): Use DEFSYM. New symbol `delay'.
14144
14145 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14146
14147 * window.c (delete_deletable_window): Re-add.
14148 (Fset_window_configuration): Rewrite to handle dead buffers and
14149 consequently deletable windows.
14150 (window_tree, Fwindow_tree): Remove. Supply functionality in
14151 window.el.
14152 (compare_window_configurations): Simplify code.
14153
14154 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14155
14156 * image.c (imagemagick_load_image): Fix type mismatch.
14157 (Fimagemagick_types): Likewise.
14158
14159 * window.h (replace_buffer_in_windows): Declare.
14160
14161 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14162
14163 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14164 Qclone_number. Remove external declaration of Qdelete_window.
14165 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14166 code.
14167 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14168 Run Qbuffer_list_update_hook if allowed.
14169 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14170 buffer list implementation.
14171 (other_buffer_safely): New function.
14172 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14173 calls to replace_buffer_in_windows and
14174 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14175 if allowed.
14176 (record_buffer): Inhibit quitting and rewrite using quittable
14177 functions. Run Qbuffer_list_update_hook if allowed.
14178 (Frecord_buffer, Funrecord_buffer): New functions.
14179 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14180 Move switch-to-buffer to window.el.
14181 (bury-buffer): Move to window.el.
14182 (Vbuffer_list_update_hook): New variable.
14183
14184 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14185 section.
14186
14187 * window.h (resize_frame_windows): Move up in code.
14188 (Fwindow_frame): Remove EXFUN.
14189 (replace_buffer_in_all_windows): Remove prototype.
14190 (replace_buffer_in_windows_safely): Add prototype.
14191
14192 * window.c: Declare Qdelete_window static again. Move down
14193 declaration of select_count.
14194 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14195 (Fother_window): Move to window.el.
14196 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14197 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14198 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14199 window.el.
14200 (replace_buffer_in_windows): Implement by calling
14201 Qreplace_buffer_in_windows.
14202 (replace_buffer_in_all_windows): Remove with some functionality
14203 moved into replace_buffer_in_windows_safely.
14204 (replace_buffer_in_windows_safely): New function.
14205 (select_window_norecord, select_frame_norecord): Move in front
14206 of run_window_configuration_change_hook. Remove now obsolete
14207 declarations.
14208 (Fset_window_buffer): Rewrite doc-string.
14209 Call Qrecord_window_buffer.
14210 (keys_of_window): Move binding for other-window to window.el.
14211
14212 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14213
14214 * dispextern.h (struct image): Replace data member, whose int_val
14215 and ptr_val fields were not used by anything, with a single
14216 lisp_val object.
14217
14218 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14219 (gif_clear_image, gif_load, imagemagick_load_image)
14220 (gs_clear_image, gs_load): Callers changed.
14221
14222 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14223
14224 * buffer.h: Include <time.h>, for time_t.
14225 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14226
14227 Fix minor problems found by static checking.
14228
14229 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14230
14231 Make identifiers static if they are not used in other modules.
14232 * data.c (Qcompiled_function, Qframe, Qvector):
14233 * image.c (QimageMagick, Qsvg):
14234 * minibuf.c (Qmetadata):
14235 * window.c (resize_window_check, resize_root_window): Now static.
14236 * window.h (resize_window_check, resize_root_window): Remove decls.
14237
14238 * window.c (window_deletion_count, delete_deletable_window):
14239 Remove; unused.
14240 (window_body_lines): Now static.
14241 (Fdelete_other_windows_internal): Mark vars as initialized.
14242 Make sure 'resize_failed' is initialized.
14243 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14244 (resize_window_apply): Remove unused local.
14245 * window.h (delete_deletable_window): Remove decl.
14246
14247 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14248 (imagemagick_load_image): Fix pointer signedness problem by changing
14249 last arg from unsigned char * to char *. All uses changed.
14250 Also, fix a local for similar reasons.
14251 Remove unused locals. Remove locals to avoid shadowing.
14252 (fn_rsvg_handle_free): Remove; unused.
14253 (svg_load, svg_load_image): Fix pointer signedness problem.
14254 (imagemagick_load_image): Don't use garbage pointer image_wand.
14255
14256 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14257
14258 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
14259
14260 * image.c (gif_load): Fix omitted cast error introduced by
14261 2011-06-06 change.
14262
14263 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14264
14265 * window.h (resize_proportionally, orig_total_lines)
14266 (orig_top_line): Remove from window structure.
14267 (set_window_height, set_window_width, change_window_heights)
14268 (Fdelete_window): Remove prototypes.
14269 (resize_frame_windows): Remove duplicate declaration.
14270
14271 2011-06-10 Eli Zaretskii <eliz@gnu.org>
14272
14273 * window.h (resize_frame_windows, resize_window_check)
14274 (delete_deletable_window, resize_root_window)
14275 (resize_frame_windows): Declare prototypes.
14276
14277 * window.c (resize_window_apply): Make definition be "static" to
14278 match the prototype.
14279
14280 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14281
14282 * window.c: Remove declarations of Qwindow_size_fixed,
14283 window_min_size_1, window_min_size_2, window_min_size,
14284 size_window, window_fixed_size_p, enlarge_window, delete_window.
14285 Remove static from declaration of Qdelete_window, it's
14286 temporarily needed by Fbury_buffer.
14287 (replace_window): Don't assign orig_top_line and
14288 orig_total_lines.
14289 (Fdelete_window, delete_window): Remove. Window deletion is
14290 handled by window.el.
14291 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14292 Replace Fdelete_window calls with calls to Qdelete_window.
14293 (Fdelete_other_windows): Remove. Deleting other windows is
14294 handled by window.el.
14295 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14296 handled in window.el.
14297 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14298 Window minimum sizes are handled in window.el.
14299 (shrink_windows, size_window, set_window_height)
14300 (set_window_width, change_window_heights, window_height)
14301 (window_width, CURBEG, CURSIZE, enlarge_window)
14302 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14303 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14304 handled in window.el.
14305 (make_dummy_parent): Rename to make_parent_window and give it a
14306 second argument horflag.
14307 (make_window): Don't set resize_proportionally any more.
14308 (Fsplit_window): Remove. Windows are split in window.el.
14309 (save_restore_action, save_restore_orig_size)
14310 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14311 Resize mini windows in window.el.
14312 (grow_mini_window, shrink_mini_window): Implement by calling
14313 Qresize_root_window_vertically, resize_window_check and
14314 resize_window_apply.
14315 (saved_window, Fset_window_configuration, save_window_save):
14316 Do not handle orig_top_line, orig_total_lines, and
14317 resize_proportionally.
14318 (window_min_height, window_min_width): Move to window.el.
14319 (keys_of_window): Move bindings for delete-other-windows,
14320 split-window, delete-window and enlarge-window to window.el.
14321
14322 * buffer.c: Temporarily extern Qdelete_window.
14323 (Fbury_buffer): Temporarily call Qdelete_window instead of
14324 Fdelete_window (Fbury_buffer will move to window.el soon).
14325
14326 * frame.c (set_menu_bar_lines_1): Remove code handling
14327 orig_top_line and orig_total_lines.
14328
14329 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14330 set_window_height but set heights directly.
14331 (change_frame_size_1): Use resize_frame_windows.
14332
14333 * xdisp.c (init_xdisp): Don't use set_window_height but set
14334 heights directly.
14335
14336 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14337 Use resize_frame_windows instead of change_window_heights and run
14338 run_window_configuration_change_hook.
14339
14340 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14341 instead of change_window_heights and run
14342 run_window_configuration_change_hook.
14343
14344 2011-06-09 Martin Rudalics <rudalics@gmx.at>
14345
14346 * window.c (replace_window): Rename second argument REPLACEMENT to
14347 NEW. New third argument SETFLAG. Rewrite.
14348 (delete_window, make_dummy_parent): Call replace_window with
14349 third argument 1.
14350 (window_list_1): Move down in code.
14351 (run_window_configuration_change_hook): Move set_buffer part
14352 before select_frame_norecord part in order to unwind correctly.
14353 Rename count1 to count.
14354 (recombine_windows, delete_deletable_window, resize_root_window)
14355 (Fdelete_other_windows_internal)
14356 (Frun_window_configuration_change_hook, make_parent_window)
14357 (resize_window_check, resize_window_apply, Fresize_window_apply)
14358 (resize_frame_windows, Fsplit_window_internal)
14359 (Fdelete_window_internal, Fresize_mini_window_internal):
14360 New functions.
14361 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14362
14363 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14364
14365 * window.h (window): Add some new members to window structure -
14366 normal_lines, normal_cols, new_total, new_normal, clone_number,
14367 splits, nest, prev_buffers, next_buffers.
14368 (WINDOW_TOTAL_SIZE): Move here from window.c.
14369 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14370
14371 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14372 Remove.
14373 (make_dummy_parent): Set new members of windows structure.
14374 (make_window): Move down in code. Handle new members of window
14375 structure.
14376 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14377 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14378 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14379 (Fset_window_prev_buffers, Fwindow_next_buffers)
14380 (Fset_window_next_buffers, Fset_window_clone_number):
14381 New functions.
14382 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14383 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14384 Doc-string fixes.
14385 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14386 Argument WINDOW can be now internal window too.
14387 (Fwindow_use_time): Move up in code.
14388 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14389 Rewrite doc-string.
14390 (Fset_window_configuration, saved_window)
14391 (Fcurrent_window_configuration, save_window_save): Handle new
14392 members of window structure.
14393 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14394 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14395 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14396 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14397 Qget_mru_window, Qresize_root_window,
14398 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14399 Qauto_buffer_name; staticpro them.
14400
14401 2011-06-07 Martin Rudalics <rudalics@gmx.at>
14402
14403 * window.c (Fwindow_total_size, Fwindow_left_column)
14404 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14405 (Fwindow_list_1): New functions.
14406 (window_box_text_cols): Replace with window_body_cols.
14407 (Fwindow_width, Fscroll_left, Fscroll_right):
14408 Use window_body_cols instead of window_box_text_cols.
14409 (delete_window, Fset_window_configuration):
14410 Call delete_all_subwindows with window as argument.
14411 (delete_all_subwindows): Take a window as argument and not a
14412 structure. Rewrite.
14413 (window_loop): Remove handling of GET_LRU_WINDOW and
14414 GET_LARGEST_WINDOW.
14415 (Fget_lru_window, Fget_largest_window): Move to window.el.
14416
14417 * window.h: Extern window_body_cols instead of
14418 window_box_text_cols. delete_all_subwindows now takes a
14419 Lisp_Object as argument.
14420
14421 * indent.c (compute_motion, Fcompute_motion):
14422 Use window_body_cols instead of window_box_text_cols.
14423
14424 * frame.c (delete_frame): Call delete_all_subwindows with root
14425 window as argument.
14426
14427 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14428
14429 * fns.c (Fputhash): Document return value.
14430
14431 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
14432
14433 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14434
14435 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14436
14437 Cons<->int and similar integer overflow fixes (Bug#8794).
14438
14439 Check for overflow when converting integer to cons and back.
14440 * charset.c (Fdefine_charset_internal, Fdecode_char):
14441 Use cons_to_unsigned to catch overflow.
14442 (Fencode_char): Use INTEGER_TO_CONS.
14443 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14444 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14445 * data.c (long_to_cons, cons_to_long): Remove.
14446 (cons_to_unsigned, cons_to_signed): New functions.
14447 These signal an error for invalid or out-of-range values.
14448 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14449 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14450 * font.c (Ffont_variation_glyphs):
14451 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14452 * lisp.h: Include <intprops.h>.
14453 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14454 (cons_to_signed, cons_to_unsigned): New decls.
14455 (long_to_cons, cons_to_long): Remove decls.
14456 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14457 (Fprimitive_undo): Use CONS_TO_INTEGER.
14458 * xfns.c (Fx_window_property): Likewise.
14459 * xselect.c: Include <limits.h>.
14460 (x_own_selection, selection_data_to_lisp_data):
14461 Use INTEGER_TO_CONS.
14462 (x_handle_selection_request, x_handle_selection_clear)
14463 (x_get_foreign_selection, Fx_disown_selection_internal)
14464 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14465 (lisp_data_to_selection_data): Use cons_to_unsigned.
14466 (x_fill_property_data): Use cons_to_signed.
14467 Report values out of range.
14468
14469 Check for buffer and string overflow more precisely.
14470 * buffer.h (BUF_BYTES_MAX): New macro.
14471 * lisp.h (STRING_BYTES_MAX): New macro.
14472 * alloc.c (Fmake_string):
14473 * character.c (string_escape_byte8):
14474 * coding.c (coding_alloc_by_realloc):
14475 * doprnt.c (doprnt):
14476 * editfns.c (Fformat):
14477 * eval.c (verror):
14478 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14479 since they may not be the same number.
14480 * editfns.c (Finsert_char):
14481 * fileio.c (Finsert_file_contents):
14482 Likewise for BUF_BYTES_MAX.
14483
14484 * image.c: Use ptrdiff_t, not int, for sizes.
14485 (slurp_file): Switch from int to ptrdiff_t.
14486 All uses changed.
14487 (slurp_file): Check that file size fits in both size_t (for
14488 malloc) and ptrdiff_t (for sanity and safety).
14489
14490 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14491 if b->modtime has its maximal value.
14492
14493 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14494
14495 Don't assume time_t can fit into int.
14496 * buffer.h (struct buffer.modtime): Now time_t, not int.
14497 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14498 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14499
14500 Minor fixes for signed vs unsigned integers.
14501 * character.h (MAYBE_UNIFY_CHAR):
14502 * charset.c (maybe_unify_char):
14503 * keyboard.c (read_char, reorder_modifiers):
14504 XINT -> XFASTINT, since the integer must be nonnegative.
14505 * ftfont.c (ftfont_spec_pattern):
14506 * keymap.c (access_keymap, silly_event_symbol_error):
14507 XUINT -> XFASTINT, since the integer must be nonnegative.
14508 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14509 since it makes no difference and we prefer signed.
14510 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14511 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14512 nonnegative.
14513
14514 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14515
14516 * window.h (Fwindow_frame): Declare.
14517
14518 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14519
14520 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14521 (SPARE_MEMORY): Always define.
14522 (LARGE_REQUEST): Remove.
14523 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14524
14525 2011-06-06 Martin Rudalics <rudalics@gmx.at>
14526
14527 * lisp.h: Move EXFUNS for Fframe_root_window,
14528 Fframe_first_window and Fset_frame_selected_window to window.h.
14529
14530 * window.h: Move EXFUNS for Fframe_root_window,
14531 Fframe_first_window and Fset_frame_selected_window here from
14532 lisp.h.
14533
14534 * frame.c (Fwindow_frame, Fframe_first_window)
14535 (Fframe_root_window, Fframe_selected_window)
14536 (Fset_frame_selected_window): Move to window.c.
14537 (Factive_minibuffer_window): Move to minibuf.c.
14538 (Fother_visible_frames_p): New function.
14539
14540 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14541
14542 * window.c (decode_window, decode_any_window): Move up in code.
14543 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14544 (inhibit_frame_unsplittable): Remove unused variable.
14545 (Fwindow_buffer): Move up and rewrite doc-string.
14546 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14547 (Fwindow_prev): New functions.
14548 (Fwindow_frame): Move here from frame.c. Accept any window as
14549 argument.
14550 (Fframe_root_window, Fframe_first_window)
14551 (Fframe_selected_window): Move here from frame.c. Accept frame
14552 or arbitrary window as argument. Update doc-strings.
14553 (Fminibuffer_window): Move up in code.
14554 (Fwindow_minibuffer_p): Move up in code and simplify.
14555 (Fset_frame_selected_window): Move here from frame.c.
14556 Marginal rewrite.
14557 (Fselected_window, select_window, Fselect_window): Move up in
14558 code. Minor doc-string fixes.
14559
14560 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14561
14562 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14563 Do not assume that spare memory exists; that assumption is valid
14564 only if SYSTEM_MALLOC.
14565 (LARGE_REQUEST): New macro, so that the issue of large requests
14566 is separated from the issue of spare memory.
14567
14568 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14569
14570 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14571 format. (Bug#8806)
14572
14573 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14574
14575 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14576 before statements.
14577
14578 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14579
14580 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14581
14582 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14583
14584 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14585 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14586
14587 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
14588
14589 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14590
14591 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
14592
14593 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14594 (x_clipboard_manager_save): Add return value.
14595 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14596 New error handlers.
14597 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14598 Obey Vx_select_enable_clipboard_manager. Catch errors in
14599 x_clipboard_manager_save (Bug#8779).
14600 (Vx_select_enable_clipboard_manager): New variable.
14601 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14602
14603 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
14604
14605 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14606
14607 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14608
14609 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14610 in the current matrix if keep_current_p is non-zero.
14611
14612 2011-06-04 Eli Zaretskii <eliz@gnu.org>
14613
14614 * bidi.c (bidi_level_of_next_char): Fix last change.
14615
14616 2011-06-03 Eli Zaretskii <eliz@gnu.org>
14617
14618 Support bidi reordering of text covered by display properties.
14619
14620 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14621 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14622 (bidi_cache_search, bidi_cache_iterator_state)
14623 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14624 (bidi_level_of_next_char, bidi_move_to_visually_next):
14625 Support character positions inside a run of characters covered by a
14626 display string.
14627 (bidi_paragraph_init, bidi_resolve_explicit_1)
14628 (bidi_level_of_next_char): Call bidi_fetch_char and
14629 bidi_fetch_char_advance instead of FETCH_CHAR and
14630 FETCH_CHAR_ADVANCE.
14631 (bidi_init_it): Initialize new members.
14632 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14633 definitions.
14634 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14635 instead of using explicit *_CHAR codes.
14636 (bidi_resolve_explicit, bidi_resolve_weak):
14637 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14638 bidirectional text is supported only in multibyte buffers.
14639 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14640 it to initialize the frame_window_p member of struct bidi_it.
14641 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14642 (bidi_resolve_explicit, bidi_resolve_weak)
14643 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14644 bidi_it->nchars is non-positive.
14645 (bidi_level_of_next_char): Don't try to lookup the cache for the
14646 next/previous character if nothing is cached there yet, or if we
14647 were just reseat()'ed to a new position.
14648
14649 * xdisp.c (set_cursor_from_row): Set start and stop points
14650 according to the row's direction when priming the loop that looks
14651 for the glyph on which to display cursor.
14652 (single_display_spec_intangible_p): Function deleted.
14653 (display_prop_intangible_p): Reimplement to call
14654 handle_display_spec instead of single_display_spec_intangible_p.
14655 Accept 3 additional arguments needed by handle_display_spec.
14656 This fixes incorrect cursor motion across display property with complex
14657 values: lists, `(when COND...)' forms, etc.
14658 (single_display_spec_string_p): Support property values that are
14659 lists with the argument STRING its top-level element.
14660 (display_prop_string_p): Fix the condition for processing a
14661 property that is a list to be consistent with handle_display_spec.
14662 (handle_display_spec): New function, refactored from the
14663 last portion of handle_display_prop.
14664 (compute_display_string_pos): Accept additional argument
14665 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14666 value of a `display' property is a "replacing spec".
14667 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14668 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14669 the display property, but just return a value indicating whether
14670 the display property will replace the characters it covers.
14671 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14672 frame_window_p members of struct bidi_it.
14673 (compute_display_string_pos, compute_display_string_end):
14674 New functions.
14675 (push_it): Accept second argument POSITION, where pop_it should
14676 jump to continue iteration.
14677 (reseat_1): Initialize bidi_it.disp_pos.
14678
14679 * keyboard.c (adjust_point_for_property): Adjust the call to
14680 display_prop_intangible_p to its new signature.
14681
14682 * dispextern.h (struct bidi_it): New member frame_window_p.
14683 (bidi_init_it): Update prototypes.
14684 (display_prop_intangible_p): Update prototype.
14685 (compute_display_string_pos, compute_display_string_end):
14686 Declare prototypes.
14687 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14688 EMACS_INT.
14689
14690 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14691
14692 Malloc failure behavior now depends on size of allocation.
14693 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14694 * lisp.h: Change signatures accordingly.
14695 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14696 All callers changed. (Bug#8762)
14697
14698 * gnutls.c: Use Emacs's memory allocators.
14699 Without this change, the gnutls library would invoke malloc etc.
14700 directly, which causes problems on non-SYNC_INPUT hosts, and which
14701 runs afoul of improving memory_full behavior. (Bug#8761)
14702 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14703 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14704 xfree instead of the default malloc, realloc, free.
14705 (Fgnutls_boot): No need to check for memory allocation failure,
14706 since xmalloc does that for us.
14707
14708 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14709 * category.c (hash_get_category_set):
14710 * ccl.c (ccl_driver):
14711 * charset.c (Fdefine_charset_internal):
14712 * charset.h (struct charset.hash_index):
14713 * composite.c (get_composition_id, gstring_lookup_cache)
14714 (composition_gstring_put_cache):
14715 * composite.h (struct composition.hash_index):
14716 * dispextern.h (struct image.hash):
14717 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14718 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14719 (hashfn_equal, hashfn_user_defined, make_hash_table)
14720 (maybe_resize_hash_table, hash_lookup, hash_put)
14721 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14722 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14723 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14724 * image.c (make_image, search_image_cache, lookup_image)
14725 (xpm_put_color_table_h):
14726 * lisp.h (struct Lisp_Hash_Table):
14727 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14728 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14729 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14730 * alloc.c (allocate_vectorlike):
14731 Check for overflow in vector size calculations.
14732 * ccl.c (ccl_driver):
14733 Check for overflow when converting EMACS_INT to int.
14734 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14735 need to be updated by these changes.
14736 * fns.c (make_hash_table, maybe_resize_hash_table):
14737 Check for integer overflow with large hash tables.
14738 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14739 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14740 (SXHASH_REDUCE): New macro.
14741 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14742 Use it instead of discarding useful hash info with large hash values.
14743 (sxhash_float): New function.
14744 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14745 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14746 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14747 Rewrite to use FIXNUM_BITS, as this simplifies things.
14748 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14749 Adjust signatures to match updated version of code.
14750 (consing_since_gc): Now EMACS_INT, since a single hash table can
14751 use more than INT_MAX bytes.
14752
14753 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14754
14755 Make it possible to build with GCC-4.6+ -O2 -flto.
14756
14757 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14758
14759 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14760
14761 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14762 Call minibuffer-inactive-mode.
14763
14764 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
14765
14766 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14767 Update dependencies.
14768
14769 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14770
14771 * data.c (init_data): Remove code for UTS, this system is not
14772 supported anymore.
14773
14774 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14775
14776 Don't force ./temacs to start in terminal mode.
14777
14778 * frame.c (make_initial_frame): Initialize faces in all cases, not
14779 only when CANNOT_DUMP is defined.
14780 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14781
14782 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14783
14784 * dispnew.c (add_window_display_history): Use const for the string
14785 pointer. Remove declaration, not needed.
14786
14787 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14788
14789 Use 'inline', not 'INLINE'.
14790 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14791 * alloc.c, fontset.c (INLINE): Remove.
14792 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14793 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14794 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14795 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14796 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14797
14798 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14799
14800 Make it possible to run ./temacs.
14801
14802 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14803 syms_of_callproc does the same thing. Remove test for
14804 "initialized", do it in the caller.
14805 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14806
14807 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14808
14809 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14810 (read_minibuf): Use get_minibuffer.
14811 (syms_of_minibuf): Use DEFSYM.
14812 (Qmetadata): New var.
14813 * data.c (Qbuffer): Don't make it static.
14814 (syms_of_data): Use DEFSYM.
14815
14816 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14817
14818 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14819 (CCL_CODE_MIN): New macro.
14820
14821 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14822
14823 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14824
14825 * eval.c (Qdebug): Now static.
14826 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14827 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14828 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14829
14830 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14831
14832 * image.c: Various fixes to ImageMagick code comments.
14833 (Fimagemagick_types): Doc fix.
14834
14835 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14836
14837 Minor fixes prompted by GCC 4.6.0 warnings.
14838
14839 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14840
14841 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14842 (x_clipboard_manager_save_all): Move extern decl to ...
14843 * xterm.h: ... here, so that it can be checked for consistency.
14844
14845 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14846
14847 * xselect.c (x_clipboard_manager_save_frame)
14848 (x_clipboard_manager_save_all): New functions.
14849 (Fx_clipboard_manager_save): Lisp function deleted.
14850
14851 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14852 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14853
14854 * xterm.h: Update prototype.
14855
14856 2011-05-28 William Xu <william.xwl@gmail.com>
14857
14858 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14859 exiting (Bug#8239).
14860
14861 2011-05-28 Jim Meyering <meyering@redhat.com>
14862
14863 Avoid a sign-extension bug in crypto_hash_function.
14864 * fns.c (to_uchar): Define.
14865 (crypto_hash_function): Use it to convert some newly-signed
14866 variables to unsigned, to avoid sign-extension bugs. For example,
14867 without this change, (md5 "truc") would evaluate to
14868 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14869 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14870 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14871
14872 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14873
14874 Integer overflow fixes.
14875
14876 * dbusbind.c: Serial number integer overflow fixes.
14877 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14878 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14879 to hold a serial number that is too large for a fixnum.
14880 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14881 Check for serial numbers out of range. Decode any serial number
14882 that was so large that it became a float. (Bug#8722)
14883
14884 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14885 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14886 Use XFASTINT rather than XUINT when numbers are nonnegative.
14887 (xd_append_arg, Fdbus_method_return_internal):
14888 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14889 arguments, check that Lisp number is nonnegative, rather than
14890 silently wrapping negative numbers around. (Bug#8722)
14891 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14892 (Bug#8722)
14893
14894 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14895
14896 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14897
14898 ccl: Add integer overflow checks.
14899 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14900 (IN_INT_RANGE): New macros.
14901 (ccl_driver): Use them to check for integer overflow when
14902 decoding a CCL program. Many of the new checks are whether XINT (x)
14903 fits in int; it doesn't always, on 64-bit hosts. The new version
14904 doesn't catch all possible integer overflows, but it's an
14905 improvement. (Bug#8719)
14906
14907 * alloc.c (make_event_array): Use XINT, not XUINT.
14908 There's no need for unsigned here.
14909
14910 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14911 This follows up to the 2011-05-06 change that substituted uintptr_t
14912 for EMACS_INT. This case wasn't caught back then.
14913
14914 Rework Fformat to avoid integer overflow issues.
14915 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14916 now (part of C89). Include <verify.h>.
14917 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14918 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14919 (Fformat): Avoid the prepass trying to compute sizes; it was only
14920 approximate and thus did not catch overflow reliably. Instead, walk
14921 through the format just once, formatting and computing sizes as we go,
14922 checking for integer overflow at every step, and allocating a larger
14923 buffer as needed. Keep track separately whether the format is
14924 multibyte. Keep only the most-recently calculated precision, rather
14925 than them all. Record whether each argument has been converted to
14926 string. Use EMACS_INT, not int, for byte and char and arg counts.
14927 Support field widths and precisions larger than INT_MAX. Avoid
14928 sprintf's undefined behavior with conversion specifications such as %#d
14929 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14930 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14931 formatting out-of-range floating point numbers with int
14932 formats. (Bug#8668)
14933
14934 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14935
14936 * data.c: Avoid integer truncation in expressions involving floats.
14937 * data.c: Include <intprops.h>.
14938 (arith_driver): When there's an integer overflow in an expression
14939 involving floating point, convert the integers to floating point
14940 so that the resulting value does not suffer from catastrophic
14941 integer truncation. For example, on a 64-bit host (* 4
14942 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14943 Do not rely on undefined behavior after integer overflow.
14944
14945 merge count_size_as_multibyte, parse_str_to_multibyte
14946 * character.c, character.h (count_size_as_multibyte):
14947 Rename from parse_str_to_multibyte; all uses changed.
14948 Check for integer overflow.
14949 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14950 since it's now a duplicate of the other. This is more of
14951 a character than a buffer op, so better that it's in character.c.
14952 * fns.c, print.c: Adjust to above changes.
14953
14954 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14955
14956 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14957
14958 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14959
14960 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14961 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14962 (x_clipboard_manager_save): Now static.
14963 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14964
14965 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14966 (crypto_hash_function): Now static.
14967 Fix pointer signedness problems. Avoid unnecessary initializations.
14968
14969 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14970
14971 * termhooks.h (Vselection_alist): Make it terminal-local.
14972
14973 * terminal.c (create_terminal): Initialize it.
14974
14975 * xselect.c: Support for clipboard managers.
14976 (Vselection_alist): Move to termhooks.h as terminal-local var.
14977 (LOCAL_SELECTION): New macro.
14978 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14979 (symbol_to_x_atom): Remove gratuitous arg.
14980 (x_handle_selection_request, lisp_data_to_selection_data)
14981 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14982 (x_own_selection, x_get_local_selection, x_convert_selection):
14983 New arg, specifying work frame. Use terminal-local Vselection_alist.
14984 (some_frame_on_display): Delete unused function.
14985 (Fx_own_selection_internal, Fx_get_selection_internal)
14986 (Fx_disown_selection_internal, Fx_selection_owner_p)
14987 (Fx_selection_exists_p): New optional frame arg.
14988 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14989 (x_handle_selection_clear): Don't treat other terminals with the
14990 same keyboard specially. Use the terminal-local Vselection_alist.
14991 (x_clear_frame_selections): Use Frun_hook_with_args.
14992
14993 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14994
14995 * xterm.h: Add support for those atoms.
14996
14997 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14998
14999 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15000 (converted_selections, conversion_fail_tag): New global variables.
15001 (x_selection_request_lisp_error): Free the above.
15002 (x_get_local_selection): Remove unnecessary code.
15003 (x_reply_selection_request): Args changed; handle arbitrary array
15004 of converted selections stored in converted_selections.
15005 Separate the XChangeProperty and SelectionNotify steps.
15006 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15007 (x_convert_selection): New function.
15008 (x_handle_selection_event): Simplify.
15009 (x_get_foreign_selection): Don't ignore incoming requests while
15010 waiting for an answer; this will fail when we implement
15011 SAVE_TARGETS, and seems unnecessary anyway.
15012 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15013 (Vx_sent_selection_functions): Doc fix.
15014
15015 2011-05-26 Leo Liu <sdl.web@gmail.com>
15016
15017 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15018
15019 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15020
15021 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15022
15023 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15024 for fringe update if it has periodic bitmap.
15025 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15026 and fringe_bitmap_periodic_p.
15027
15028 * fringe.c (get_fringe_bitmap_data): New function.
15029 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15030 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15031 row. Mark glyph row for fringe update if periodicity changed.
15032
15033 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15034 for fringe update unless it has periodic bitmap.
15035
15036 2011-05-25 Kenichi Handa <handa@m17n.org>
15037
15038 * xdisp.c (get_next_display_element): Set correct it->face_id for
15039 a static composition.
15040
15041 2011-05-24 Leo Liu <sdl.web@gmail.com>
15042
15043 * deps.mk (fns.o):
15044 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15045
15046 * fns.c (crypto_hash_function, Fsha1): New function.
15047 (Fmd5): Use crypto_hash_function.
15048 (syms_of_fns): Add Ssha1.
15049
15050 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15051
15052 * gnutls.c: Remove unused macros.
15053 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15054 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15055 Remove macros that are defined and never used.
15056 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15057
15058 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15059
15060 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15061 (Fx_get_selection_internal): Minor cleanup.
15062 (Fx_own_selection_internal): Rename arguments for consistency with
15063 select.el.
15064
15065 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15066
15067 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15068
15069 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15070
15071 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15072
15073 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15074
15075 * dispnew.c (scrolling_window): Don't exclude the case that the
15076 last enabled row in the desired matrix touches the bottom boundary.
15077
15078 2011-05-21 Glenn Morris <rgm@gnu.org>
15079
15080 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15081 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15082 and add some more files.
15083
15084 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15085
15086 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15087 report_file_error introduced by the change from 2011-05-07.
15088
15089 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15090
15091 * systime.h (Time): Define only if emacs is defined.
15092 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15093 where the include path doesn't have X11/X.h by default. See
15094 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15095
15096 2011-05-20 Kenichi Handa <handa@m17n.org>
15097
15098 * composite.c (find_automatic_composition): Fix previous change.
15099
15100 2011-05-20 Glenn Morris <rgm@gnu.org>
15101
15102 * lisp.mk: New file, split from Makefile.in.
15103 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15104 (shortlisp): Remove.
15105 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15106
15107 2011-05-19 Glenn Morris <rgm@gnu.org>
15108
15109 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15110 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15111 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15112 (lisp): Set the order to that of loadup.el.
15113 (shortlisp): Make it a copy of $lisp.
15114 (SOME_MACHINE_LISP): Remove.
15115 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15116 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15117
15118 2011-05-18 Kenichi Handa <handa@m17n.org>
15119
15120 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15121 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15122 (find_automatic_composition): Mostly rewrite for efficiency.
15123
15124 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
15125
15126 * makefile.w32-in: Update dependencies.
15127
15128 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15129
15130 * menu.c: Include limits.h (fixes the MS-Windows build broken by
15131 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15132
15133 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
15134
15135 Fix some integer overflow issues, such as string length overflow.
15136
15137 * insdel.c (count_size_as_multibyte): Check for string overflow.
15138
15139 * character.c (lisp_string_width): Check for string overflow.
15140 Use EMACS_INT, not int, for string indexes and lengths; in
15141 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15142 the resulting string length overflows an EMACS_INT; instead,
15143 report a string overflow if no precision given. When checking for
15144 precision exhaustion, use a check that cannot possibly have
15145 integer overflow. (Bug#8675)
15146 * character.h (lisp_string_width): Adjust to new signature.
15147
15148 * alloc.c (string_overflow): New function.
15149 (Fmake_string): Use it. This doesn't change behavior, but saves
15150 a few bytes and will simplify future changes.
15151 * character.c (string_escape_byte8): Likewise.
15152 * lisp.h (string_overflow): New decl.
15153
15154 Fixups, following up to the user-interface timestamp change.
15155 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15156 for UI timestamps, instead of unsigned long.
15157 * msdos.c (mouse_get_pos): Likewise.
15158 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15159 * w32gui.h (Time): Define by including "systime.h" rather than by
15160 declaring it ourselves. (Bug#8664)
15161
15162 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15163 * image.c (clear_image_cache): Likewise.
15164
15165 * term.c (term_mouse_position): Don't assume time_t wraparound.
15166
15167 Be more systematic about user-interface timestamps.
15168 Before, the code sometimes used 'Time', sometimes 'unsigned long',
15169 and sometimes 'EMACS_UINT', to represent these timestamps.
15170 This change causes it to use 'Time' uniformly, as that's what X uses.
15171 This makes the code easier to follow, and makes it easier to catch
15172 integer overflow bugs such as Bug#8664.
15173 * frame.c (Fmouse_position, Fmouse_pixel_position):
15174 Use Time, not unsigned long, for user-interface timestamps.
15175 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15176 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15177 * keyboard.h (last_event_timestamp): Likewise.
15178 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15179 * menu.h (xmenu_show): Likewise.
15180 * term.c (term_mouse_position): Likewise.
15181 * termhooks.h (struct input_event.timestamp): Likewise.
15182 (struct terminal.mouse_position_hook): Likewise.
15183 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15184 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15185 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15186 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15187 what it was before.
15188 * menu.h, termhooks.h: Include "systime.h", for Time.
15189
15190 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15191 Don't assume that the difference between two unsigned long values
15192 can fit into an integer. At this point, we know button_down_time
15193 <= event->timestamp, so the difference must be nonnegative, so
15194 there's no need to cast the result if double-click-time is
15195 nonnegative, as it should be; check that it's nonnegative, just in
15196 case. This bug is triggered when events are more than 2**31 ms
15197 apart (about 25 days). (Bug#8664)
15198
15199 * xselect.c (last_event_timestamp): Remove duplicate decl.
15200 (x_own_selection): Remove needless cast to unsigned long.
15201
15202 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15203 that always fit in int. Use a sentinel instead of a counter, to
15204 avoid a temp and to allay GCC's concerns about possible int overflow.
15205 * frame.h (struct frame): Use int for menu_bar_items_used
15206 instead of EMACS_INT, since it always fits in int.
15207
15208 * menu.c (grow_menu_items): Check for int overflow.
15209
15210 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15211
15212 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15213 Before, the code was not consistent. These values cannot exceed
15214 2**31 - 1 so there's no need to make them unsigned.
15215 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15216 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15217 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15218 as modifiers.
15219 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15220
15221 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15222 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15223 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15224 presumably because the widths might not match.
15225
15226 * window.c (size_window): Avoid needless test at loop start.
15227
15228 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15229
15230 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15231
15232 2011-05-12 Drew Adams <drew.adams@oracle.com>
15233
15234 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15235
15236 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15237
15238 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15239 `width' to `bar_area_x' and `bar_area_width', respectively.
15240 (x_scroll_run): Take account of fringe background extension.
15241
15242 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15243 Rename local vars `left' and `width' to `bar_area_x' and
15244 `bar_area_width', respectively.
15245 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15246 background extension.
15247
15248 2011-05-10 Jim Meyering <meyering@redhat.com>
15249
15250 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15251
15252 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
15253
15254 * image.c (Finit_image_library): Return t for built-in image types,
15255 like pbm and xbm. (Bug#8640)
15256
15257 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15258
15259 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15260
15261 2011-05-07 Eli Zaretskii <eliz@gnu.org>
15262
15263 * w32console.c (Fset_screen_color): Doc fix.
15264 (Fget_screen_color): New function.
15265 (syms_of_ntterm): Defsubr it.
15266
15267 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15268 unlink the temporary file if Fcall_process didn't create it in the
15269 first place.
15270 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15271 child process will be redirected to a file specified with `:file'.
15272 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15273 cue to call_process_cleanup not to close that handle.
15274
15275 2011-05-07 Ben Key <bkey76@gmail.com>
15276
15277 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15278 one of two shell specific rules, either bootstrap-temacs-CMD or
15279 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15280 to the previous implementation of the bootstrap-temacs rule.
15281 The bootstrap-temacs-CMD rule is similar to the previous
15282 implementation of the bootstrap-temacs rule except that it
15283 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15284 variable.
15285
15286 These changes, along with some changes to nt/configure.bat,
15287 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15288 earlier fix to add support for --cflags and --ldflags options
15289 that include quotes so that it works whether make uses cmd or
15290 sh as the shell.
15291
15292 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
15293
15294 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15295 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15296 is a constant.
15297 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15298 a string. Handle both cases.
15299 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15300 (Fdbus_register_method): Use Qinvalid_function.
15301
15302 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15303
15304 * makefile.w32-in: Update dependencies.
15305 (LISP_H): Add inttypes.h and stdin.h.
15306 (PROCESS_H): Add unistd.h.
15307
15308 2011-05-06 Eli Zaretskii <eliz@gnu.org>
15309
15310 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15311 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15312
15313 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
15314
15315 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15316
15317 * term.c (vfatal): Remove stray call to va_end.
15318 It's not needed and the C Standard doesn't allow it here anyway.
15319
15320 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15321 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15322
15323 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15324 bytes.
15325
15326 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15327
15328 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15329
15330 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15331
15332 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15333
15334 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15335
15336 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15337 * charset.c (Fdefine_charset_internal): Don't initialize
15338 charset.code_space[15]. The value was garbage, on hosts with
15339 32-bit int (Bug#8600).
15340
15341 * lread.c (read_integer): Be more consistent with string-to-number.
15342 Use string_to_number to do the actual conversion; this avoids
15343 rounding errors and fixes some other screwups. Without this fix,
15344 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15345 (digit_to_number): Move earlier, for benefit of read_integer.
15346 Return -1 if the digit is out of range for the base, -2 if it is
15347 not a digit in any supported base. (Bug#8602)
15348
15349 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15350
15351 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15352 to match comment at start of function. This also removes a
15353 GCC warning about overflow in a 32+64-bit port.
15354
15355 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15356
15357 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15358 Reported by Stefan Monnier in
15359 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15360 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15361 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15362
15363 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15364 (EMACS_UINTPTR): Likewise, with uintptr_t.
15365
15366 * lisp.h: Prefer 64-bit EMACS_INT if available.
15367 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15368 on 32-bit hosts that have 64-bit int, so that they can access
15369 large files.
15370 However, temporarily disable this change unless the temporary
15371 symbol WIDE_EMACS_INT is defined.
15372
15373 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15374
15375 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15376 This removes an assumption that EMACS_INT and long are the same
15377 width as pointers. The assumption is true for Emacs porting targets
15378 now, but we want to make other targets possible.
15379 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15380 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15381 In the rest of the code, change types of integers that hold casted
15382 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15383 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15384 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15385 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15386 No need to cast type when ORing.
15387 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15388 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15389 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15390 assume EMACS_INT is the same width as char *.
15391 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15392 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15393 Remove no-longer-needed casts.
15394 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15395 (xg_tool_bar_help_callback, xg_make_tool_item):
15396 Use EMACS_INTPTR to hold an integer
15397 that will be cast to void *; this can avoid a GCC warning
15398 if EMACS_INT is not the same width as void *.
15399 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15400 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15401 (current_message_1, set_message_1):
15402 Use a local to convert to proper width without a cast.
15403 * xmenu.c (dialog_selection_callback): Likewise.
15404
15405 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15406 Also, don't assume VALBITS / RAND_BITS is less than 5,
15407 and don't rely on undefined behavior when shifting a 1 left into
15408 the sign bit.
15409 * lisp.h (get_random): Change signature to match.
15410
15411 * lread.c (hash_string): Use size_t, not int, for hash computation.
15412 Normally we prefer signed values; but hashing is special, because
15413 it's better to use unsigned division on hash table sizes so that
15414 the remainder is nonnegative. Also, size_t is the natural width
15415 for hashing into memory. The previous code used 'int', which doesn't
15416 retain enough info to hash well into very large tables.
15417 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15418
15419 * dbusbind.c: Don't possibly lose pointer info when converting.
15420 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15421 Use XPNTR rather than XHASH, so that the high-order bits of
15422 the pointer aren't lost when converting through void *.
15423
15424 * eval.c (Fautoload): Don't double-shift a pointer.
15425
15426 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15427
15428 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15429
15430 * gnutls.c (DEF_GNUTLS_FN):
15431 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15432
15433 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15434
15435 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15436 marker. (Bug#8610)
15437
15438 2011-05-05 Eli Zaretskii <eliz@gnu.org>
15439
15440 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15441 New version that can reserve upto 2GB of heap space.
15442
15443 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
15444
15445 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15446
15447 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15448
15449 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15450 `gnutls_certificate_set_x509_key_file'.
15451
15452 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
15453
15454 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15455 Update dependencies.
15456
15457 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15458
15459 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15460 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15461 Remove unused parameter `fildes'.
15462 * process.c (read_process_output, send_process): Don't pass it.
15463
15464 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15465
15466 Fix previous change: the library cache is defined in w32.c.
15467 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15468 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15469
15470 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15471
15472 Implement dynamic loading of GnuTLS on Windows.
15473
15474 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15475 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15476 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15477 Declare.
15478
15479 * gnutls.c (Qgnutls_dll): Define.
15480 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15481 (gnutls_*): Declare function pointers.
15482 (init_gnutls_functions): New function to initialize function pointers.
15483 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15484 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15485 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15486 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15487 (emacs_gnutls_write, emacs_gnutls_read)
15488 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15489 (Fgnutls_available_p): New function.
15490 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15491 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15492 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15493
15494 * image.c: Include w32.h.
15495 (Vimage_type_cache): Delete.
15496 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15497 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15498 (w32_delayed_load): Move to w32.c.
15499
15500 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15501
15502 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15503 (w32_delayed_load): Move from image.c. When loading a library, record
15504 its filename in the :loaded-from property of the library id.
15505 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15506 Initialize and staticpro them.
15507 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15508
15509 * process.c: Include lisp.h before w32.h, not after.
15510 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15511 instead of gnutls_record_check_pending.
15512
15513 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15514
15515 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15516
15517 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15518 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15519 as passed in.
15520
15521 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15522
15523 * xterm.c (x_set_frame_alpha): Do not set property on anything
15524 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15525
15526 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15527
15528 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15529
15530 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15531
15532 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15533 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15534 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15535 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15536 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15537 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15538 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15539 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15540 (Qgnutls_bootprop_callbacks_verify): Make static.
15541
15542 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15543
15544 * callproc.c: Indentation fixup.
15545
15546 * sysdep.c (wait_for_termination_1): Make static.
15547 (wait_for_termination, interruptible_wait_for_termination):
15548 Move after wait_for_termination_1.
15549
15550 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15551
15552 * sysdep.c (interruptible_wait_for_termination): New function
15553 which is like wait_for_termination, but allows keyboard
15554 interruptions.
15555
15556 * callproc.c (Fcall_process): Add (:file "file") as an option for
15557 the STDOUT buffer.
15558 (Fcall_process_region): Ditto.
15559
15560 2011-04-30 Eli Zaretskii <eliz@gnu.org>
15561
15562 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15563 rather than `XVECTOR (FOO)->size'.
15564
15565 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15566 inttypes.h, as a gnulib replacement is used if it not available in
15567 system headers.
15568
15569 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15570
15571 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15572 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15573 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15574
15575 * coding.c (coding_alloc_by_realloc): Error out if destination
15576 will grow beyond MOST_POSITIVE_FIXNUM.
15577 (decode_coding_emacs_mule): Abort if there isn't enough place in
15578 charbuf for the composition carryover bytes. Reserve an extra
15579 space for up to 2 characters produced in a loop.
15580 (decode_coding_iso_2022): Abort if there isn't enough place in
15581 charbuf for the composition carryover bytes.
15582
15583 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15584
15585 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15586 aborting when %lld or %lll format is passed.
15587 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15588 %llo or %llx format is passed. (Bug#8545)
15589
15590 * window.c (window_scroll_line_based): Use a marker instead of
15591 simple variables to record original value of point. (Bug#7952)
15592
15593 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15594 produced by %s or %c overflows available buffer space. (Bug#8545)
15595
15596 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15597
15598 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15599 (SIZE_MAX): Move defn after all includes, as they might #define it.
15600
15601 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15602
15603 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15604
15605 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15606
15607 * keyboard.c (Qdelayed_warnings_hook): Define.
15608 (command_loop_1): Run `delayed-warnings-hook'
15609 if Vdelayed_warnings_list is non-nil.
15610 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15611 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15612
15613 2011-04-28 Eli Zaretskii <eliz@gnu.org>
15614
15615 * doprnt.c (doprnt): Don't return value smaller than the buffer
15616 size if the message was truncated. (Bug#8545).
15617
15618 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15619
15620 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15621 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15622
15623 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15624
15625 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15626
15627 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
15628
15629 * makefile.w32-in: Update dependencies.
15630
15631 2011-04-27 Eli Zaretskii <eliz@gnu.org>
15632
15633 Improve `doprnt' and its usage. (Bug#8545)
15634 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15635 `format_end'. Remove support for %l as a conversion specifier.
15636 Don't use xrealloc. Improve diagnostics when the %l size modifier
15637 is used. Update the commentary.
15638
15639 * eval.c (verror): Simplify calculation of size_t.
15640
15641 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15642 messages.
15643
15644 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15645
15646 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15647 change.
15648
15649 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15650
15651 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15652 This makes this file independent of the recent pseudovector change.
15653
15654 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
15655
15656 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15657
15658 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15659 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15660 Remove unused local.
15661 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15662
15663 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
15664 GCC 4.6.0 optimizes based on type-based alias analysis.
15665 For example, if b is of type struct buffer * and v of type struct
15666 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15667 != &v->size, and therefore "v->size = 1; b->size = 2; return
15668 v->size;" must therefore return 1. This assumption is incorrect
15669 for Emacs, since it type-puns struct Lisp_Vector * with many other
15670 types. To fix this problem, this patch adds a new type struct
15671 vectorlike_header that documents the constraints on layout of vectors
15672 and pseudovectors, and helps optimizing compilers not get fooled
15673 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15674 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15675 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15676 the size member.
15677 (XSETPVECTYPE): Rewrite in terms of new macro.
15678 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15679 This is a bit clearer, and further avoids the possibility of
15680 undesirable aliasing.
15681 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15682 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15683 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15684 since Lisp_Subr is a special case (no "next" field).
15685 (ASIZE): Now uses header.size rather than size.
15686 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15687 to avoid the hassle of writing XVECTOR (foo)->header.size.
15688 (struct vectorlike_header): New type.
15689 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15690 object, to help avoid aliasing.
15691 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15692 (SUBRP): Likewise, since Lisp_Subr is a special case.
15693 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15694 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15695 (struct Lisp_Hash_Table): Combine first two members into a single
15696 struct vectorlike_header member. All uses of "size" and "next" members
15697 changed to be "header.size" and "header.next".
15698 * buffer.h (struct buffer): Likewise.
15699 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15700 * frame.h (struct frame): Likewise.
15701 * process.h (struct Lisp_Process): Likewise.
15702 * termhooks.h (struct terminal): Likewise.
15703 * window.c (struct save_window_data, struct saved_window): Likewise.
15704 * window.h (struct window): Likewise.
15705 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15706 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15707 * buffer.c (init_buffer_once): Likewise.
15708 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15709 special case.
15710 * process.c (Fformat_network_address): Use local var for size,
15711 for brevity.
15712
15713 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15714
15715 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15716 * data.c (atof): Remove decl; no longer used or needed.
15717 (digit_to_number): Move to lread.c.
15718 (Fstring_to_number): Use new string_to_number function, to be
15719 consistent with how the Lisp reader treats infinities and NaNs.
15720 Do not assume that floating-point numbers represent EMACS_INT
15721 without losing information; this is not true on most 64-bit hosts.
15722 Avoid double-rounding errors, by insisting on integers when
15723 parsing non-base-10 numbers, as the documentation specifies.
15724 * lisp.h (string_to_number): New decl, replacing ...
15725 (isfloat_string): Remove.
15726 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15727 (read1): Do not accept +. and -. as integers; this
15728 appears to have been a coding error. Similarly, do not accept
15729 strings like +-1e0 as floating point numbers. Do not report
15730 overflow for integer overflows unless the base is not 10 which
15731 means we have no simple and reliable way to continue.
15732 Break out the floating-point parsing into a new
15733 function string_to_number, so that Fstring_to_number parses
15734 floating point numbers consistently with the Lisp reader.
15735 (digit_to_number): Move here from data.c. Make it static inline.
15736 (E_CHAR, EXP_INT): Remove, replacing with ...
15737 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15738 (string_to_number): New function, replacing isfloat_string.
15739 This function checks for valid syntax and produces the resulting
15740 Lisp float number too. Rework it so that string-to-number
15741 no longer mishandles examples like "1.0e+". Use strtoumax,
15742 so that overflow for non-base-10 numbers is reported only when
15743 there's no portable and simple way to convert to floating point.
15744
15745 * textprop.c (set_text_properties_1): Rewrite for clarity,
15746 and to avoid GCC warning about integer overflow.
15747
15748 * intervals.h (struct interval): Use EMACS_INT for members
15749 where EMACS_UINT might cause problems. See
15750 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15751 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15752 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15753 All uses changed.
15754 (offset_intervals): Tell GCC not to worry about length overflow
15755 when negating a negative length.
15756
15757 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15758 (overrun_check_free): Likewise.
15759
15760 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15761 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15762 word size.
15763
15764 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15765 (gnutls_make_error): Rename local to avoid shadowing.
15766 (gnutls_emacs_global_deinit): ifdef out; not used.
15767 (Fgnutls_boot): Use const for pointer to readonly storage.
15768 Comment out unused local. Fix pointer signedness problems.
15769
15770 * lread.c (openp): Don't stuff size_t into an 'int'.
15771 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15772 about possible signed overflow.
15773
15774 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15775 (GDK_KEY_g): Don't define if already defined.
15776 (xg_prepare_tooltip): Avoid pointer signedness problem.
15777 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15778
15779 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15780 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15781
15782 * xfns.c (Fx_window_property): Simplify a bit,
15783 to make a bit faster and to avoid GCC 4.6.0 warning.
15784 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15785
15786 * fns.c (internal_equal): Don't assume size_t fits in int.
15787
15788 * alloc.c (compact_small_strings): Tighten assertion a little.
15789
15790 Replace pEd with more-general pI, and fix some printf arg casts.
15791 * lisp.h (pI): New macro, generalizing old pEd macro to other
15792 conversion specifiers. For example, use "...%"pI"d..." rather
15793 than "...%"pEd"...".
15794 (pEd): Remove. All uses replaced with similar uses of pI.
15795 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15796 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15797 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15798 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15799 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15800 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15801 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15802 64-bit hosts.
15803 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15804 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15805 * print.c (safe_debug_print, print_object): Likewise.
15806 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15807 to int.
15808 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15809 avoiding the 0 flag, which is not portable.
15810 * process.c (Fmake_network_process): Use pI to avoid cast.
15811 * region-cache.c (pp_cache): Likewise.
15812 * xdisp.c (decode_mode_spec): Likewise.
15813 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15814 behavior on 64-bit hosts with printf arg.
15815 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15816 (x_stop_queuing_selection_requests): Likewise.
15817 (x_get_window_property): Don't truncate byte count to an 'int'
15818 when tracing.
15819
15820 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15821 here, since it parses constructs like leading '-' and spaces,
15822 which are not wanted; and it overflows with large numbers.
15823 Instead, simply match F[0-9]+, which is what is wanted anyway.
15824
15825 * alloc.c: Remove unportable assumptions about struct layout.
15826 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15827 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15828 (allocate_vectorlike, make_pure_vector): Use the new macros,
15829 plus offsetof, to remove unportable assumptions about struct layout.
15830 These assumptions hold on all porting targets that I know of, but
15831 they are not guaranteed, they're easy to remove, and removing them
15832 makes further changes easier.
15833
15834 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15835 This doesn't fix a bug but makes the code clearer.
15836 (string_overrun_cookie): Now const. Use initializers that
15837 don't formally overflow signed char, to avoid warnings.
15838 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15839 can cause Emacs to crash when string overrun checking is enabled.
15840 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15841 multiple of sizeof (EMACS_INT); it need not be, if
15842 alignof(EMACS_INT) < sizeof (EMACS_INT).
15843 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15844
15845 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
15846
15847 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15848
15849 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15850
15851 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15852 supposed to be handshaking. (Bug#8556)
15853 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15854
15855 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15856
15857 * lisp.h (Qdebug): List symbol.
15858 * eval.c (Qdebug): Restore global linkage.
15859 * keyboard.c (debug-on-event): New variable.
15860 (handle_user_signal): Break into debugger when debug-on-event
15861 matches the current signal symbol.
15862
15863 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15864
15865 * alloc.c (check_sblock, check_string_bytes)
15866 (check_string_free_list): Convert to standard C.
15867
15868 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15869
15870 * w32.c (emacs_gnutls_push): Fix typo.
15871
15872 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15873
15874 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15875 "cast to pointer from integer of different size".
15876
15877 Improve doprnt and its use in verror. (Bug#8545)
15878 * doprnt.c (doprnt): Document the set of format control sequences
15879 supported by the function. Use SAFE_ALLOCA instead of always
15880 using `alloca'.
15881
15882 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15883 is one byte too soon. Don't use xrealloc; instead xfree and
15884 xmalloc anew.
15885
15886 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15887
15888 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15889 callbacks stage.
15890
15891 * gnutls.c: Renamed global_initialized to
15892 gnutls_global_initialized. Added internals for the
15893 :verify-hostname-error, :verify-error, and :verify-flags
15894 parameters of `gnutls-boot' and documented those parameters in the
15895 docstring. Start callback support.
15896 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15897 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15898 on error. Return error code.
15899 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15900 (emacs_gnutls_read): Likewise.
15901 (Fgnutls_boot): Return handshake error code.
15902 (emacs_gnutls_handle_error): New function.
15903 (wsaerror_to_errno): Likewise.
15904
15905 * w32.h (emacs_gnutls_pull): Add prototype.
15906 (emacs_gnutls_push): Likewise.
15907
15908 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15909 (emacs_gnutls_push): Likewise.
15910
15911 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15912
15913 * process.c (wait_reading_process_output): Check if GnuTLS
15914 buffered some data internally if no FDs are set for TLS
15915 connections.
15916
15917 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15918 (LIBS): Link to USER_LIBS.
15919 ($(BLD)/gnutls.$(0)): New target.
15920
15921 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15922
15923 * xdisp.c (handle_single_display_spec): Rename the
15924 display_replaced_before_p argument into display_replaced_p, to
15925 make it consistent with the commentary. Fix typos in the
15926 commentary.
15927
15928 * textprop.c (syms_of_textprop): Remove dead code.
15929 (copy_text_properties): Delete obsolete commentary about an
15930 interface that was deleted long ago. Fix typos in the description
15931 of arguments.
15932
15933 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15934 to changes in oldXMenu/XMenu.h from 2011-04-16.
15935 <menu_help_message, prev_menu_help_message>: Constify.
15936 (IT_menu_make_room): menu->help_text is now `const char **';
15937 adjust.
15938
15939 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15940 to changes in oldXMenu/XMenu.h from 2011-04-16.
15941 (struct XMenu): Declare `help_text' `const char **'.
15942
15943 * xfaces.c <Qunspecified>: Make extern again.
15944
15945 * syntax.c: Include sys/types.h before including regex.h, as
15946 required by POSIX.
15947
15948 * doc.c (get_doc_string): Improve the format passed to `error'.
15949
15950 * doprnt.c (doprnt): Improve commentary.
15951
15952 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15953
15954 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15955 them with etags.
15956
15957 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15958 changes in globals.h immediately force recompilation.
15959 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15960 $(CURDIR)/s/ms-w32.h.
15961 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15962
15963 * character.c (Fchar_direction): Function deleted.
15964 (syms_of_character): Don't defsubr it.
15965 <char-direction-table>: Deleted.
15966
15967 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15968
15969 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15970 * doprnt.c: Include limits.h.
15971 (SIZE_MAX): New macro.
15972 (doprnt): Return a size_t value. 2nd arg is now size_t.
15973 Many local variables are now size_t instead of int or unsigned.
15974 Improve overflow protection. Support `l' modifier for integer
15975 conversions. Support %l conversion. Don't assume an EMACS_INT
15976 argument for integer conversions and for %c.
15977
15978 * lisp.h (doprnt): Restore prototype.
15979
15980 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15981 $(SRC)/character.h.
15982
15983 * Makefile.in (base_obj): Add back doprnt.o.
15984
15985 * deps.mk (doprnt.o): Add back prerequisites.
15986 (callint.o): Depend on character.h.
15987
15988 * eval.c (internal_lisp_condition_case): Include the handler
15989 representation in the error message.
15990 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15991 when breaking from the loop.
15992
15993 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15994
15995 * callint.c (Fcall_interactively): When displaying error message
15996 about invalid control letter, pass the character's codepoint, not
15997 a pointer to its multibyte form. Improve display of the character
15998 in octal and display also its hex code.
15999
16000 * character.c (char_string): Use %x to display the (unsigned)
16001 codepoint of an invalid character, to avoid displaying a bogus
16002 negative value.
16003
16004 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16005 `error', not SYMBOL_NAME itself.
16006
16007 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16008 character arguments to `error'.
16009
16010 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16011 to `error' in error message about FINAL_CHAR argument. Make sure
16012 FINAL_CHAR is a character, and use %c when it is passed as
16013 argument to `error'.
16014
16015 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16016
16017 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16018
16019 * w32.c: Include <time.h>.
16020 (sys_localtime): New function.
16021
16022 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
16023
16024 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16025
16026 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16027
16028 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
16029
16030 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16031 zombies (Bug#8467).
16032
16033 2011-04-19 Eli Zaretskii <eliz@gnu.org>
16034
16035 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16036 gl_state.e_property when gl_state.object is Qt.
16037
16038 * insdel.c (make_gap_larger): Remove limitation of buffer size
16039 to <= INT_MAX.
16040
16041 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
16042
16043 * xdisp.c (lookup_glyphless_char_display)
16044 (produce_glyphless_glyph): Handle cons cell entry in
16045 glyphless-char-display.
16046 (Vglyphless_char_display): Document it.
16047
16048 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16049 glyphless-char-display.
16050
16051 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
16052
16053 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16054
16055 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16056
16057 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16058 definition for no-X builds.
16059
16060 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
16061
16062 Static checks with GCC 4.6.0 and non-default toolkits.
16063
16064 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16065
16066 * process.c (keyboard_bit_set): Define only if SIGIO.
16067 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16068 (send_process): Repair possible setjmp clobbering.
16069
16070 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16071
16072 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16073
16074 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16075
16076 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16077 Define only if needed.
16078
16079 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16080 by pacifying GCC about it. Maybe it's time to retire it?
16081 * xfaces.c (USG, __TIMEVAL__): Likewise.
16082
16083 * dispextern.h (struct redisplay_interface): Rename param
16084 to avoid shadowing.
16085 * termhooks.h (struct terminal): Likewise.
16086 * xterm.c (xembed_send_message): Likewise.
16087
16088 * insdel.c (make_gap_smaller): Define only if
16089 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16090
16091 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16092 it.
16093
16094 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16095 so that we aren't warned about unused symbols.
16096
16097 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16098
16099 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16100
16101 * xfns.c (x_real_positions): Mark locals as initialized.
16102
16103 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16104
16105 * xterm.c: Fix problems found by static analysis with other toolkits.
16106 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16107 (x_dispatch_event): Declare static if USE_GTK, and
16108 define if USE_GTK || USE_X_TOOLKIT.
16109 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16110 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16111 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16112 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16113
16114 * xmenu.c (menu_help_callback): Pointer type fixes.
16115 Use const pointers when pointing at readonly data. Avoid pointer
16116 signedness clashes.
16117 (FALSE): Remove unused macro.
16118 (update_frame_menubar): Remove unused decl.
16119
16120 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16121
16122 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16123 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16124 (single_menu_item): Rename local to avoid shadowing.
16125
16126 * keyboard.c (make_lispy_event): Remove unused local var.
16127
16128 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16129 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16130
16131 * bitmaps: Change bitmaps from unsigned char back to the X11
16132 compatible char. Avoid the old compiler warnings about
16133 out-of-range initializers by using, for example, '\xab' rather
16134 than 0xab.
16135
16136 * xgselect.c (xgselect_initialize): Check vs interface
16137 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16138
16139 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16140
16141 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16142 to read-only memory.
16143
16144 * fns.c (vector): Remove; this old hack is no longer needed.
16145
16146 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16147 Remove unused var.
16148 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16149
16150 * xrdb.c (x_load_resources): Omit unused local.
16151
16152 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16153 (x_window): Rename locals to avoid shadowing.
16154 (USG): Use the kludged USG macro, to pacify gcc.
16155
16156 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16157 (x_term_init): Remove local to avoid shadowing.
16158
16159 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16160
16161 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16162 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16163
16164 2011-04-16 Eli Zaretskii <eliz@gnu.org>
16165
16166 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16167
16168 Fix regex.c, syntax.c and friends for buffers > 2GB.
16169 * syntax.h (struct gl_state_s): Declare character position members
16170 EMACS_INT.
16171
16172 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16173
16174 * textprop.c (verify_interval_modification, interval_of):
16175 Declare arguments EMACS_INT.
16176
16177 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16178 EMACS_INT.
16179
16180 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16181
16182 * indent.c (Fvertical_motion): Local variable it_start is now
16183 EMACS_INT.
16184
16185 * regex.c (re_match, re_match_2, re_match_2_internal)
16186 (bcmp_translate, regcomp, regexec, print_double_string)
16187 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16188 (re_compile_pattern, re_exec): Declare arguments and local
16189 variables `size_t' and `ssize_t' and return values `regoff_t', as
16190 appropriate.
16191 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16192 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16193 <compile_stack_type>: `size' and `avail' are now `size_t'.
16194
16195 * regex.h <regoff_t>: Use ssize_t, not int.
16196 (re_search, re_search_2, re_match, re_match_2): Arguments that
16197 specify buffer/string position and length are now ssize_t and
16198 size_t. Return type is regoff_t.
16199
16200 2011-04-16 Ben Key <bkey76@gmail.com>
16201
16202 * nsfont.m: Fixed bugs in ns_get_family and
16203 ns_descriptor_to_entity that were caused by using free to
16204 deallocate memory blocks that were allocated by xmalloc (via
16205 xstrdup). This caused Emacs to crash when compiled with
16206 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16207 --enable-checking=xmallocoverrun). xfree is now used to
16208 deallocate these memory blocks.
16209
16210 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
16211
16212 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16213
16214 emacs_write: Accept and return EMACS_INT for sizes.
16215 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16216 et seq.
16217 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16218 Accept and return EMACS_INT.
16219 (emacs_gnutls_write): Return the number of bytes written on
16220 partial writes.
16221 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16222 (emacs_read, emacs_write): Remove check for negative size, as the
16223 Emacs source code has been audited now.
16224 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16225 (emacs_read, emacs_write): Use it.
16226 * process.c (send_process): Adjust to the new signatures of
16227 emacs_write and emacs_gnutls_write. Do not attempt to store
16228 a byte offset into an 'int'; it might overflow.
16229 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16230
16231 * sound.c: Don't assume sizes fit in 'int'.
16232 (struct sound_device.period_size, alsa_period_size):
16233 Return EMACS_INT, not int.
16234 (struct sound_device.write, vox_write, alsa_write):
16235 Accept EMACS_INT, not int.
16236 (wav_play, au_play): Use EMACS_INT to store sizes and to
16237 record read return values.
16238
16239 2011-04-15 Ben Key <bkey76@gmail.com>
16240
16241 * keyboard.c (Qundefined): Don't declare static since it is used
16242 in nsfns.m.
16243 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16244 static since they are used in nsfont.m.
16245
16246 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16247
16248 * process.c (Qprocessp): Don't declare static.
16249 * lisp.h (Qprocessp): Declare again.
16250
16251 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
16252
16253 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16254
16255 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16256
16257 Improve C-level modularity by making more things 'static'.
16258
16259 Don't publish debugger-only interfaces to other modules.
16260 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16261 (verify_bytepos, count_markers): Move decls to the only modules
16262 that need them.
16263 * region-cache.h (pp_cache): Likewise.
16264 * window.h (check_all_windows): Likewise.
16265 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16266
16267 * sysdep.c (croak): Now static, if
16268 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16269 * syssignal.h (croak): Declare only if not static.
16270
16271 * alloc.c (refill_memory_reserve): Now static if
16272 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16273 * lisp.h (refill_memory_reserve): Declare only if not static.
16274
16275 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16276 Define only if USE_LUCID.
16277
16278 * xrdb.c (x_customization_string, x_rm_string): Now static.
16279
16280 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16281 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16282
16283 * xdisp.c (draw_row_with_mouse_face): Now static.
16284 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16285
16286 * window.h (check_all_windows): Mark externally visible.
16287
16288 * window.c (window_deletion_count): Now static.
16289
16290 * undo.c: Make symbols static if they're not exported.
16291 (last_undo_buffer, last_boundary_position, pending_boundary):
16292 Now static.
16293
16294 * textprop.c (interval_insert_behind_hooks): Now static.
16295 (interval_insert_in_front_hooks): Likewise.
16296
16297 * term.c: Make symbols static if they're not exported.
16298 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16299 (max_frame_lines, tty_set_terminal_modes):
16300 (tty_reset_terminal_modes, tty_turn_off_highlight):
16301 (get_tty_terminal): Now static.
16302 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16303 * termhooks.h (term_mouse_moveto): Do not declare if
16304 HAVE_WINDOW_SYSTEM.
16305 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16306 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16307
16308 * sysdep.c: Make symbols static if they're not exported.
16309 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16310 Now static.
16311 (sigprocmask_set, full_mask): Remove; unused.
16312 (wait_debugging): Mark as visible.
16313 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16314 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16315
16316 * syntax.c (syntax_temp): Define only if !__GNUC__.
16317
16318 * sound.c (current_sound_device, current_sound): Now static.
16319
16320 * search.c (searchbufs, searchbuf_head): Now static.
16321
16322 * scroll.c (scroll_cost): Remove; unused.
16323 * dispextern.h (scroll_cost): Remove decl.
16324
16325 * region-cache.h (pp_cache): Mark as externally visible.
16326
16327 * process.c: Make symbols static if they're not exported.
16328 (process_tick, update_tick, create_process, chan_process):
16329 (Vprocess_alist, proc_buffered_char, datagram_access):
16330 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16331 (deactivate_process): Mark defn as static, as well as decl.
16332 * lisp.h (create_process): Remove decl.
16333 * process.h (chan_process, Vprocess_alist): Remove decls.
16334
16335 * print.c: Make symbols static if they're not exported.
16336 (print_depth, new_backquote_output, being_printed, print_buffer):
16337 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16338 (print_interval, print_number_index, initial_stderr_stream):
16339 Now static.
16340 * lisp.h (Fprinc): Remove decl.
16341 (debug_output_compilation_hack): Mark as externally visible.
16342
16343 * sysdep.c (croak): Move decl from here to syssignal.h.
16344 * syssignal.h (croak): Put it here, so the API can be checked when
16345 'croak' is called from dissociate_if_controlling_tty.
16346
16347 * minibuf.c: Make symbols static if they're not exported.
16348 (minibuf_save_list, choose_minibuf_frame): Now static.
16349 * lisp.h (choose_minibuf_frame): Remove decl.
16350
16351 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16352
16353 * lread.c: Make symbols static if they're not exported.
16354 (read_objects, initial_obarray, oblookup_last_bucket_number):
16355 Now static.
16356 (make_symbol): Remove; unused.
16357 * lisp.h (initial_obarray, make_symbol): Remove decls.
16358
16359 * keyboard.c: Make symbols static if they're not exported.
16360 (single_kboard, recent_keys_index, total_keys, recent_keys):
16361 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16362 (this_single_command_key_start, echoing, last_auto_save):
16363 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16364 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16365 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16366 (Vlispy_mouse_stem, double_click_count):
16367 Now static.
16368 (force_auto_save_soon): Define only if SIGDANGER.
16369 (ignore_mouse_drag_p): Now static if
16370 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16371 (print_help): Remove; unused.
16372 (stop_character, last_timer_event): Mark as externally visible.
16373 * keyboard.h (ignore_mouse_drag_p): Declare only if
16374 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16375 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16376 * lisp.h (echoing): Remove decl.
16377 (force_auto_save_soon): Declare only if SIGDANGER.
16378 * xdisp.c (redisplay_window): Simplify code, to make it more
16379 obvious that ignore_mouse_drag_p is not accessed if !defined
16380 USE_GTK && !defined HAVE_NS.
16381
16382 * intervals.c: Make symbols static if they're not exported.
16383 (merge_properties_sticky, merge_interval_right, delete_interval):
16384 Now static.
16385 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16386
16387 * insdel.c: Make symbols static if they're not exported.
16388 However, leave prepare_to_modify_buffer alone. It's never
16389 called from outside this function, but that appears to be a bug.
16390 (combine_after_change_list, combine_after_change_buffer):
16391 (adjust_after_replace, signal_before_change): Now static.
16392 (adjust_after_replace_noundo): Remove; unused.
16393 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16394 (signal_before_change): Remove decls.
16395
16396 * indent.c (val_compute_motion, val_vmotion): Now static.
16397
16398 * image.c: Make symbols static if they're not exported.
16399 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16400 if USE_GTK.
16401 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16402 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16403
16404 * fringe.c (standard_bitmaps): Now static.
16405 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16406
16407 * frame.c: Make symbols static if they're not exported.
16408 (x_report_frame_params, make_terminal_frame): Now static.
16409 (get_frame_param): Now static, unless HAVE_NS.
16410 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16411 (x_get_resource_string): Remove; not used.
16412 * frame.h (make_terminal_frame, x_report_frame_params):
16413 (x_get_resource_string); Remove decls.
16414 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16415 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16416
16417 * font.c, fontset.c: Make symbols static if they're not exported.
16418 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16419 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16420 * font.c (font_close_object): Now static.
16421 * font.h (font_close_object): Remove.
16422 * fontset.c (FONTSET_OBJLIST): Remove.
16423 (free_realized_fontset) #if-0 the body, which does nothing.
16424 (face_suitable_for_char_p): #if-0, as it's never called.
16425 * fontset.h (face_suitable_for_char_p): Remove decl.
16426 * xfaces.c (face_at_string_position):
16427 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16428 since 0 is always ASCII.
16429
16430 * fns.c (weak_hash_tables): Now static.
16431
16432 * fileio.c: Make symbols static if they're not exported.
16433 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16434 (Vwrite_region_annotation_buffers): Now static.
16435
16436 * eval.c: Make symbols static if they're not exported.
16437 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16438 * lisp.h (backtrace_list): Remove decl.
16439
16440 * emacs.c: Make symbols static if they're not exported.
16441 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16442 (fatal_error_code, fatal_error_signal_hook, standard_args):
16443 Now static.
16444 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16445 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16446 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16447 * lisp.h (fatal_error_signal_hook): Remove decl.
16448 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16449
16450 * editfns.c: Move a (normally-unused) function to its only use.
16451 * editfns.c, lisp.h (get_operating_system_release): Remove.
16452 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16453 worth the hassle of breaking this out.
16454
16455 * xterm.c: Make symbols static if they're not exported.
16456 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16457 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16458 (x_destroy_window, x_delete_display):
16459 Now static.
16460 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16461 (x_mouse_leave): Remove; unused.
16462 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16463 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16464 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16465 Remove decls.
16466 (x_mouse_leave): Declare only if WINDOWSNT.
16467 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16468 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16469 USE_X_TOOLKIT.
16470
16471 * ftxfont.c: Make symbols static if they're not exported.
16472 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16473 HAVE_FREETYPE.
16474 * font.h (ftxfont_driver): Likewise.
16475
16476 * xfns.c: Make symbols static if they're not exported.
16477 (x_last_font_name, x_display_info_for_name):
16478 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16479 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16480 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16481 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16482 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16483 (last_show_tip_args): Now static.
16484 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16485 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16486 (x_screen_planes): Remove; unused.
16487 * dispextern.h (x_screen_planes): Remove decl.
16488
16489 * dispnew.c: Make symbols static if they're not exported.
16490 * dispextern.h (redraw_garbaged_frames, scrolling):
16491 (increment_row_positions): Remove.
16492 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16493 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16494 Now static.
16495 (redraw_garbaged_frames): Remove; unused.
16496
16497 * xfaces.c: Make symbols static if they're not exported.
16498 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16499 Remove decls.
16500 * xterm.h (defined_color): Remove decls.
16501 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16502 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16503 (menu_face_changed_default, defined_color, free_realized_face):
16504 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16505 (ascii_face_of_lisp_face): Remove; unused.
16506
16507 * xdisp.c: Make symbols static if they're not exported.
16508 * dispextern.h (scratch_glyph_row, window_box_edges):
16509 (glyph_to_pixel_coords, set_cursor_from_row):
16510 (get_next_display_element, set_iterator_to_next):
16511 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16512 (show_mouse_face): Remove decls
16513 * frame.h (message_buf_print): Likewise.
16514 * lisp.h (pop_message, set_message, check_point_in_composition):
16515 Likewise.
16516 * xterm.h (set_vertical_scroll_bar): Likewise.
16517 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16518 (message_buf_print, scratch_glyph_row, displayed_buffer):
16519 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16520 (get_next_display_element, show_mouse_face, window_box_edges):
16521 (frame_to_window_pixel_xy, check_point_in_composition):
16522 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16523 (glyph_to_pixel_coords): Remove; unused.
16524
16525 * dired.c (file_name_completion): Now static.
16526
16527 * dbusbind.c (xd_in_read_queued_messages): Now static.
16528
16529 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16530 * data.c (circular_list_error): Remove.
16531
16532 * commands.h (last_point_position, last_point_position_buffer):
16533 (last_point_position_window): Remove decls.
16534 * keyboard.c: Make these variables static.
16535
16536 * coding.h (coding, code_convert_region, encode_coding_gap):
16537 Remove decls.
16538 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16539 (iso_code_class, detect_coding, code_convert_region): Now static.
16540 (encode_coding_gap): Remove; unused.
16541
16542 * chartab.c (chartab_chars, chartab_bits): Now static.
16543
16544 * charset.h (charset_iso_8859_1): Remove decl.
16545 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16546 Now static.
16547
16548 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16549 * ccl.c (Vccl_program_table): Now static.
16550 (check_ccl_update): Remove; unused.
16551
16552 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16553 * category.h: ... from here.
16554 * category.c (check_category_table, set_category_set): Now static.
16555
16556 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16557 * lisp.h: Remove these decls.
16558
16559 * buffer.c (buffer_count): Remove unused var.
16560
16561 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16562 so that it's not optimized away.
16563 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16564 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16565 exported only to the debugger.
16566
16567 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16568 * atimer.h (run_all_atimers): Remove; not exported.
16569
16570 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16571 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16572 was inaccessible from Lisp.
16573 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16574 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16575
16576 alloc.c: Import and export fewer symbols, and remove unused items.
16577 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16578 is defined.
16579 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16580 it's not optimized away by whole-program optimization.
16581 (message_enable_multibyte, free_misc): Remove.
16582 (catchlist, handlerlist, mark_backtrace):
16583 Declare only if BYTE_MARK_STACK.
16584 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16585 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16586 (message_enable_multibyte): Remove decl.
16587 (free_misc, interval_free_list, float_block, float_block_index):
16588 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16589 (cons_free_list, last_marked_index):
16590 Now static.
16591 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16592 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16593 (mark_backtrace): Define only if BYTE_MARK_STACK.
16594 * xdisp.c (message_enable_multibyte): Now static.
16595
16596 Declare Lisp_Object Q* variables to be 'static' if not exported.
16597 This makes it easier for human readers (and static analyzers)
16598 to see whether these variables are used from other modules.
16599 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16600 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16601 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16602 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16603 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16604 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16605 * xmenu.c, xselect.c:
16606 Declare Q* vars static if they are not used in other modules.
16607 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16608 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16609 Remove decls of unexported vars.
16610 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16611
16612 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16613
16614 Make Emacs functions such as Fatom 'static' by default.
16615 This makes it easier for human readers (and static analyzers)
16616 to see whether these functions can be called from other modules.
16617 DEFUN now defines a static function. To make the function external
16618 so that it can be used in other C modules, use the new macro DEFUE.
16619 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16620 (Finit_image_library):
16621 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16622 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16623 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16624 Remove decls, since these functions are now static.
16625 (Funintern, Fget_internal_run_time): New decls, since these functions
16626 were already external.
16627
16628 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16629 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16630 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16631 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16632 * keyboard.c, keymap.c, lread.c:
16633 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16634 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16635 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16636 Mark functions with DEFUE instead of DEFUN,
16637 if they are used in other modules.
16638 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16639 decls for now-static functions.
16640 * buffer.h (Fdelete_overlay): Remove decl.
16641 * callproc.c (Fgetenv_internal): Mark as internal.
16642 * composite.c (Fremove_list_of_text_properties): Remove decl.
16643 (Fcomposition_get_gstring): New forward static decl.
16644 * composite.h (Fcomposite_get_gstring): Remove decl.
16645 * dired.c (Ffile_attributes): New forward static decl.
16646 * doc.c (Fdocumntation_property): New forward static decl.
16647 * eval.c (Ffetch_bytecode): New forward static decl.
16648 (Funintern): Remove extern decl; now in .h file where it belongs.
16649 * fileio.c (Fmake_symbolic_link): New forward static decl.
16650 * image.c (Finit_image_library): New forward static decl.
16651 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16652 * intervals.h (Fprevious_property_change):
16653 (Fremove_list_of_text_properties): Remove decls.
16654 * keyboard.c (Fthis_command_keys): Remove decl.
16655 (Fcommand_execute): New forward static decl.
16656 * keymap.c (Flookup_key): New forward static decl.
16657 (Fcopy_keymap): Now static.
16658 * keymap.h (Flookup_key): Remove decl.
16659 * process.c (Fget_process): New forward static decl.
16660 (Fprocess_datagram_address): Mark as internal.
16661 * syntax.c (Fsyntax_table_p): New forward static decl.
16662 (skip_chars): Remove duplicate decl.
16663 * textprop.c (Fprevious_property_change): New forward static decl.
16664 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16665 Now internal.
16666 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16667 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16668
16669 * editfns.c (Fformat): Remove unreachable code.
16670
16671 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16672
16673 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16674 change. (Bug#8496)
16675
16676 2011-04-13 Eli Zaretskii <eliz@gnu.org>
16677
16678 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16679 when at ZV. (Bug#8487)
16680
16681 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16682
16683 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16684 (Bug#8437)
16685 * keyboard.c (parse_tool_bar_item): Likewise.
16686 * sound.c (sound_cleanup, alsa_close): Likewise.
16687 * termcap.c (tgetent): Likewise.
16688 * xfns.c (x_default_font_parameter): Likewise.
16689 * xsettings.c (read_and_apply_settings): Likewise.
16690
16691 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16692 (overrun_check_free): Protoize.
16693
16694 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16695
16696 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16697 since callers should never pass a negative size.
16698 Change the signature to match that of plain 'read' and 'write'; see
16699 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16700 * lisp.h: Update prototypes of emacs_write and emacs_read.
16701
16702 2011-04-11 Eli Zaretskii <eliz@gnu.org>
16703
16704 * xdisp.c (redisplay_window): Don't try to determine the character
16705 position of the scroll margin if the window start point w->startp
16706 is outside the buffer's accessible region. (Bug#8468)
16707
16708 2011-04-10 Eli Zaretskii <eliz@gnu.org>
16709
16710 Fix write-region and its subroutines for buffers > 2GB.
16711 * fileio.c (a_write, e_write): Modify declaration of arguments and
16712 local variables to support buffers larger than 2GB.
16713 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16714
16715 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16716 argument, local variables, and return value.
16717
16718 * lisp.h: Update prototypes of emacs_write and emacs_read.
16719
16720 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16721
16722 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16723
16724 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16725
16726 Fix more problems found by GCC 4.6.0's static checks.
16727
16728 * xdisp.c (vmessage): Use a better test for character truncation.
16729
16730 * charset.c (load_charset_map): <, not <=, for optimization,
16731 and to avoid potential problems with integer overflow.
16732 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16733 * casetab.c (set_identity, shuffle): Likewise.
16734 * editfns.c (Fformat): Likewise.
16735 * syntax.c (skip_chars): Likewise.
16736
16737 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16738 This also lets GCC 4.6.0 generate slightly better loop code.
16739
16740 * callint.c (Fcall_interactively): <, not <=, for optimization.
16741 (Fcall_interactively): Count the number of arguments produced,
16742 not the number of arguments given. This is simpler and lets GCC
16743 4.6.0 generate slightly better code.
16744
16745 * ftfont.c: Distingish more carefully between FcChar8 and char.
16746 The previous code passed unsigned char * to a functions like
16747 strlen and xstrcasecmp that expect char *, which does not
16748 conform to the C standard.
16749 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16750 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16751 char * when the C standard requires it.
16752
16753 * keyboard.c (read_char): Remove unused var.
16754
16755 * eval.c: Port to Windows vsnprintf (Bug#8435).
16756 Include <limits.h>.
16757 (SIZE_MAX): Define if the headers do not.
16758 (verror): Do not give up if vsnprintf returns a negative count.
16759 Instead, grow the buffer. This ports to Windows vsnprintf, which
16760 does not conform to C99. Problem reported by Eli Zaretskii.
16761 Also, simplify the allocation scheme, by avoiding the need for
16762 calling realloc, and removing the ALLOCATED variable.
16763
16764 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16765
16766 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16767 But keep the doprint source code for now, as we might revamp it
16768 and use it again (Bug#8435).
16769 * lisp.h (doprnt): Remove.
16770 * Makefile.in (base_obj): Remove doprnt.o.
16771 * deps.mk (doprnt.o): Remove.
16772
16773 error: Print 32- and 64-bit integers portably (Bug#8435).
16774 Without this change, on typical 64-bit hosts error ("...%d...", N)
16775 was used to print both 32- and 64-bit integers N, which relied on
16776 undefined behavior.
16777 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16778 * lisp.h (error, verror): Mark as printf-like functions.
16779 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16780 Report overflow in size calculations when allocating printf buffer.
16781 Do not truncate output string at its first null byte.
16782 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16783 Truncate the output at a character boundary, since vsnprintf does not
16784 do that.
16785 * charset.c (check_iso_charset_parameter): Convert internal
16786 character to string before calling 'error', since %c now has the
16787 printf meaning.
16788 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16789 overflow when computing char to be passed to 'error'. Do not
16790 pass Lisp_Object to 'error'; pass the integer instead.
16791 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16792 formatted with plain %d.
16793
16794 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16795
16796 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16797
16798 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16799
16800 * xterm.c (x_catch_errors): Remove duplicate declaration.
16801
16802 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16803
16804 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16805
16806 2011-04-10 Jim Meyering <meyering@redhat.com>
16807
16808 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16809 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16810 return ssize_t not "int", and use size_t as the buffer length.
16811 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16812 * gnutls.h: Update declarations.
16813 * process.c (read_process_output): Use ssize_t, to match.
16814 (send_process): Likewise.
16815
16816 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16817
16818 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16819
16820 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16821
16822 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16823 Use unsigned char, to match FcChar8 type definition.
16824
16825 * xterm.c (handle_one_xevent):
16826 * xmenu.c (create_and_show_popup_menu):
16827 * xselect.c (x_decline_selection_request)
16828 (x_reply_selection_request): Avoid type-punned deref of X events.
16829
16830 2011-04-09 Eli Zaretskii <eliz@gnu.org>
16831
16832 Fix some uses of `int' instead of EMACS_INT.
16833 * search.c (string_match_1, fast_string_match)
16834 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16835 (scan_buffer, find_next_newline_no_quit)
16836 (find_before_next_newline, search_command, Freplace_match)
16837 (Fmatch_data): Make some `int' variables be EMACS_INT.
16838
16839 * xdisp.c (display_count_lines): 3rd argument and return value now
16840 EMACS_INT. All callers changed.
16841 (pint2hrstr): Last argument is now EMACS_INT.
16842
16843 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16844 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16845 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16846 (decode_coding_utf_16, decode_coding_emacs_mule)
16847 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16848 (decode_coding_ccl, decode_coding_charset)
16849 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16850 (decode_coding_iso_2022, decode_coding_emacs_mule)
16851 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16852 <char_offset, last_offset>: Declare EMACS_INT.
16853 (encode_coding_utf_8, encode_coding_utf_16)
16854 (encode_coding_emacs_mule, encode_invocation_designation)
16855 (encode_designation_at_bol, encode_coding_iso_2022)
16856 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16857 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16858 Declare EMACS_INT.
16859 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16860 (encode_invocation_designation): Last argument P_NCHARS is now
16861 EMACS_INT.
16862 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16863 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16864
16865 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16866 All users changed.
16867
16868 * ccl.c (Fccl_execute_on_string): Declare some variables
16869 EMACS_INT.
16870
16871 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16872
16873 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16874
16875 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16876
16877 * process.c (Fformat_network_address): Doc fix.
16878
16879 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16880
16881 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16882
16883 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16884
16885 * keyboard.c (read_char): Call Lisp function help-form-show,
16886 instead of using internal_with_output_to_temp_buffer.
16887 (Qhelp_form_show): New var.
16888 (syms_of_keyboard): Use DEFSYM macro.
16889
16890 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16891
16892 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16893
16894 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16895
16896 * process.c (Flist_processes): Remove to Lisp.
16897 (list_processes_1): Delete.
16898
16899 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16900
16901 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16902
16903 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16904
16905 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16906
16907 Fix more problems found by GCC 4.6.0's static checks.
16908
16909 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16910
16911 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16912
16913 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16914
16915 * xdisp.c (vmessage): Mark as a printf-like function.
16916
16917 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16918
16919 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16920
16921 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16922 printf-like functions.
16923 (tiff_load): Add casts to remove these marks before passing them
16924 to system-supplied API.
16925
16926 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16927
16928 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16929 This avoids several warnings with gcc -Wstrict-overflow.
16930 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16931 directly, rather than having caller test rule sign. This avoids
16932 some unnecessary tests.
16933 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16934 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16935 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16936
16937 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16938 (xfont_open): Avoid unnecessary tests.
16939
16940 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16941
16942 * composite.h, composite.c (composition_gstring_put_cache):
16943 Use EMACS_INT, not int, for length.
16944
16945 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16946 breaking out part of COMPOSITION_DECODE_RULE.
16947 (COMPOSITION_DECODE_RULE): Use it.
16948 * composite.c (get_composition_id): Remove unused local vars,
16949 by using the new macro.
16950
16951 * textprop.c (set_text_properties_1): Change while to do-while,
16952 since the condition is always true at first.
16953
16954 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16955 (interval_deletion_adjustment): Return unsigned value.
16956 All uses changed.
16957
16958 * process.c (list_processes_1, create_pty, read_process_output):
16959 (exec_sentinel): Remove vars that were set but not used.
16960 (create_pty): Remove unnecessary "volatile"s.
16961 (Fnetwork_interface_info): Avoid possibility of int overflow.
16962 (read_process_output): Do adaptive read buffering even if carryover.
16963 (read_process_output): Simplify nbytes computation if buffered.
16964
16965 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16966
16967 * syntax.c (scan_words): Remove var that was set but not used.
16968 (update_syntax_table): Use unsigned instead of int.
16969
16970 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16971 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16972 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16973
16974 * print.c (print_error_message): Avoid int overflow.
16975
16976 * font.c (font_list_entities): Redo for clarity,
16977 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16978
16979 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16980 (font_score): Avoid potential overflow in diff calculation.
16981
16982 * fns.c (substring_both): Remove var that is set but not used.
16983 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16984
16985 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16986
16987 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16988 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16989 can always succeed if overflow has undefined behavior.
16990
16991 * search.c (boyer_moore, wordify): Remove vars set but not used.
16992 (wordify): Omit three unnecessary tests.
16993
16994 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16995 All callers changed. This avoids the need for an unused var.
16996
16997 * casefiddle.c (casify_region): Remove var that is set but not used.
16998
16999 * dired.c (file_name_completion): Remove var that is set but not used.
17000
17001 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17002
17003 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17004 (Finsert_file_contents): Remove unnecessary code checking fd.
17005
17006 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17007 Check for integer overflow on size calculations.
17008
17009 * buffer.c (Fprevious_overlay_change): Remove var that is set
17010 but not used.
17011
17012 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17013 Remove vars that are set but not used.
17014 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17015 (timer_check_2): Mark vars as initialized.
17016
17017 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17018
17019 * image.c (lookup_image): Remove var that is set but not used.
17020 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17021
17022 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17023 that are set but not used.
17024
17025 * xfns.c (make_invisible_cursor): Don't return garbage
17026 if XCreateBitmapFromData fails (Bug#8410).
17027
17028 * xselect.c (x_get_local_selection, x_handle_property_notify):
17029 Remove vars that are set but not used.
17030
17031 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17032 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17033
17034 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17035 Remove var that is set but not used.
17036 (scroll_bar_windows_size): Now size_t, not int.
17037 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17038 Check for overflow.
17039
17040 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17041 (map_tty_color) [!defined MSDOS]: Likewise.
17042
17043 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17044
17045 * coding.c: Remove vars that are set but not used.
17046 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17047 All callers changed.
17048 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17049 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17050 (decode_coding_charset): Remove vars that are set but not used.
17051
17052 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17053 that is set but not used.
17054
17055 * print.c (print_object): Remove var that is set but not used.
17056
17057 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17058 The gnulib version avoids calling malloc in the usual case,
17059 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17060 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17061 * filelock.c (current_lock_owner): Likewise.
17062 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17063 * sysdep.c: Include allocator.h, careadlinkat.h.
17064 (emacs_no_realloc_allocator): New static constant.
17065 (emacs_readlink): New function.
17066 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17067 ../lib/careadlinkat.h.
17068
17069 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17070
17071 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17072 first non-nil return value).
17073
17074 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17075
17076 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17077 if not defined (Bug#8403).
17078
17079 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17080
17081 * xdisp.c (display_count_lines): Remove parameter `start',
17082 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17083 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17084 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17085 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17086 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17087 and thereabouts. All callers changed.
17088 (get_per_char_metric): Remove parameter `f', unused since
17089 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17090
17091 2011-04-02 Jim Meyering <meyering@redhat.com>
17092
17093 do not dereference NULL upon failed strdup
17094 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17095 (ns_get_family): Likewise.
17096
17097 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17098
17099 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17100
17101 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17102
17103 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17104 later (Bug#8403).
17105
17106 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17107
17108 Add lexical binding.
17109
17110 * window.c (Ftemp_output_buffer_show): New fun.
17111 (Fsave_window_excursion):
17112 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17113
17114 * lread.c (lisp_file_lexically_bound_p): New function.
17115 (Fload): Bind Qlexical_binding.
17116 (readevalloop): Remove `evalfun' arg.
17117 Bind Qinternal_interpreter_environment.
17118 (Feval_buffer): Bind Qlexical_binding.
17119 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17120 Mark as dynamic.
17121 (syms_of_lread): Declare `lexical-binding'.
17122
17123 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17124
17125 * keyboard.c (eval_dyn): New fun.
17126 (menu_item_eval_property): Use it.
17127
17128 * image.c (parse_image_spec): Use Ffunctionp.
17129
17130 * fns.c (concat, mapcar1): Accept byte-code-functions.
17131
17132 * eval.c (Fsetq): Handle lexical vars.
17133 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17134 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17135 (FletX, Flet): Obey lexical binding.
17136 (Fcommandp): Handle closures.
17137 (Feval): New `lexical' arg.
17138 (eval_sub): New function extracted from Feval. Use it almost
17139 everywhere where Feval was used. Look up vars in lexical env.
17140 Handle closures.
17141 (Ffunctionp): Move from subr.el.
17142 (Ffuncall): Handle closures.
17143 (apply_lambda): Remove `eval_flags'.
17144 (funcall_lambda): Handle closures and new byte-code-functions.
17145 (Fspecial_variable_p): New function.
17146 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17147 but without exporting it to Lisp.
17148
17149 * doc.c (Fdocumentation, store_function_docstring):
17150 * data.c (Finteractive_form): Handle closures.
17151
17152 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17153 interactive spec.
17154
17155 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17156 New byte-codes.
17157 (exec_byte_code): New function extracted from Fbyte_code to handle new
17158 calling convention for byte-code-functions. Add new byte-codes.
17159
17160 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17161
17162 * alloc.c (Fmake_symbol): Init new `declared_special' field.
17163
17164 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17165
17166 * xdisp.c (redisplay_internal): Fix prototype.
17167
17168 2011-03-31 Eli Zaretskii <eliz@gnu.org>
17169
17170 * xdisp.c (SCROLL_LIMIT): New macro.
17171 (try_scrolling): Use it when setting scroll_limit.
17172 Limit scrolling to 100 screen lines.
17173 (redisplay_window): Even when falling back on "recentering",
17174 position point in the window according to scroll-conservatively,
17175 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17176
17177 (try_scrolling): When point is above the window, allow searching
17178 as far as scroll_max, or one screenful, to compute vertical
17179 distance from PT to the scroll margin position. This prevents
17180 try_scrolling from unnecessarily failing when
17181 scroll-conservatively is set to a value slightly larger than the
17182 window height. Clean up the case of PT below the margin at bottom
17183 of window: scroll_max can no longer be INT_MAX. When aggressive
17184 scrolling is in use, don't let point enter the opposite scroll
17185 margin as result of the scroll.
17186 (syms_of_xdisp) <scroll-conservatively>: Document the
17187 threshold of 100 lines for never-recentering scrolling.
17188
17189 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17190
17191 * dispextern.h (move_it_by_lines):
17192 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17193 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17194 (message_log_check_duplicate): Remove parameters `prev_bol' and
17195 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17196 (redisplay_internal): Remove parameter `preserve_echo_area',
17197 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17198
17199 * indent.c (Fvertical_motion):
17200 * window.c (window_scroll_pixel_based, Frecenter):
17201 Don't pass `need_y_p' to `move_it_by_lines'.
17202
17203 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17204
17205 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17206 steal a few bits to be more compact.
17207 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17208 Remove unneeded casts.
17209
17210 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17211
17212 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17213
17214 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17215 binding" message (bug#7967).
17216
17217 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17218
17219 Fix more problems found by GCC 4.6.0's static checks.
17220
17221 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17222 Remove unused local var.
17223
17224 * editfns.c (Fmessage_box): Remove unused local var.
17225
17226 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17227 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17228 Omit unused local vars.
17229 * window.c (shrink_windows): Omit unused local var.
17230 * menu.c (digest_single_submenu): Omit unused local var.
17231 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17232 Omit unused local var.
17233
17234 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17235 Don't assume string length fits in int.
17236 (keyremap_step, read_key_sequence): Use size_t for sizes.
17237 (read_key_sequence): Don't check last_real_key_start redundantly.
17238
17239 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17240 instead of alloca (Bug#8344).
17241
17242 * eval.c (Fbacktrace): Don't assume nargs fits in int.
17243 (Fbacktrace_frame): Don't assume nframes fits in int.
17244
17245 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17246
17247 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17248 concerns.
17249
17250 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17251
17252 * cm.c (calccost): Turn while-do into do-while, for clarity.
17253
17254 * keyboard.c (syms_of_keyboard): Use the same style as later
17255 in this function when indexing through an array. This also
17256 works around GCC bug 48267.
17257
17258 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17259
17260 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17261
17262 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17263 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17264
17265 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17266 This avoids undefined behavior on integer overflow, and is a bit
17267 more convenient anyway since it is compared to a size_t variable.
17268
17269 Variadic C functions now count arguments with size_t, not int.
17270 This avoids an unnecessary limitation on 64-bit machines, which
17271 caused (substring ...) to crash on large vectors (Bug#8344).
17272 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17273 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
17274 All variadic functions and their callers changed accordingly.
17275 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17276 * data.c (arith_driver, float_arith_driver): Likewise.
17277 * editfns.c (general_insert_function): Likewise.
17278 * eval.c (struct backtrace.nargs, interactive_p)
17279 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17280 (funcall_lambda, mark_backtrace): Likewise.
17281 * fns.c (concat): Likewise.
17282 * frame.c (x_set_frame_parameters): Likewise.
17283 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17284 0 if not found, not -1. All callers changed.
17285
17286 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17287 (stack_copy_size): Now size_t, not int.
17288 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17289
17290 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17291
17292 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17293 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17294 All callers changed.
17295
17296 * lisp.h (multibyte_char_to_unibyte):
17297 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17298 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17299 * character.h (CHAR_TO_BYTE8):
17300 * cmds.c (internal_self_insert):
17301 * editfns.c (general_insert_function):
17302 * keymap.c (push_key_description):
17303 * search.c (Freplace_match):
17304 * xdisp.c (message_dolog, set_message_1): All callers changed.
17305
17306 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17307
17308 * keyboard.c (safe_run_hook_funcall): New function.
17309 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17310 don't set the hook to nil, but remove the offending function instead.
17311 (Qcommand_hook_internal): Remove, unused.
17312 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17313 Vcommand_hook_internal.
17314
17315 * eval.c (enum run_hooks_condition): Remove.
17316 (funcall_nil, funcall_not): New functions.
17317 (run_hook_with_args): Call each function through a `funcall' argument.
17318 Remove `cond' argument, now redundant.
17319 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17320 (Frun_hook_with_args_until_failure): Adjust accordingly.
17321 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17322
17323 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17324
17325 * dispextern.h (string_buffer_position): Remove declaration.
17326
17327 * print.c (strout): Remove parameter `multibyte', unused since
17328 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17329
17330 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17331 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17332 All callers changed.
17333
17334 * w32.c (_wsa_errlist): Use braces for struct initializers.
17335
17336 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17337 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17338 All callers changed.
17339 (string_buffer_position): Likewise. Also, make static (it's never
17340 used outside xdisp.c).
17341 (cursor_row_p): Remove parameter `w', unused since
17342 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17343 (decode_mode_spec): Remove parameter `precision', introduced during
17344 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17345 All callers changed.
17346
17347 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17348
17349 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17350
17351 2011-03-27 Anders Lindgren <andlind@gmail.com>
17352
17353 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17354 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17355 (ns_update_auto_hide_menu_bar): New functions.
17356 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17357 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17358 ns_constrain_all_frames.
17359 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17360 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17361
17362 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17363
17364 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17365
17366 2011-03-27 Glenn Morris <rgm@gnu.org>
17367
17368 * syssignal.h: Replace RETSIGTYPE with void.
17369 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17370 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17371 Replace SIGTYPE with void everywhere.
17372 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17373 * s/template.h (SIGTYPE): Remove commented out definition.
17374
17375 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17376
17377 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17378 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17379
17380 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17381
17382 * w32.c (read_unc_volume): Use parameter `henum', instead of
17383 global variable `wget_enum_handle'.
17384
17385 * keymap.c (describe_vector): Remove parameters `indices' and
17386 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17387 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17388
17389 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17390
17391 * keyboard.c (timer_check): Remove parameter `do_it_now',
17392 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17393 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17394 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17395
17396 * keyboard.c (read_char):
17397 * w32menu.c (w32_menu_display_help):
17398 * xmenu.c (show_help_event, menu_help_callback):
17399 Adjust calls to `show_help_echo'.
17400
17401 * gtkutil.c (xg_maybe_add_timer):
17402 * keyboard.c (readable_events):
17403 * process.c (wait_reading_process_output):
17404 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17405
17406 * insdel.c (adjust_markers_gap_motion):
17407 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17408 (gap_left, gap_right): Don't call it.
17409
17410 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17411
17412 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17413 incurred during fontification.
17414
17415 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17416
17417 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17418 (DEFVAR_PER_BUFFER): Don't pass it.
17419
17420 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17421 (scrolling_window): Don't pass it.
17422
17423 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17424
17425 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17426
17427 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17428 and `suffix'.
17429 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17430 of variables specific to SELinux and computation of `encoded_absname'.
17431
17432 * image.c (XPutPixel): Remove unused variable `height'.
17433
17434 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17435
17436 * unexw32.c (get_section_info): Remove unused variable `section'.
17437
17438 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17439 (system_process_attributes): Remove unused variable `sess'.
17440 (sys_read): Remove unused variable `err'.
17441
17442 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17443 (w32_wnd_proc): Remove unused variable `isdead'.
17444 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17445 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17446 (x_create_tip_frame): Remove unused variable `tem'.
17447
17448 * w32inevt.c (w32_console_read_socket):
17449 Remove unused variable `no_events'.
17450
17451 * w32term.c (x_draw_composite_glyph_string_foreground):
17452 Remove unused variable `width'.
17453
17454 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17455
17456 * w32term.c (x_set_glyph_string_clipping):
17457 Don't pass uninitialized region to CombineRgn.
17458
17459 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17460
17461 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17462 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17463 (Fx_close_connection): Remove unused variable `i'.
17464
17465 * w32font.c (w32font_draw): Return number of glyphs.
17466 (w32font_open_internal): Remove unused variable `i'.
17467 (w32font_driver): Add missing initializer.
17468
17469 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17470 (fill_in_menu): Remove unused variable `items_added'.
17471
17472 * w32term.c (last_mouse_press_frame): Remove static global variable.
17473 (w32_clip_to_row): Remove unused variable `f'.
17474 (x_delete_terminal): Remove unused variable `i'.
17475
17476 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17477 (NOTHING): Remove unused static global variable.
17478 (uniscribe_check_otf): Remove unused variable `table'.
17479 (uniscribe_font_driver): Add missing initializers.
17480
17481 2011-03-23 Julien Danjou <julien@danjou.info>
17482
17483 * term.c (Fsuspend_tty, Fresume_tty):
17484 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17485 * window.c (temp_output_buffer_show):
17486 * insdel.c (signal_before_change):
17487 * frame.c (Fhandle_switch_frame):
17488 * fileio.c (Fdo_auto_save):
17489 * emacs.c (Fkill_emacs):
17490 * editfns.c (save_excursion_restore):
17491 * cmds.c (internal_self_insert):
17492 * callint.c (Fcall_interactively):
17493 * buffer.c (Fkill_all_local_variables):
17494 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17495 Use Frun_hooks.
17496 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17497 unconditionally since it does the check itself.
17498
17499 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17500
17501 Fix more problems found by GCC 4.5.2's static checks.
17502
17503 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17504 the first time through the loop, since we know p0 < p1 then.
17505 This also avoids a gcc -Wstrict-overflow warning.
17506
17507 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17508 leading to a memory leak, possible in functions like
17509 load_charset_map_from_file that can allocate an unbounded number
17510 of objects (Bug#8318).
17511
17512 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17513 that could (at least in theory) be that large.
17514
17515 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17516 This is less likely to overflow, and avoids undefined behavior if
17517 overflow does occur. All callers changed. Use strtoul to scan
17518 for the unsigned long integer.
17519 (pint2hrstr): Simplify and tune code slightly.
17520 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17521
17522 * scroll.c (do_scrolling): Work around GCC bug 48228.
17523 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17524
17525 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17526 This also avoids a warning with gcc -Wstrict-overflow.
17527 (validate_x_resource_name): Simplify count usage.
17528 This also avoids a warning with gcc -Wstrict-overflow.
17529
17530 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17531 fail (Bug#8306).
17532
17533 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17534
17535 * process.c (Fmake_network_process): Use socklen_t, not int,
17536 where POSIX says socklen_t is required in portable programs.
17537 This fixes a porting bug on hosts like 64-bit HP-UX, where
17538 socklen_t is wider than int (Bug#8277).
17539 (Fmake_network_process, server_accept_connection):
17540 (wait_reading_process_output, read_process_output):
17541 Likewise.
17542
17543 * process.c: Rename or move locals to avoid shadowing.
17544 (list_processes_1, Fmake_network_process):
17545 (read_process_output_error_handler, exec_sentinel_error_handler):
17546 Rename or move locals.
17547 (Fmake_network_process): Define label "retry_connect" only if needed.
17548 (Fnetwork_interface_info): Fix pointer signedness.
17549 (process_send_signal): Add cast to avoid pointer signedness problem.
17550 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17551 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17552
17553 Make tparam.h and terminfo.c consistent.
17554 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17555 Include tparam.h instead, since it declares them.
17556 * cm.h (PC): Remove extern decl; tparam.h now does this.
17557 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17558 * terminfo.c: Include tparam.h, to check interfaces.
17559 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17560 (tparam): Adjust signature to match interface in tparam.h;
17561 this removes some undefined behavior. Check that outstring and len
17562 are zero, which they always are with Emacs.
17563 * tparam.h (PC, BC, UP): New extern decls.
17564
17565 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17566 (xftfont_open): Rename locals to avoid shadowing.
17567
17568 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17569 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17570 (OTF_TAG_SYM): Omit macro if not needed.
17571 (ftfont_list): Remove unused local.
17572 (get_adstyle_property, ftfont_pattern_entity):
17573 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17574 Rename locals to avoid shadowing.
17575
17576 * xfont.c (xfont_list_family): Mark var as initialized.
17577
17578 * xml.c (make_dom): Now static.
17579
17580 * composite.c (composition_compute_stop_pos): Rename local to
17581 avoid shadowing.
17582 (composition_reseat_it): Remove unused locals.
17583 (find_automatic_composition, composition_adjust_point): Likewise.
17584 (composition_update_it): Mark var as initialized.
17585 (find_automatic_composition): Mark vars as initialized,
17586 with a FIXME (Bug#8290).
17587
17588 character.h: Rename locals to avoid shadowing.
17589 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17590 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17591 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17592 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17593 to avoid shadowing.
17594
17595 * textprop.c (property_change_between_p): Remove; unused.
17596
17597 * intervals.c (interval_start_pos): Now static.
17598
17599 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17600
17601 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17602 Rename locals to avoid shadowing.
17603
17604 * sound.c (wav_play, au_play, Fplay_sound_internal):
17605 Fix pointer signedness.
17606 (alsa_choose_format): Remove unused local var.
17607 (wav_play): Initialize a variable to 0, to prevent undefined
17608 behavior (Bug#8278).
17609
17610 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17611
17612 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17613
17614 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17615 clobbering (Bug#8298).
17616 * sysdep.c (sys_subshell): Likewise.
17617 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17618
17619 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17620 This should get cleaned up, so that child_setup has the
17621 same signature on all platforms.
17622
17623 * callproc.c (call_process_cleanup): Now static.
17624 (relocate_fd): Rename locals to avoid shadowing.
17625
17626 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
17627
17628 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17629 not to be necessary, and produces flickering.
17630
17631 2011-03-20 Glenn Morris <rgm@gnu.org>
17632
17633 * config.in: Remove file.
17634
17635 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
17636
17637 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17638 are now in src/globals.h.
17639 (syms_of_minibuf): Remove spurious & from previous change.
17640
17641 2011-03-20 Leo Liu <sdl.web@gmail.com>
17642
17643 * minibuf.c (completing-read-function): New variable.
17644 (completing-read-default): Rename from completing-read.
17645 (completing-read): Call completing-read-function.
17646
17647 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17648
17649 * xfaces.c (Fx_load_color_file):
17650 Read color file from absolute filename (bug#8250).
17651
17652 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17653
17654 * makefile.w32-in: Update dependencies.
17655
17656 2011-03-17 Eli Zaretskii <eliz@gnu.org>
17657
17658 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17659
17660 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17661
17662 Fix more problems found by GCC 4.5.2's static checks.
17663
17664 * process.c (make_serial_process_unwind, send_process_trap):
17665 (sigchld_handler): Now static.
17666
17667 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17668 That way, the code declares only the vars that it needs.
17669 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17670 * s/cygwin.h (PTY_ITERATION): Likewise.
17671 * s/darwin.h (PTY_ITERATION): Likewise.
17672 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17673
17674 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17675 * process.c (allocate_pty): Don't declare stb unless it's needed.
17676
17677 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17678 (CONSTANTLIM): Remove; unused.
17679 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17680 Define only if needed.
17681
17682 * unexelf.c (unexec): Name an expression,
17683 to avoid gcc -Wbad-function-cast warning.
17684 Use a different way to cause a compilation error if anyone uses
17685 n rather than nn, a way that does not involve shadowing.
17686 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17687
17688 * deps.mk (unexalpha.o): Remove; unused.
17689
17690 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17691 * unexec.h: New file.
17692 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17693 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17694 Depend on unexec.h.
17695 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17696 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17697 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17698 Change as necessary to match prototype in unexec.h.
17699
17700 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17701 shadowing.
17702 (back_comment, skip_chars): Mark vars as initialized.
17703
17704 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17705 Rename locals to avoid shadowing.
17706
17707 * lread.c (read1): Rewrite so as not to use empty "else".
17708 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17709
17710 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17711
17712 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17713 warning when compiling print.c.
17714
17715 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17716 instead of using an uninitialized var.
17717 (font_sort_entities): Mark var as initialized.
17718
17719 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17720
17721 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17722 pointers to constants.
17723 (font_parse_fcname): Remove unused vars.
17724 (font_delete_unmatched): Now static.
17725 (font_get_spec): Remove; unused.
17726 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17727 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17728 Rename or move locals to avoid shadowing.
17729
17730 * fns.c (require_nesting_list, require_unwind): Now static.
17731 (Ffillarray): Rename locals to avoid shadowing.
17732
17733 * floatfns.c (domain_error2): Define only if needed.
17734 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17735
17736 * alloc.c (mark_backtrace): Move decl from here ...
17737 * lisp.h: ... to here, so that it can be checked.
17738
17739 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17740 (Fdefvar): Rewrite so as not to use empty "else".
17741 (lisp_indirect_variable): Name an expression,
17742 to avoid gcc -Wbad-function-cast warning.
17743 (Fdefvar): Rename locals to avoid shadowing.
17744
17745 * callint.c (quotify_arg, quotify_args): Now static.
17746 (Fcall_interactively): Rename locals to avoid shadowing.
17747 Use const pointer when appropriate.
17748
17749 * lisp.h (get_system_name, get_operating_system_release):
17750 Move decls here, to check interfaces.
17751 * process.c (get_operating_system_release): Move decl to lisp.h.
17752 * xrdb.c (get_system_name): Likewise.
17753 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17754 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17755 some of which prompt warnings from gcc -Wbad-function-cast.
17756 (Fformat_time_string, Fencode_time, Finsert_char):
17757 (Ftranslate_region_internal, Fformat):
17758 Rename or remove local vars to avoid shadowing.
17759 (Ftranslate_region_internal): Mark var as initialized.
17760
17761 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17762 avoid shadowing.
17763
17764 * lisp.h (eassert): Check that the argument compiles, even if
17765 ENABLE_CHECKING is not defined.
17766
17767 * data.c (Findirect_variable): Name an expression, to avoid
17768 gcc -Wbad-function-cast warning.
17769 (default_value, arithcompare, arith_driver, arith_error): Now static.
17770 (store_symval_forwarding): Rename local to avoid shadowing.
17771 (Fmake_variable_buffer_local, Fmake_local_variable):
17772 Mark variables as initialized.
17773 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17774
17775 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17776 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17777 Rename locals to avoid shadowing.
17778 (mark_stack): Move local variables into the #ifdef region where
17779 they're used.
17780 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17781 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17782 needed otherwise.
17783 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17784 (GC_STRING_CHARS): Remove; not used.
17785 (Fmemory_limit): Cast sbrk's returned value to char *.
17786
17787 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17788 avoids undefined behavior in theory.
17789
17790 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17791
17792 Use functions, not macros, for up- and down-casing (Bug#8254).
17793 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17794 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17795 to use the following functions instead of these macros.
17796 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17797 EMACS_INT, since callers assume the returned value fits in int.
17798 (upcase1): Likewise, for UPCASE_TABLE.
17799 (uppercasep, lowercasep, upcase): New static inline functions.
17800 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17801 the race-condition problem in the old DOWNCASE.
17802
17803 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17804 Rename locals to avoid shadowing.
17805 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17806 (regex_compile, re_search_2, re_match_2_internal):
17807 Remove unused local vars.
17808 (FREE_VAR): Rewrite so as not to use empty "else",
17809 which gcc can warn about.
17810 (regex_compile, re_match_2_internal): Mark locals as initialized.
17811 (RETALLOC_IF): Define only if needed.
17812 (WORDCHAR_P): Likewise. This one is never needed, but is used
17813 only in a comment talking about a compiler bug, so put inside
17814 the #if 0 of that comment.
17815 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17816 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17817 Remove; unused.
17818
17819 * search.c (boyer_moore): Rename locals to avoid shadowing.
17820 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17821 (PREV_CHAR_BOUNDARY): Likewise.
17822
17823 * search.c (simple_search): Remove unused var.
17824
17825 * dired.c (compile_pattern): Move decl from here ...
17826 * lisp.h: ... to here, so that it can be checked.
17827 (struct re_registers): New forward decl.
17828
17829 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17830
17831 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17832 All uses changed.
17833 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17834 Rename locals to avoid shadowing.
17835 (Fvertical_motion): Mark locals as initialized.
17836
17837 * casefiddle.c (casify_object, casify_region): Now static.
17838 (casify_region): Mark local as initialized.
17839
17840 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17841
17842 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17843 New macros, so that the caller can use some names other than
17844 gcpro1, gcpro2, etc.
17845 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17846 of the new macros.
17847 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17848 argument, for consistency with GCPRO2_VAR, etc: it is now the
17849 prefix of the variable, not the variable itself. All uses
17850 changed.
17851 * dired.c (directory_files_internal, file_name_completion):
17852 Rename locals to avoid shadowing.
17853
17854 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17855 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17856 dired.c's scmp function, had undefined behavior.
17857 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17858 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17859 * buffer.h: ... to here, because these macros use current_buffer,
17860 and the new implementation with inline functions needs to have
17861 current_buffer in scope now, rather than later when the macros
17862 are used.
17863 (downcase, upcase1): New static inline functions.
17864 (DOWNCASE, UPCASE1): Reimplement using these functions.
17865 This avoids undefined behavior in expressions like
17866 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17867 from race conditions in accessing the global variables
17868 case_temp1 and case_temp2.
17869 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17870 * lisp.h (case_temp1, case_temp2): Remove their decls.
17871 * character.h (ASCII_CHAR_P): Move from here ...
17872 * lisp.h: ... to here, so that the inline functions mentioned
17873 above can use them.
17874
17875 * dired.c (directory_files_internal_unwind): Now static.
17876
17877 * fileio.c (file_name_as_directory, directory_file_name):
17878 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17879 Now static.
17880 (file_name_as_directory): Use const pointers when appropriate.
17881 (Fexpand_file_name): Likewise. In particular, newdir might
17882 point at constant storage, so make it a const pointer.
17883 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17884 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17885 signedness issues.
17886 (Fset_file_times, Finsert_file_contents, auto_save_error):
17887 Rename locals to avoid shadowing.
17888
17889 * minibuf.c (choose_minibuf_frame_1): Now static.
17890 (Ftry_completion, Fall_completions): Rename or remove locals
17891 to avoid shadowing.
17892
17893 * marker.c (bytepos_to_charpos): Remove; unused.
17894
17895 * lisp.h (verify_bytepos, count_markers): New decls,
17896 so that gcc does not warn that these functions aren't declared.
17897
17898 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17899 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17900 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17901 (copy_text): Remove unused local var.
17902
17903 * filelock.c (within_one_second): Now static.
17904 (lock_file_1): Rename local to avoid shadowing.
17905
17906 * buffer.c (fix_overlays_before): Mark locals as initialized.
17907 (fix_start_end_in_overlays): Likewise. This function should be
17908 simplified by using pointers-to-pointers, but that's a different
17909 matter.
17910 (switch_to_buffer_1): Now static.
17911 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17912 (report_overlay_modification): Rename locals to avoid shadowing.
17913
17914 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17915 Fix pointer signedness issue.
17916 (sys_subshell): Mark local as volatile if checking for lint,
17917 to suppress a gcc -Wclobbered warning that does not seem to be right.
17918 (MAXPATHLEN): Define only if needed.
17919
17920 * process.c (serial_open, serial_configure): Move decls from here ...
17921 * systty.h: ... to here, so that they can be checked.
17922
17923 * fns.c (get_random, seed_random): Move extern decls from here ...
17924 * lisp.h: ... to here, so that they can be checked.
17925
17926 * sysdep.c (reset_io): Now static.
17927 (wait_for_termination_signal): Remove; unused.
17928
17929 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17930 (copy_keymap_item, append_key, push_text_char_description):
17931 Now static.
17932 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17933 (DENSE_TABLE_SIZE): Remove; unused.
17934 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17935 (describe_map_tree):
17936 Rename locals to avoid shadowing.
17937
17938 * keyboard.c: Declare functions static if they are not used elsewhere.
17939 (echo_char, echo_dash, cmd_error, top_level_2):
17940 (poll_for_input, handle_async_input): Now static.
17941 (read_char, kbd_buffer_get_event, make_lispy_position):
17942 (make_lispy_event, make_lispy_movement, apply_modifiers):
17943 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17944 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17945 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17946 (read_key_sequence, read_char): Mark locals as initialized.
17947 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17948
17949 * keyboard.h (make_ctrl_char): New decl.
17950 (mark_kboards): Move decl here ...
17951 * alloc.c (mark_kboards): ... from here.
17952
17953 * lisp.h (force_auto_save_soon): New decl.
17954
17955 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17956 (DEFINE_DUMMY_FUNCTION): New macro.
17957 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17958 Use it.
17959 (main): Add casts to avoid warnings
17960 if GCC considers string literals to be constants.
17961
17962 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17963
17964 * dbusbind.c: Pointer signedness fixes.
17965 (xd_signature, xd_append_arg, xd_initialize):
17966 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17967 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17968 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17969 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17970
17971 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17972 if GCC considers string literals to be constants.
17973 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17974
17975 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17976
17977 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17978 (print_preprocess, print_object): New macro to fix last change.
17979
17980 * print.c (print_preprocess): Don't forget font objects.
17981
17982 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17983
17984 * emacs.c (USAGE3): Doc fixes.
17985
17986 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17987
17988 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17989 structure.
17990
17991 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17992
17993 * lisp.h (VWindow_system, Qfile_name_history):
17994 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17995 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17996 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17997
17998 * w32select.c: Don't #include "keyboard.h".
17999 (run_protected): Add extern declaration for waiting_for_input.
18000
18001 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18002 * w32console.c (detect_input_pending, read_input_pending)
18003 (encode_terminal_code):
18004 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18005 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18006 (w32_system_caret_y, Qfile_name_history):
18007 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18008 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18009 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18010 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18011 * w32proc.c (Qlocal, report_file_error):
18012 * w32term.c (Vwindow_system, updating_frame):
18013 * w32uniscribe.c (initialized, uniscribe_font_driver):
18014 Remove unneeded extern declarations.
18015
18016 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
18017
18018 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18019
18020 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
18021
18022 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18023 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18024 These macros can no longer be used for assignment.
18025
18026 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18027 Assign struct members directly, instead of using BUF_BEGV etc.
18028 (record_buffer_markers, fetch_buffer_markers): New functions for
18029 recording and fetching special buffer markers.
18030 (set_buffer_internal_1, set_buffer_temp): Use them.
18031
18032 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18033
18034 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18035
18036 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18037 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18038
18039 * xdisp.c (hscroll_window_tree):
18040 (reconsider_clip_changes): Use PT instead of BUF_PT.
18041
18042 2011-03-13 Eli Zaretskii <eliz@gnu.org>
18043
18044 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18045 $(EMACS_ROOT)/lib/intprops.h.
18046
18047 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18048
18049 Fix more problems found by GCC 4.5.2's static checks.
18050
18051 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18052 to unsigned char * to avoid compiler diagnostic.
18053 (xg_free_frame_widgets): Make it clear that a local variable is
18054 needed only if USE_GTK_TOOLTIP.
18055 (gdk_window_get_screen): Make it clear that this macro is needed
18056 only if USE_GTK_TOOLTIP.
18057 (int_gtk_range_get_value): New function, which avoids a diagnostic
18058 from gcc -Wbad-function-cast.
18059 (xg_set_toolkit_scroll_bar_thumb): Use it.
18060 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18061 diagnostic from gcc -Wbad-function-cast.
18062 (get_utf8_string, xg_get_file_with_chooser):
18063 Rename locals to avoid shadowing.
18064 (create_dialog): Move locals to avoid shadowing.
18065
18066 * xgselect.c (xg_select): Remove unused var.
18067
18068 * image.c (four_corners_best): Mark locals as initialized.
18069 (gif_load): Initialize transparent_p to zero (Bug#8238).
18070 Mark another local as initialized.
18071 (my_png_error, my_error_exit): Mark with NO_RETURN.
18072
18073 * image.c (clear_image_cache): Now static.
18074 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18075 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18076 (x_edge_detection): Remove unnecessary cast that
18077 gcc -Wbad-function-cast diagnoses.
18078 (gif_load): Fix pointer signedness.
18079 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18080 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18081
18082 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18083
18084 Improve quality of tests for time stamp overflow.
18085 For example, without this patch (encode-time 0 0 0 1 1
18086 1152921504606846976) returns the obviously-bogus value (-948597
18087 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18088 reports time overflow. See
18089 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18090 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18091 * editfns.c: Include limits.h and intprops.h.
18092 (TIME_T_MIN, TIME_T_MAX): New macros.
18093 (time_overflow): Move earlier, to before first use.
18094 (hi_time, lo_time): New functions, for an accurate test for
18095 out-of-range times.
18096 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18097 (Fget_internal_run_time): Don't assume time_t fits in int.
18098 (make_time): Use list2 instead of Fcons twice.
18099 (Fdecode_time): More accurate test for out-of-range times.
18100 (check_tm_member): New function.
18101 (Fencode_time): Use it, to test for out-of-range times.
18102 (lisp_time_argument): Don't rely on undefined left-shift and
18103 right-shift behavior when checking for time stamp overflow.
18104
18105 * editfns.c (time_overflow): New function, refactoring common code.
18106 (Fformat_time_string, Fdecode_time, Fencode_time):
18107 (Fcurrent_time_string): Use it.
18108
18109 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18110 * dired.c (make_time): Move to ...
18111 * editfns.c (make_time): ... here.
18112 * systime.h: Note the move.
18113
18114 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18115
18116 * fringe.c (update_window_fringes): Remove unused variables.
18117
18118 * unexmacosx.c (copy_data_segment): Also copy __got section.
18119 (Bug#8223)
18120
18121 2011-03-12 Eli Zaretskii <eliz@gnu.org>
18122
18123 * termcap.c [MSDOS]: Include "msdos.h".
18124 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18125 Constify `char *' arguments and their references according to
18126 prototypes in tparam.h.
18127
18128 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18129
18130 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18131 Adapt all references accordingly.
18132
18133 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18134
18135 2011-03-11 Tom Tromey <tromey@redhat.com>
18136
18137 * buffer.c (syms_of_buffer): Remove obsolete comment.
18138
18139 2011-03-11 Eli Zaretskii <eliz@gnu.org>
18140
18141 * termhooks.h (encode_terminal_code): Declare prototype.
18142
18143 * msdos.c (encode_terminal_code): Don't declare prototype.
18144
18145 * term.c (encode_terminal_code): Now external again, used by
18146 w32console.c and msdos.c.
18147
18148 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18149 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18150
18151 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
18152
18153 Fix some minor problems found by GCC 4.5.2's static checks.
18154
18155 * fringe.c (update_window_fringes): Mark locals as initialized
18156 (Bug#8227).
18157 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18158
18159 * alloc.c (mark_fringe_data): Move decl from here ...
18160 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18161 to check its interface.
18162 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18163
18164 * fontset.c (free_realized_fontset): Now static.
18165 (Fset_fontset_font): Rename local to avoid shadowing.
18166 (fontset_font): Mark local as initialized.
18167 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18168
18169 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18170
18171 * xselect.c (x_disown_buffer_selections): Remove; not used.
18172 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18173 (x_own_selection, Fx_disown_selection_internal): Rename locals
18174 to avoid shadowing.
18175 (x_handle_dnd_message): Remove local to avoid shadowing.
18176
18177 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18178 so that the caller can use some name other than gcpro1.
18179 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18180 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18181 (Fx_backspace_delete_keys_p):
18182 Use them to avoid shadowing, and rename vars to avoid shadowing.
18183 (x_decode_color, x_set_name, x_window): Now static.
18184 (Fx_create_frame): Add braces to silence GCC warning.
18185 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18186 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18187 Remove unused locals.
18188 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18189 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18190 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18191 macros.
18192
18193 * xterm.h (x_mouse_leave): New decl.
18194
18195 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18196 Remove unused functions.
18197 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18198 (x_calc_absolute_position): Now static.
18199 (XTread_socket): Don't define label "out" unless it's used.
18200 Don't declare local "event" unless it's used.
18201 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18202 unless they are used.
18203 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18204 (x_fatal_error_signal): Remove; not used.
18205 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18206 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18207 (x_error_catcher, x_connection_closed, x_error_handler):
18208 (x_error_quitter, xembed_send_message, x_iconify_frame):
18209 (my_log_handler): Rename locals to avoid shadowing.
18210 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18211 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18212
18213 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18214 Rename or move locals to avoid shadowing.
18215 (tty_defined_color, merge_face_heights): Now static.
18216 (free_realized_faces_for_fontset): Remove; not used.
18217 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18218 does not deduce is never used uninitialized.
18219 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18220 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18221
18222 * terminal.c (store_terminal_param): Now static.
18223
18224 * xmenu.c (menu_highlight_callback): Now static.
18225 (set_frame_menubar): Remove unused local.
18226 (xmenu_show): Rename parameter to avoid shadowing.
18227 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18228 since they might point to immutable storage.
18229 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18230 since it's unused otherwise.
18231
18232 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18233 Add a FIXME, since the code still doesn't look right. (Bug#8215)
18234 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18235 avoids a gcc -Wuninitialized diagnostic.
18236 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18237 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18238 does not deduce are never used uninitialized.
18239
18240 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18241
18242 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18243 * window.c (window_loop, size_window):
18244 (run_window_configuration_change_hook, enlarge_window): Likewise.
18245
18246 * window.c (display_buffer): Now static.
18247 (size_window): Mark variables that gcc -Wuninitialized
18248 does not deduce are never used uninitialized.
18249 * window.h (check_all_windows): New decl, to forestall
18250 gcc -Wmissing-prototypes diagnostic.
18251 * dispextern.h (bidi_dump_cached_states): Likewise.
18252
18253 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18254 shadowing.
18255 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18256 Include <limits.h>.
18257 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18258 and to avoid gcc -Wuninitialized warning.
18259 (load_charset_map): Mark variables that gcc -Wuninitialized
18260 does not deduce are never used uninitialized.
18261 (load_charset): Abort instead of using uninitialized var (Bug#8229).
18262
18263 * coding.c (coding_set_source, coding_set_destination):
18264 Use "else { /* comment */ }" rather than "else /* comment */;"
18265 for clarity, and to avoid gcc -Wempty-body warning.
18266 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18267 a block, when the outer 'i' will do.
18268 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18269 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18270 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18271 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18272 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18273 Rename locals to avoid shadowing.
18274 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
18275 * coding.c (emacs_mule_char, encode_invocation_designation):
18276 Now static, since they're not used elsewhere.
18277 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
18278 (decode_coding_object, encode_coding_object, detect_coding_system):
18279 (decode_coding_emacs_mule): Mark variables that gcc
18280 -Wuninitialized does not deduce are never used uninitialized.
18281 (detect_coding_iso_2022): Initialize a local variable that might
18282 be used uninitialized. Leave a FIXME because it's not clear that
18283 this initialization is needed. (Bug#8211)
18284 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18285 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18286 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18287 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18288 Remove unused macros.
18289
18290 * category.c (hash_get_category_set): Remove unused local var.
18291 (copy_category_table): Now static, since it's not used elsewhere.
18292 * character.c (string_count_byte8): Likewise.
18293
18294 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18295 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18296
18297 * chartab.c (copy_sub_char_table): Now static, since it's not used
18298 elsewhere.
18299 (sub_char_table_ref_and_range, char_table_ref_and_range):
18300 Rename locals to avoid shadowing.
18301 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
18302
18303 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18304 (BIDI_BOB): Remove unused macro.
18305
18306 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18307 deduce are never used uninitialized.
18308 * term.c (encode_terminal_code): Likewise.
18309
18310 * term.c (encode_terminal_code): Now static. Remove unused local.
18311
18312 * tparam.h: New file.
18313 * term.c, tparam.h: Include it.
18314 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18315 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18316 Move these decls to tparam.h, and make them agree with what
18317 is actually in tparam.c. The previous trick of using incompatible
18318 decls in different modules does not conform to the C standard.
18319 All callers of tparam changed to use tparam's actual API.
18320 * tparam.c (tparam1, tparam, tgoto):
18321 Use const pointers where appropriate.
18322
18323 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18324 * cm.h (struct cm): Likewise.
18325 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18326 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18327 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18328 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18329 (turn_on_face, init_tty): Likewise.
18330 * termchar.h (struct tty_display_info): Likewise.
18331
18332 * term.c (term_mouse_position): Rename local to avoid shadowing.
18333
18334 * alloc.c (mark_ttys): Move decl from here ...
18335 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18336
18337 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18338
18339 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18340
18341 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
18342
18343 * search.c (compile_pattern_1): Remove argument regp, unused since
18344 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18345 (compile_pattern): Don't pass it.
18346
18347 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18348
18349 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18350 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18351 for ! HAVE_GTK3.
18352 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18353
18354 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18355
18356 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18357 gdk_window_get_screen, gdk_window_get_geometry,
18358 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18359 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18360 (xg_get_pixbuf_from_pixmap): New function.
18361 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18362 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18363 Call xg_get_pixbuf_from_pixmap instead of
18364 gdk_pixbuf_get_from_drawable.
18365 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18366 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18367 (xg_check_special_colors): Use GtkStyleContext and its functions
18368 for HAVE_GTK3.
18369 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18370 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18371 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18372 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18373 Call gtk_widget_get_preferred_size.
18374 (xg_frame_resized): gdk_window_get_geometry only takes 5
18375 parameters.
18376 (xg_win_to_widget, xg_event_is_for_menubar):
18377 Call gdk_x11_window_lookup_for_display.
18378 (xg_set_widget_bg): New function.
18379 (delete_cb): New function.
18380 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18381 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18382 (xg_set_background_color): Call xg_set_widget_bg.
18383 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18384 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18385 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18386 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18387 if ! HAVE_GTK3.
18388 (update_frame_tool_bar): Call gtk_widget_hide.
18389 (xg_initialize): Use GDK_KEY_g.
18390
18391 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18392 if ! HAVE_GTK3
18393 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18394
18395 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18396 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18397 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18398
18399 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18400
18401 * w32xfns.c (select_palette): Check success of RealizePalette against
18402 GDI_ERROR, not zero.
18403
18404 See ChangeLog.11 for earlier changes.
18405
18406 ;; Local Variables:
18407 ;; coding: utf-8
18408 ;; End:
18409
18410 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18411
18412 This file is part of GNU Emacs.
18413
18414 GNU Emacs is free software: you can redistribute it and/or modify
18415 it under the terms of the GNU General Public License as published by
18416 the Free Software Foundation, either version 3 of the License, or
18417 (at your option) any later version.
18418
18419 GNU Emacs is distributed in the hope that it will be useful,
18420 but WITHOUT ANY WARRANTY; without even the implied warranty of
18421 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18422 GNU General Public License for more details.
18423
18424 You should have received a copy of the GNU General Public License
18425 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.